← How-Tos
electronics 10 hr ago ◯ 6 min read

I2S vs PDM Microphones for Voice Capture on ESP32 and Raspberry Pi: Wiring, Clock Modes, and Choosing the Right Mic

i2spdmmicrophoneesp32raspberry piinmp441audio

This site's ESP32 I2S audio guide wires up a MAX98357A DAC for output and an INMP441 microphone for input, and that's a perfectly good starting point — but INMP441 is only one of two fundamentally different digital microphone interfaces you'll run into when picking a mic for a voice, wake-word, or audio-logging project. The other is PDM (pulse-density modulation), and it shows up often enough on ESP32 dev boards, Raspberry Pi HATs, and standalone breakout boards that picking the wrong one for your wiring, your firmware stack, or your available pins is an easy mistake to make before you've written a line of code.

Two Different Ways to Digitize Sound

Both I2S and PDM microphones convert analog sound into a digital bitstream right on the microphone module rather than handing you an analog signal to convert yourself, which is why both are called "digital MEMS microphones" and get confused for being the same thing. The difference is in how that digitization is represented on the wire. An I2S microphone (like the INMP441 or ICS-43434) outputs properly framed PCM audio data — words of a defined bit depth, synchronized to a word-select clock that marks left/right channel boundaries — over three or four wires: bit clock (BCLK), word select/left-right clock (LRCLK or WS), and serial data (SD), plus power and ground. A PDM microphone outputs a single-bit stream at a very high sample rate (typically in the single-digit megahertz), where the density of 1s versus 0s over a short window represents the amplitude, and that bitstream needs to be decimated and filtered down to a normal PCM sample rate before it's usable audio — work that's normally done either by dedicated hardware inside your microcontroller's audio peripheral or by a software PDM filter.

InterfaceWires NeededOutput FormatTypical ChipsDecimation Needed I2SBCLK, WS/LRCLK, SD (3 data lines) + power/groundFramed PCM, ready to useINMP441, ICS-43434, SPH0645No — already PCM PDMCLK, DATA (2 data lines) + power/ground1-bit oversampled streamMP34DT01, ICS-41350, many on-board laptop/phone micsYes — hardware or software filter required

Wiring: Why PDM Looks Simpler and Sometimes Is

A PDM microphone needs only two signal wires (clock and data) versus I2S's three, and multiple PDM microphones can often share the same clock and data lines with each mic using a different data-line edge or channel-select pin to distinguish itself — this is exactly how many laptops and phones run stereo PDM mic arrays off a shared bus with minimal pin count. That pin economy is PDM's biggest practical advantage on a pin-constrained board. The catch is that PDM's single-bit, megahertz-rate signal is far more sensitive to trace length, noise, and signal integrity than I2S's framed, lower-rate signal, so PDM microphones are typically specified for short, carefully routed traces on a PCB rather than long jumper wires on a breadboard. If you're prototyping with jumper wires on a breadboard, I2S tolerates that sloppiness far better than PDM does, and a PDM mic on long breadboard leads is a common source of inexplicably noisy or garbled audio that has nothing to do with your code.

ESP32 Support: Both Work, With Caveats

The ESP32's I2S peripheral natively supports both standard I2S and PDM input modes on the same hardware block, so hardware support isn't the deciding factor on most ESP32 variants — check your specific chip's datasheet for which I2S controller instances support PDM, since not every I2S peripheral on every ESP32 variant does. In the Arduino/ESP-IDF ecosystem, I2S has the deeper, more mature library support and the overwhelming majority of published example code, tutorials, and this site's own I2S audio guide assume an I2S microphone. PDM support exists in ESP-IDF but with a smaller community footprint and fewer worked examples to copy from, so expect to read the I2S/PDM sections of the ESP-IDF peripheral documentation directly rather than finding a drop-in Arduino library for every possible PDM mic model.

Raspberry Pi: PDM Has the Native Advantage

On Raspberry Pi, the situation flips. The Pi's I2S interface is a single peripheral without the flexible multi-instance I2S/PDM switching the ESP32 offers, and several popular Pi audio HATs and the official microphone-equipped camera-adjacent accessories lean on PDM mic arrays specifically because PDM's lower pin count and the Pi's software decimation path (through the kernel's ALSA PDM driver support on supported HATs) make multi-microphone arrays easier to wire than an equivalent number of I2S mics would be. If you're building something like a far-field voice assistant satellite with multiple microphones for beamforming or wake-word direction-of-arrival estimation, check what your chosen Pi HAT actually implements before assuming — some are PDM arrays, some use a single I2S mic, and the two aren't interchangeable at the software level even if both eventually produce PCM audio for your application.

Choosing for Your Project

For a single-microphone ESP32 project — voice command capture, simple audio logging, a VU meter, anything this site's existing I2S guide or audio spectrum analyzer project already demonstrates — stick with an I2S mic like the INMP441. The wiring is more forgiving on a breadboard, the library support is deeper, and there's no decimation filter to configure or debug. Reach for PDM specifically when pin count is genuinely tight (you're already out of GPIO for other peripherals and need to add a mic), when you're working from a reference design or HAT that already specifies PDM mics, or when you need to run several microphones off a shared two-wire bus for an array/beamforming application and don't want to burn three I2S pins per additional microphone. Don't reach for PDM "because it's newer" or because a datasheet looks more impressive — for the majority of ESP32 and Raspberry Pi maker projects involving a single microphone, I2S remains the lower-friction choice.

A Note on Analog Electret Mics

It's worth distinguishing both of these from the cheap analog electret microphone modules (often just labeled "MAX9814" or generic "sound sensor" boards) that output a raw analog voltage you'd read with an ADC pin instead of a digital bus. Those are simpler to wire (one analog signal wire plus power/ground) and cheaper, but they pick up far more electrical noise, lack the gain and filtering built into digital MEMS mics, and are a poor choice for anything beyond basic sound-level detection or clap-triggered projects. If a project description says "microphone" without specifying I2S or PDM and you find a three- or four-pin digital breakout for a few dollars more than the analog option, the digital option is almost always worth the small price difference for cleaner audio.