INMP441 + ESP32: Pinout, Wiring Diagram and Working I2S Code
Share
INMP441 + ESP32: Pinout, Wiring Diagram and Working I2S Code
Quick answer: wire VDD to 3V3, GND to GND, SCK to GPIO26, WS to GPIO25, SD to GPIO33 and L/R to GND. With L/R grounded the microphone sends on the left I2S channel, so the code must read the left slot. The INMP441 is a 3.3 V-maximum part, so never connect it to 5 V.
What are the INMP441 module pins?
The module breaks out the six INMP441 signals the TDK InvenSense datasheet describes. The listing photo shows the pads but not their labels (they are printed on the other side), so this table gives names, not positions. Turn the board over and match each wire to its printed label.
| Pin | Function | Source |
|---|---|---|
| VDD | Supply, 1.62–3.63 V | Datasheet |
| GND | Ground | Datasheet |
| SCK | I2S bit clock input | Datasheet |
| WS | I2S word select (left/right frame) input | Datasheet |
| SD | I2S serial data output (tri-stated when not its channel's turn) | Datasheet |
| L/R | Channel select: low = left, high = right | Datasheet |
How do you wire the INMP441 to an ESP32?
| INMP441 pin | ESP32 DevKit pin | Why this pin |
|---|---|---|
| VDD | 3V3 | Datasheet maximum is 3.63 V |
| GND | GND | Common ground |
| SCK | GPIO26 | Output-capable, not strapping; the ESP32 drives this clock |
| WS | GPIO25 | Output-capable, not strapping; the ESP32 drives this frame clock |
| SD | GPIO33 | Input for the microphone's data |
| L/R | GND | Selects the left channel; never leave it floating |
Which ESP32 pins should you avoid?
Every GPIO choice on this page follows the same rules for the 30-pin ESP32-WROOM-32 DevKit (the board Compoden stocks as the ESP32 30-pin CP2102 development board). Espressif's ESP32 GPIO reference is the source:
- Never use GPIO6–11. They connect to the module's SPI flash.
- Avoid the strapping pins GPIO0, 2, 5, 12 and 15 for sensors. Their level at reset decides boot mode and flash voltage, so a sensor holding one of them can stop the board booting. GPIO0 is not even on the 30-pin header; it only goes to the BOOT button.
- GPIO34, 35, 36 and 39 are input-only and have no internal pull-up or pull-down. They are ideal for analog inputs and useless for outputs or clocks.
- Use ADC1 (GPIO32–39) for analog readings. ADC2 pins (GPIO0, 2, 4, 12–15, 25–27) cannot be read while Wi-Fi is running.
- Leave GPIO1 and GPIO3 alone. They carry the USB serial link used for uploads and the Serial Monitor.
- ESP32 GPIOs are 3.3 V only. They are not 5 V tolerant.
What voltage does the INMP441 need?
The datasheet's supply range is 1.62–3.63 V, and its absolute maximum is 3.63 V on VDD. The digital inputs must stay within VDD + 0.3 V. The ESP32's 3V3 pin and 3.3 V GPIOs match it directly; a 5 V board would need level shifting and a separate 3.3 V supply.
The datasheet allows an SCK frequency of 0.5–3.2 MHz and a WS (sample) rate of 7.8–50 kHz. The sketch's 16 kHz sample rate with 32-bit stereo slots gives a bit clock of about 1.02 MHz, inside that window. The datasheet also recommends a 100 kΩ pull-down on SD; add one if you see noise when the microphone is not driving the line.
Working Arduino code for the INMP441 on ESP32
This sketch uses ESP_I2S, which ships inside the ESP32 Arduino core 3.x; no extra library is needed. The INMP441 sends 24-bit samples left-aligned in 32-bit slots, so each sample is shifted right by 8 bits. The sketch prints a peak level you can watch in the Serial Plotter while you clap or talk.
// INMP441 I2S MEMS microphone + ESP32 DevKit (ESP32-WROOM-32)
// Wiring: VDD -> 3V3, GND -> GND, SCK -> GPIO26, WS -> GPIO25, SD -> GPIO33, L/R -> GND (left)
// Needs ESP32 Arduino core 3.x (ESP_I2S is part of the core).
#include <ESP_I2S.h>
const int I2S_SCK = 26;
const int I2S_WS = 25;
const int I2S_SD = 33;
I2SClass i2s;
int32_t samples[256];
void setup() {
Serial.begin(115200);
i2s.setPins(I2S_SCK, I2S_WS, -1, I2S_SD); // bclk, ws, dout (unused), din
if (!i2s.begin(I2S_MODE_STD, 16000, I2S_DATA_BIT_WIDTH_32BIT,
I2S_SLOT_MODE_MONO, I2S_STD_SLOT_LEFT)) {
Serial.println("I2S init failed");
while (true) delay(1000);
}
}
void loop() {
size_t bytes = i2s.readBytes((char *)samples, sizeof(samples));
size_t n = bytes / sizeof(int32_t);
int32_t peak = 0;
for (size_t i = 0; i < n; i++) {
int32_t s = samples[i] >> 8; // 24-bit sample, MSB-aligned in a 32-bit slot
if (s < 0) s = -s;
if (s > peak) peak = s;
}
Serial.println(peak); // open the Serial Plotter and clap
delay(50);
}
Compile check: this exact sketch compiled for the esp32:esp32:esp32 board (ESP32 Dev Module, ESP32 Arduino core 3.3.10) on 5 October 2026. A clean compile proves the code and libraries agree. It does not prove your wiring, so test it on the bench with the Serial Monitor at 115200 baud.
On the older 2.x core, ESP_I2S.h does not exist and the I2S API is different. Update the ESP32 board package to 3.x in Boards Manager before compiling.
Common mistakes with the INMP441 and ESP32
- L/R left floating. The channel becomes undefined, and you may read silence.
- Reading the wrong slot. With L/R on GND the data is in the left slot; reading the right slot gives zeros.
- SCK or WS on GPIO34–39. Those pins are input-only and cannot generate clocks.
- 5 V on VDD. It exceeds the 3.63 V absolute maximum.
- Forgetting the 8-bit shift. Unshifted samples look 256 times too large.
- Long, loose jumper wires. I2S clocks pick up noise; keep the wires short.
Where can you get the parts?
| Item | Role | Link |
|---|---|---|
| INMP441 I2S MEMS microphone module | Digital microphone | View INMP441 module |
| ESP32 30-pin CP2102 development board | Controller with I2S, Wi-Fi and Bluetooth | View ESP32 board |
Want this sensor in a bigger build? Describe the whole device in Soldr, for example “I want to build a classroom noise level meter with an ESP32 and an INMP441”. Soldr returns the exact parts, a wiring map and code that compiles, all from one parts list, so the pins in the code match the pins in the wiring. Compoden stocks the parts and delivers across India.
Sources
Pin functions, supply limits, clock ranges and data format: TDK InvenSense INMP441 datasheet DS-INMP441-00 (distributor-hosted copy). ESP32 pin rules: Espressif ESP32 GPIO reference. Module listing: Compoden INMP441.
Related ESP32 wiring guides
- Vibe coding hardware: build an ESP32 project from one sentence
- TCS34725 colour sensor + ESP32
- DHT22 temperature and humidity + ESP32
- XKC-Y25-V non-contact liquid level + ESP32
- 5 mm LDR light sensor + ESP32
- Capacitive soil moisture sensor v2.0 + ESP32
- HX711 and 5 kg load cell + ESP32
- Water level sensor + ESP32
- AS5600 magnetic angle sensor + ESP32
- AHT21B temperature and humidity + ESP32
Frequently asked questions
Which ESP32 pins should I use for the INMP441?
Any output-capable, non-strapping GPIOs for SCK and WS, and any input for SD. A safe set on the 30-pin DevKit is SCK on GPIO26, WS on GPIO25 and SD on GPIO33, with L/R tied to GND.
Can the INMP441 run on 5 V?
No. Its absolute maximum supply is 3.63 V. Power it from the ESP32's 3V3 pin.
Why does my INMP441 only return zeros?
Usually the code reads the right channel while L/R is grounded, L/R is floating, or SCK/WS sit on input-only pins. Check those before blaming the microphone.