INMP441 I2S Digital MEMS Microphone Module – ESP32 Wiring, Arduino Code & Troubleshooting

AUSCOMTECH PRODUCT SUPPORT

INMP441 I2S Digital MEMS Microphone Module – ESP32 Wiring, Arduino Code & Troubleshooting

Model: INMP441 (microphone IC; breakout-board model unspecified)

The INMP441 is a compact, omnidirectional digital MEMS microphone that captures sound and sends audio data to a microcontroller using the I2S (Inter-IC Sound) interface.

Unlike analogue microphone modules, the INMP441 includes its own analogue-to-digital converter and provides 24-bit digital audio data. It is suitable for sound monitoring, voice-input projects, audio recording and other applications requiring digital microphone input.

This guide explains how to connect the INMP441 to an ESP32, configure the Arduino IDE, test the microphone using a complete example sketch and troubleshoot common problems.

INMP441 Microphone Overview

The INMP441 combines a miniature MEMS sensing element, signal-conditioning circuitry, analogue-to-digital conversion and an I2S digital audio interface.

It detects sound from multiple directions and produces digital audio samples that can be processed by an ESP32 or another compatible digital audio controller.

Microphone IC INMP441
Supply Voltage 3.3V Recommended
Audio Interface Digital I2S
Audio Resolution 24-bit
Microphone Pattern Omnidirectional
Signal-to-Noise Ratio 61 dBA Typical
Frequency Response 60Hz–15kHz
Typical Supply Current 2.2mA at 3.3V
Digital microphone — not an analogue sound sensor

The INMP441 does not produce a conventional analogue voltage proportional to sound level. It sends digital audio samples over I2S.

It cannot be read using the Arduino analogRead() function or connected as an ordinary analogue microphone module.

Important Power and Compatibility Information

Use a regulated 3.3V supply for the example in this guide.

The INMP441 microphone IC has a specified operating supply range extending up to 3.63V. It is not a 5V-tolerant device.

Although some module listings advertise a 3.3V–5V supply, this does not establish that the supplied breakout board contains a voltage regulator or logic-level protection.

Unless the exact board circuitry is verified, connect VDD to 3.3V and use 3.3V I2S signals. Do not connect VDD, SCK, WS or L/R directly to 5V.

Which Microcontroller Should I Use?

For this guide, an ESP32 development board is recommended because it provides a hardware I2S interface and suitable 3.3V GPIO signals.

Controller Suitability Notes
ESP32 DevKit (original ESP32) Recommended Hardware I2S support; used in this guide.
Other ESP32 variants Suitable Requires compatible I2S support and appropriate GPIO selection.
Raspberry Pi Pico / Pico W Possible Requires a suitable I2S receiver implementation and different example code.
Arduino UNO R3 Not recommended No dedicated hardware I2S receiver; the 5V GPIO signals are also unsuitable for direct connection.
Raspberry Pi Suitable Requires Linux I2S audio configuration and suitable GPIO connections.

INMP441 Module Connections

Common INMP441 breakout modules expose six connections. Their functions are listed below.

Module Pin Function Description
VDD / VCC Power Supply Connect to regulated 3.3V.
GND Ground Connect to the controller ground.
SCK / BCLK I2S Bit Clock Receives the serial audio bit clock from the controller.
WS / LRCLK I2S Word Select Identifies the left and right audio channel periods.
SD / DOUT Serial Data Output Sends digital microphone samples to the controller.
L/R Channel Selection Connect to GND for left-channel output or 3.3V for right-channel output.
Check the labels on your module

INMP441 breakout boards can have different layouts. Match connections using the markings printed on your particular PCB rather than assuming a specific physical pin order.

The microphone IC itself also has internal connections, including an enable function, that are not necessarily exposed on the breakout board.

Left and Right Channel Selection

The INMP441 can transmit its audio samples in either the left or right I2S channel slot.

L/R Connection Selected Channel
GND Left channel
3.3V (VDD) Right channel

For the examples below, connect L/R to GND so the microphone transmits in the left channel.

Do not leave L/R floating. An undefined channel selection can result in unexpected or missing microphone data.

Connecting the INMP441 to an ESP32

The following example uses a conventional ESP32 DevKit development board with an original ESP32 microcontroller.

