How-to · Intermediate · 3 min read
I2S Microphones and Audio on ESP32
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
An I2S microphone such as the INMP441 converts sound to digital samples inside the microphone and sends them over three wires: bit clock (SCK), word select (WS) and data (SD). The ESP32's I2S peripheral reads them with DMA, so there is no analog noise to fight. Use 16 kHz for voice and 44.1 or 48 kHz for music. Pair it with a MAX98357A I2S amplifier for audio output.
Key specs at a glance
- INMP441
- 24-bit, 3.3 V, about 61 dB SNR, omnidirectional MEMS
- Pins
- VDD, GND, SCK (BCLK), WS (LRCLK), SD (data), L/R channel select
- Sample rates
- 8 to 48 kHz; 16 kHz for voice
- Frame
- 24-bit data in a 32-bit slot, MSB first
- ESP32 support
- Classic ESP32, S2, S3 and C3 have I2S; S3 best for voice AI
- Output partner
- MAX98357A I2S class-D amp, about 3 W into 4 Ω
Wiring an INMP441 to an ESP32
Connect VDD to 3.3 V (never 5 V), GND to GND, L/R to GND to select the left channel, then SCK, WS and SD to three free GPIOs, for example GPIO 26, 25 and 33 on a classic ESP32. Keep the wires short, under about 10 cm, as these are fast clock lines.
To use two microphones for stereo, connect both to the same SCK, WS and SD lines and tie one L/R pin to GND and the other to 3.3 V.
Reading samples
In the Arduino ESP32 core, configure I2S in receive mode, master, 32-bit samples, one channel, at 16000 Hz, and read into a buffer with i2s_read() (or the ESP_I2S library on core 3.x). Each 32-bit value holds 24 bits of data at the top: shift right by 8 (or 14 to 16 for a quieter, simpler 16-bit value).
From the buffer you can: - compute RMS for a sound level meter, then calibrate to dB against a reference meter; - run an FFT (arduinoFFT) for a spectrum display on WS2812B LEDs or a TFT; - save WAV files to a microSD card; - stream audio over Wi-Fi or use ESPHome's voice assistant with an ESP32-S3.
Tips and audio output
Discard the first few hundred milliseconds of samples, as the microphone settles at start-up. If you only hear noise, the bit depth or channel setting is wrong: try the right channel or change the shift. Mount the microphone with its port hole facing the sound and keep it away from fans.
For sound out, the MAX98357A amplifier takes the same I2S signals (on a second I2S port or shared clocks) and drives a 4 to 8 Ω speaker directly.
Try it: dB converter calculator
Change the values and the diagram and results update as you type.
Record sound levels with an INMP441 and ESP32
You need: ESP32 development board, INMP441 microphone module, 6 jumper wires · Tools: Computer with Arduino IDE and the ESP32 core
Get the parts3 of 3 found in our store · ₹1,362
ESP32 development boardWemos ESP32 Development Board with 18650 Battery Shield₹929
INMP441 microphone moduleINMP441 MEMS High Precision Omnidirectional Microphone Module I2S₹139
6 jumper wiresDupont Jumper Wires (40 pcs)₹49
- 1Wire powerConnect VDD to 3.3V, GND to GND and L/R to GND.
- 2Wire I2SConnect SCK, WS and SD to three free GPIOs.
- 3Configure I2SSet receive mode, 16 kHz, 32-bit samples, left channel only.
- 4Read and scaleRead a buffer of samples and shift each right by 8 bits.
- 5Compute levelCalculate RMS for each buffer and print it; clap to see it rise.
Common mistakes to avoid
- Powering the INMP441 from 5 V.
- Reading the wrong channel, giving silence.
- Treating 24-bit data as 32-bit and getting huge values.
- Long, loose clock wires causing noise.
- Expecting I2S on an Arduino Uno.
Frequently asked questions
What is the difference between an I2S and an analog microphone?
An I2S microphone digitises sound inside the module, so the signal is immune to ADC noise and needs no amplifier.
Does the INMP441 work with Arduino Uno?
No. The Uno has no I2S peripheral. Use an ESP32, Raspberry Pi Pico or another board with I2S.
Why does my INMP441 only output zeros?
Usually the L/R pin and channel setting do not match, or SCK and WS are swapped.
What sample rate should I use?
16 kHz for voice and speech recognition; 44.1 or 48 kHz for music.
Can ESP32 do voice recognition with an I2S mic?
Yes. ESP32-S3 boards run wake-word detection, and ESPHome can stream voice to Home Assistant.
Parts for this guide
Calculators
Terms in this guide
Keep learning
Sources
- TDK InvenSense INMP441 datasheet
- Espressif ESP-IDF I2S driver documentation
- Analog Devices MAX98357A datasheet
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.


