Blog
ESP32 Microphone: INMP441, I2S Mic
Does the ESP32 have a microphone? Not out of the box — you add one. The INMP441 over I2S is the community default, and this FAQ covers wiring, recording, and the mistakes that make your first take silent.
Is ESP32 a Microcontroller?
Yes — dual-core Xtensa LX6 at up to 240MHz, no MMU, no OS. It’s a microcontroller, not a microprocessor, and that boundary explains most audio advice you’ll read: no codecs, no audio stack, so you wire a mic and stream samples over I2S yourself. The chip does have an ADC, but it’s for sensors, not audio.
Does ESP32 Have a Microphone?
Not on the chip itself — audio comes in over I2S or the ADC. Plain WROOM dev boards have no mic; a few ESP32-S3 boards (XIAO ESP32S3 Sense, Korvo-style devkits) mount a MEMS mic, so check your specific board’s docs before buying anything. Most of us just add an INMP441 module for a couple of dollars.
Does ESP32 Do I2S?
Yes — two full-duplex I2S peripherals, up to 24-bit. The official docs are vague about pin allocation; what matters is that I2S is the only clean way to capture audio on this chip — the built-in ADC tops out around 1kHz of usable bandwidth and picks up rail noise. Digital mics like the INMP441 are I2S devices, which is why they dominate tutorials.
How to Connect INMP441 to ESP32?
Five wires: VDD→3.3V, GND→GND, SD→GPIO32, WS→GPIO33, SCK→GPIO25 — plus the L/R pin to GND to select the left channel. Floating L/R was my first silent-recording bug on a WROOM-32D. In code: an i2s_config with I2S_MODE_MASTER|I2S_MODE_RX at 16000Hz, then i2s_driver_install and i2s_read into a buffer. Feed it 3.3V, never 5V.
Why Is My Recording Silent or Full of Noise?
Silent: L/R floating, SD on the wrong pin, or the mic fed from 5V. Noise: a sample-rate mismatch between the WS/SCK config and the driver, or an analog mic on the ADC — a MAX9814 works but the ESP32 ADC is noisy, and the I2S driver gain is fixed, so fix levels at the source. Print i2s_read’s byte count: zero bytes means wiring, garbage means config. Our knowledge base has a per-board pin table.
How to Record Audio on ESP32?
i2s_read gives 16-bit PCM; wrap it in a RIFF/WAV header and write to SD or LittleFS. Budget: 16kHz mono 16-bit is 32KB/s, 44.1kHz stereo is 176KB/s. Flash holds minutes at best — long clips go on an SD card.
How to Use MicroPython on ESP32?
Works — machine.I2S has supported mic capture since MicroPython 1.19, roughly. Installation is the usual drill: download firmware.bin, esptool erase_flash, write_flash; then from machine import I2S. Code is shorter than Arduino but examples are scarcer, so the Arduino path remains the better-documented default — same chip underneath.
Can I Stream Mic Audio over Wi-Fi?
Yes, if you design for it. Pin I2S reading to core 1 and Wi-Fi to core 0, use a ring buffer, and expect 150–250ms latency over WebSocket; UDP drops packets under load. I’ve streamed 8kHz mono to a browser dashboard at workable latency — 44.1kHz stereo over Wi-Fi is where it falls apart. The Wi-Fi FAQ covers the connection half.
Which Microphone Should I Buy?
INMP441 (I2S, ~$2–3) for voice; MAX9814 (analog, has AGC) if you must use an analog pin; MAX4466 for a cheap electret. If your board has a mic socket, check the module’s pinout first — mostly works, but S2/S3 variants differ.
Can I Practice Audio Projects without Hardware?
You can prototype the wiring and the I2S read loop in the free ESP32 simulator, then flash the same sketch to hardware. Code flow, pin choices, and buffer logic carry over; only raw sound quality is simulator-approximate. Boards arrive faster than debugging skills — start in the browser at app.sensbench.com.