Required Components

  • INMP441 digital MEMS microphone module
  • ESP32 DevKit development board
  • USB data cable suitable for the ESP32
  • Breadboard or suitable connection method
  • Jumper wires
  • Computer with Arduino IDE installed

ESP32 Wiring Table

INMP441 Module ESP32 Connection Purpose
VDD / VCC 3V3 3.3V microphone power
GND GND Common ground
SCK GPIO26 I2S bit clock
WS GPIO25 I2S word select
SD GPIO33 I2S audio data input
L/R GND Select left audio channel

Step-by-Step Connections

  1. Disconnect the ESP32 from USB power before wiring.
  2. Connect the microphone VDD pin to the ESP32 3V3 output.
  3. Connect the microphone GND pin to an ESP32 GND pin.
  4. Connect SCK to GPIO26.
  5. Connect WS to GPIO25.
  6. Connect SD to GPIO33.
  7. Connect L/R to GND to select the left channel.
  8. Check every connection before reconnecting USB power.
Keep I2S connections short and secure.

I2S uses relatively fast digital clock signals. Loose breadboard connections, poor grounding or unnecessarily long jumper wires may produce corrupted or intermittent audio data.

For initial testing, place the microphone close to the ESP32 and avoid routing signal wires alongside electrically noisy power cables.

Arduino IDE and ESP32 Software Setup

The example uses the Arduino IDE with the official Espressif ESP32 board package.

1. Install Arduino IDE

Install a current Arduino IDE version on your computer.

2. Install ESP32 Board Support

  1. Open Arduino IDE.
  2. Open File > Preferences (or the corresponding Arduino IDE settings).
  3. Add the official Espressif ESP32 Boards Manager URL if it is not already configured.
  4. Open Tools > Board > Boards Manager.
  5. Search for esp32.
  6. Install esp32 by Espressif Systems.
  7. Use an ESP32 Arduino core version 3.x or later that supports the documented ESP_I2S.h interface.

3. Select the ESP32 Board

  1. Connect the ESP32 using a suitable USB data cable.
  2. Select Tools > Board > ESP32 Arduino > ESP32 Dev Module for a compatible generic ESP32 DevKit.
  3. Select the correct port from Tools > Port.

4. Required Libraries

The test uses the ESP_I2S.h library included with the official Espressif Arduino-ESP32 board package.

No additional third-party microphone library is required.

Important: ESP32 Core Version

This guide uses the modern I2SClass interface. Older examples found online may use driver/i2s.h, i2s_driver_install() and other legacy I2S functions.

Those older sketches should not be mixed with this example. If the compiler cannot find ESP_I2S.h, check that the official ESP32 board package is installed and updated.

Basic ESP32 Microphone Test

This sketch reads digital audio samples from the INMP441 and calculates a simple average absolute sample level and peak sample level.

It displays these values in the Arduino Serial Monitor so you can confirm that the microphone responds to sound.

The example uses a 16kHz sample rate, 32-bit I2S receive slots and extracts the 24-bit microphone audio data. Although only one microphone is connected, stereo receive mode is used so the correct left-channel samples can be selected explicitly.

ESP32 – INMP441 Sound Level Test
#include <Arduino.h>
#include <ESP_I2S.h>

// INMP441 connections
const int I2S_SCK = 26;
const int I2S_WS  = 25;
const int I2S_SD  = 33;

// Audio configuration
const uint32_t SAMPLE_RATE = 16000;

// 128 stereo frames:
// left sample + right sample per frame
const int FRAMES_PER_BLOCK = 128;
const int WORDS_PER_BLOCK = FRAMES_PER_BLOCK * 2;

int32_t samples[WORDS_PER_BLOCK];

I2SClass I2S;

void setup() {
  Serial.begin(115200);
  delay(1000);

  Serial.println();
  Serial.println("INMP441 Microphone Test");

  // Set I2S pins:
  // BCLK, WS, DOUT (unused), DIN
  I2S.setPins(I2S_SCK, I2S_WS, -1, I2S_SD);

  // Start I2S reception.
  // The INMP441 supplies 24-bit audio
  // within 32-bit I2S receive slots.
  if (!I2S.begin(
        I2S_MODE_STD,
        SAMPLE_RATE,
        I2S_DATA_BIT_WIDTH_32BIT,
        I2S_SLOT_MODE_STEREO)) {

    Serial.println("I2S initialisation failed.");

    while (true) {
      delay(1000);
    }
  }

  Serial.println("I2S initialised.");
  Serial.println("Speak or clap near the microphone.");
  Serial.println("Average | Peak");
}

void loop() {
  // Read one block of interleaved
  // left and right channel samples.
  size_t bytesRead = I2S.readBytes(
    (char*)samples,
    sizeof(samples)
  );

  // Each stereo frame contains
  // two 32-bit values (8 bytes).
  int framesRead = bytesRead / 8;

  if (framesRead == 0) {
    Serial.println("No audio samples received.");
    delay(500);
    return;
  }

  int64_t totalLevel = 0;
  int32_t peakLevel = 0;

  for (int i = 0; i < framesRead; i++) {

    // L/R is connected to GND,
    // so select the left I2S slot.
    int32_t rawSample = samples[i * 2];

    // Convert the left-aligned
    // 24-bit audio into a signed value.
    int32_t sample = rawSample >> 8;

    // Calculate absolute amplitude.
    int32_t amplitude =
      sample < 0 ? -sample : sample;

    totalLevel += amplitude;

    if (amplitude > peakLevel) {
      peakLevel = amplitude;
    }
  }

  int32_t averageLevel =
    totalLevel / framesRead;

  Serial.print("Average: ");
  Serial.print(averageLevel);

  Serial.print(" | Peak: ");
  Serial.println(peakLevel);

  delay(150);
}

Uploading the Sketch

  1. Open a new sketch in Arduino IDE.
  2. Copy the complete code into the editor.
  3. Confirm the selected ESP32 board and serial port.
  4. Click Upload.
  5. Wait for the upload to finish.
  6. Open Tools > Serial Monitor.
  7. Set the Serial Monitor baud rate to 115200.
  8. Speak, tap your desk or clap near the microphone.

Expected Results

After uploading the sketch, the Serial Monitor should show an initialisation message followed by continuously updating audio amplitude values.

An example of the display format is:

Example Serial Monitor Output
INMP441 Microphone Test
I2S initialised.
Speak or clap near the microphone.
Average | Peak

Average: 185 | Peak: 930
Average: 240 | Peak: 1210
Average: 1850 | Peak: 8200
Average: 4200 | Peak: 15600
Average: 310 | Peak: 1440

These figures are illustrative only. Actual values depend on sound level, distance, microphone sensitivity and the surrounding environment.

What Should Happen?

  • In a quiet environment, the microphone should normally produce relatively low, changing amplitude values.
  • When speaking close to the microphone, the average and peak values should generally increase.
  • A clap or other sharp sound should produce a noticeable peak.
  • When the room becomes quiet again, the displayed values should fall.
What do Average and Peak mean?

Average: The average absolute sample amplitude over one block of received audio.

Peak: The highest absolute sample amplitude detected in that block.

These are raw digital audio measurements, not calibrated sound pressure levels in decibels (dB SPL).

The example demonstrates microphone operation but does not provide a calibrated sound-level meter.

Practical Applications and Audio Configuration

1. Sound Detection

The example can be extended to detect events such as claps, knocks or increased room noise.

A basic sound-detection project compares the measured amplitude against a threshold.

  • Measure the typical background level in the intended environment.
  • Choose a threshold above normal background fluctuations.
  • Detect when a new measurement exceeds that threshold.
  • Trigger an LED, notification or other action as required.

The threshold must be adjusted for the installation because microphone readings vary with sound, placement and electrical noise.

2. Sound-Triggered LED Example

The following example builds on the first sketch. It switches an ESP32 GPIO output when the measured peak amplitude exceeds a selected threshold.

Connect an external LED with a suitable current-limiting resistor to GPIO18 and GND. The LED anode connects towards GPIO18 through the resistor, and the cathode connects to GND.

Use this as a complete alternative sketch rather than adding it to the first sketch.

ESP32 – Sound-Triggered LED
#include <Arduino.h>
#include <ESP_I2S.h>

// Microphone connections
const int I2S_SCK = 26;
const int I2S_WS  = 25;
const int I2S_SD  = 33;

// External LED output
const int LED_PIN = 18;

// Adjustable sound threshold
const int32_t SOUND_THRESHOLD = 10000;

const int FRAMES_PER_BLOCK = 128;
int32_t samples[FRAMES_PER_BLOCK * 2];

I2SClass I2S;

void setup() {
  Serial.begin(115200);
  delay(1000);

  pinMode(LED_PIN, OUTPUT);
  digitalWrite(LED_PIN, LOW);

  I2S.setPins(I2S_SCK, I2S_WS, -1, I2S_SD);

  if (!I2S.begin(
        I2S_MODE_STD,
        16000,
        I2S_DATA_BIT_WIDTH_32BIT,
        I2S_SLOT_MODE_STEREO)) {

    Serial.println("I2S initialisation failed.");

    while (true) {
      delay(1000);
    }
  }

  Serial.println("Sound detection ready.");
}

void loop() {
  size_t bytesRead = I2S.readBytes(
    (char*)samples,
    sizeof(samples)
  );

  int framesRead = bytesRead / 8;

  if (framesRead == 0) {
    digitalWrite(LED_PIN, LOW);
    delay(100);
    return;
  }

  int32_t peakLevel = 0;

  for (int i = 0; i < framesRead; i++) {
    int32_t sample = samples[i * 2] >> 8;

    int32_t amplitude =
      sample < 0 ? -sample : sample;

    if (amplitude > peakLevel) {
      peakLevel = amplitude;
    }
  }

  Serial.print("Peak: ");
  Serial.println(peakLevel);

  if (peakLevel > SOUND_THRESHOLD) {
    digitalWrite(LED_PIN, HIGH);
  } else {
    digitalWrite(LED_PIN, LOW);
  }

  delay(50);
}

Expected LED Behaviour

The LED should turn on when a measured sound peak exceeds the configured threshold and turn off when the measured level falls below it.

If the LED remains on continuously, increase SOUND_THRESHOLD. If it never turns on, observe the peak values in the Serial Monitor and reduce the threshold accordingly.

The LED is controlled by the measured sound amplitude, not by speech recognition or identification of a particular sound.

3. Audio Recording

The INMP441 can also be used for digital audio recording projects.

The ESP32 receives PCM audio samples over I2S. Software can then buffer, process or save those samples using additional hardware or software.

For example, an audio recorder may require:

  • An SD card or another suitable storage destination.
  • Audio buffering to avoid missed samples.
  • Conversion of microphone samples into the required file format.
  • Appropriate sample-rate and bit-depth configuration.

The sound-level test above does not create or save audio files. It demonstrates the first step: receiving and processing microphone samples.

4. Using Two Microphones

The INMP441 supports left/right channel selection, allowing two appropriately configured microphones to share an I2S interface.

For a two-microphone arrangement:

  • Connect both microphones to the same compatible 3.3V supply and ground.
  • Connect both SCK inputs to the controller's I2S bit clock.
  • Connect both WS inputs to the controller's I2S word-select signal.
  • Connect the two SD outputs to the same receiving data line.
  • Connect the first microphone's L/R pin to GND.
  • Connect the second microphone's L/R pin to 3.3V.
  • Configure the receiver to capture both left and right I2S slots.
Two-microphone wiring requires additional care.

The INMP441 data output becomes high impedance outside its selected channel. The microphone datasheet recommends a 100kΩ pulldown resistor on the SD signal to discharge the shared line when neither microphone is driving it.

Check whether the breakout board already includes this component before adding an external resistor.

Reliable stereo operation also requires correct signal timing, suitable wiring and appropriate software processing.

Important Audio and Hardware Considerations

Microphone Sample Rate

The example uses a 16kHz audio sample rate, which is useful for basic speech and sound-detection projects.

The INMP441 datasheet specifies an I2S word-select frequency range of approximately 7.8kHz to 50kHz.

Higher sample rates may be useful for wider-band audio capture, but they also increase the amount of audio data that must be processed or stored.

24-Bit Audio Data

The INMP441 provides signed 24-bit audio samples using the standard I2S data format.

The example configures 32-bit I2S slots and converts the left-aligned samples into signed 24-bit values by shifting eight bits to the right.

Correct interpretation of bit alignment and channel order is important when moving to other controllers, audio drivers or recording libraries.

Microphone Position and Sound Port

The INMP441 uses a bottom-port microphone design. Sound enters through a small acoustic opening in the microphone package.

  • Do not cover the microphone's acoustic opening with adhesive, solder, tape or enclosure material.
  • Keep the microphone away from strong vibration where practical.
  • Avoid touching or blowing directly into the acoustic opening.
  • Allow a suitable sound path when installing the module inside an enclosure.

Power Supply Quality

Digital microphone performance can be affected by electrical noise and unstable power connections.

The INMP441 IC requires suitable local supply decoupling. The datasheet recommends a 0.1µF bypass capacitor close to its VDD connection.

Breakout boards may already include supply decoupling, but this must not be assumed without checking the board.

Measurement Accuracy

The example measures raw audio amplitudes. These readings are suitable for confirming operation and developing relative sound-detection thresholds.

They are not directly equivalent to sound pressure level measurements.

Accurate dB SPL measurement would require appropriate signal processing, frequency weighting where applicable, calibrated gain and comparison against a suitable acoustic reference.

Troubleshooting

No Serial Monitor Output

  • Confirm that the sketch uploaded successfully.
  • Check that the correct ESP32 board and serial port are selected.
  • Set the Serial Monitor baud rate to 115200.
  • Press the ESP32 reset button if necessary.
  • Confirm that the USB cable supports data transfer rather than charging only.

I2S Initialisation Failed

  • Confirm that the official Espressif ESP32 board package is installed.
  • Use a compatible Arduino-ESP32 core version 3.x or later.
  • Check that the selected board supports the required I2S interface.
  • Verify that the GPIO pins in the sketch are valid for your ESP32 board.
  • Check that another part of your program is not already using the required I2S resources.

Audio Values Stay at Zero

  • Check that microphone VDD is connected to 3.3V and GND is connected correctly.
  • Verify SCK is connected to GPIO26.
  • Verify WS is connected to GPIO25.
  • Verify SD is connected to GPIO33.
  • Confirm L/R is connected to GND, matching the left-channel selection in the sketch.
  • Inspect solder joints, header pins and breadboard connections.
  • Ensure the microphone's acoustic opening is unobstructed.

Microphone Readings Do Not Change with Sound

  • Speak close to the microphone or produce a short test sound.
  • Confirm that the correct left-channel samples are being processed.
  • Check that the module is powered correctly.
  • Move the microphone away from electrical noise sources.
  • Try shorter jumper wires and inspect for loose connections.

Readings Are Very Noisy or Unstable

  • Check for a stable 3.3V supply.
  • Keep SCK, WS and SD wiring short.
  • Ensure the microphone and controller have a reliable common ground.
  • Avoid placing the microphone beside motors, switching converters or other strong electrical noise sources.
  • Check local power-supply decoupling if the module circuitry is known.
  • Remember that the microphone will naturally detect background sound even in a relatively quiet room.

LED Never Turns On

  • Check the LED polarity and series resistor.
  • Confirm the LED is connected to GPIO18 and GND as described.
  • Observe the microphone peak measurements in the Serial Monitor.
  • Reduce SOUND_THRESHOLD if the measured peaks never reach the configured value.
  • Run the basic microphone test first to confirm that audio data is being received.

LED Remains On Continuously

  • Increase SOUND_THRESHOLD.
  • Check the normal background peak measurements.
  • Move the microphone away from vibration and nearby noise sources.
  • Confirm the GPIO wiring matches the example.
  • Consider adding software averaging, hysteresis or minimum trigger durations for more stable detection.

Compilation Error: ESP_I2S.h Not Found

  • Open Arduino IDE Boards Manager.
  • Confirm that esp32 by Espressif Systems is installed.
  • Update to a compatible version of the ESP32 Arduino core.
  • Confirm that an ESP32 board is selected rather than Arduino UNO.
  • Restart Arduino IDE after updating the board package if necessary.
⚠️ Important

The INMP441 microphone IC is designed for low-voltage operation and must not be connected directly to 5V power or 5V digital signals. Use a regulated 3.3V supply and compatible logic levels unless the exact breakout-board circuitry has been independently verified.

INMP441 modules from different manufacturers may have different PCB layouts, protection components and power circuitry. Always follow the pin labels on the supplied module and check all connections before applying power.

The ESP32 examples are intended for compatible ESP32 development boards using the modern Espressif Arduino I2S interface. GPIO assignments and software requirements may differ for other controllers.

Sound-level values produced by the example sketches are relative digital audio measurements and must not be treated as calibrated acoustic measurements or suitable readings for safety-critical noise monitoring.

Still need help?Contact AuscomTech Support and include the product or model shown above.
Contact Support →