esp32-inmp441-example
Project Information
Check INMP441 microphone with ESP32
Flash to Device
Login required: You need to login or create an account to flash this project.
Source Files (2)
Download AllREADME
ESP32 INMP441 Captive Portal
Monitor INMP441 I2S microphone channels via WiFi with a captive portal
This project turns an ESP32 Dev Board into a small WiFi-based audio level monitor.
When powered, the ESP32 creates an open WiFi Access Point and a captive portal.
As soon as a device connects to the AP, a web page appears that shows the live signal level from an INMP441 I2S microphone.
The web interface displays both I2S stereo channels:
- LEFT channel
- RIGHT channel
Important: one INMP441 microphone is a mono microphone.
It can transmit on either the LEFT or RIGHT I2S channel, depending on the L/R pin connection.
To get real LEFT and RIGHT audio at the same time, you need two INMP441 microphones.
โญ Features
- Open WiFi Access Point (no password)
- SSID:
ESP32-INMP441
- SSID:
- Captive portal
- Any URL request is redirected to the audio monitor page
- Works with Android / iOS / Windows / Linux
- Web-based audio level monitor
- Shows LEFT channel level
- Shows RIGHT channel level
- Shows percentage level
- Shows dBFS value
- Shows raw RMS value for debugging
- I2S microphone support
- Designed for INMP441
- Reads 32-bit I2S samples
- Supports LEFT / RIGHT channel detection
- No external network or internet required
๐ฆ Hardware requirements
- ESP32 Dev Board
Example: ESP32-DevKitC, ESP32-WROOM development board - INMP441 I2S microphone module
- Jumper wires
- Breadboard recommended
๐ INMP441 pinout
Typical INMP441 module pins:
| INMP441 pin | Description |
|---|---|
VDD |
3.3V power |
GND |
Ground |
SCK / BCLK |
I2S bit clock |
WS / LRCL |
I2S word select / left-right clock |
SD / DOUT |
I2S audio data output |
L/R |
Channel select pin |
๐ง Default wiring: one INMP441 microphone
| INMP441 | ESP32 |
|---|---|
VDD |
3V3 |
GND |
GND |
SCK / BCLK |
GPIO 26 |
WS / LRCL |
GPIO 25 |
SD / DOUT |
GPIO 33 |
L/R |
GPIO 27 |
In this version, the L/R pin is connected to GPIO 27.
The code controls GPIO 27 automatically:
#define MIC_LR_PIN 27
You can select the microphone channel in code:
#define MIC_CHANNEL_RIGHT true
Channel behavior:
| Code setting | L/R state | Active channel |
|---|---|---|
MIC_CHANNEL_RIGHT false |
LOW | LEFT |
MIC_CHANNEL_RIGHT true |
HIGH | RIGHT |
๐๏ธ One microphone vs two microphones
One INMP441 microphone
One INMP441 is a mono microphone.
It can appear as:
- LEFT channel, or
- RIGHT channel
but not both at the same time.
| L/R pin state | Microphone appears as |
|---|---|
| LOW / GND | LEFT channel |
| HIGH / 3.3V | RIGHT channel |
The web page will still display both channels, but only one channel will normally react to sound.
Two INMP441 microphones
To get both LEFT and RIGHT channels working at the same time, use two INMP441 microphones.
| Signal | LEFT microphone | RIGHT microphone |
|---|---|---|
VDD |
3V3 |
3V3 |
GND |
GND |
GND |
SCK / BCLK |
GPIO 26 |
GPIO 26 |
WS / LRCL |
GPIO 25 |
GPIO 25 |
SD / DOUT |
GPIO 33 |
GPIO 33 |
L/R |
GND |
3V3 |
Both microphones share the same I2S bus:
SCK
WS
SD
3.3V
GND
Only the L/R pin must be different.
โ ๏ธ Important power note
The INMP441 must be powered from 3.3V only.
Do not connect VDD to 5V.
If you only have one visible 3V3 pin on your ESP32 board, you can split it using a breadboard or jumper wire.
For example, the same 3V3 pin can power:
VDDof the microphoneL/Rpin of the right-channel microphone
The L/R pin uses almost no current.
It only reads a HIGH or LOW logic level.
๐ Required Arduino IDE setup
Install the ESP32 board package:
- Open Arduino IDE
- Go to Tools โ Board โ Boards Manager
- Search for:
esp32
- Install:
esp32 by Espressif Systems
No extra libraries are required from the Arduino Library Manager.
The project uses libraries included with the ESP32 Arduino core:
#include <WiFi.h>
#include <WebServer.h>
#include <DNSServer.h>
#include "driver/i2s.h"
๐ WiFi access point
Default WiFi network created by the ESP32:
ESP32-INMP441
The network is open and does not require a password.
Default ESP32 access point IP address:
192.168.4.1
If the captive portal does not open automatically, open this address manually in a browser:
http://192.168.4.1
๐ฅ๏ธ Web interface
The web page displays:
- LEFT channel level
- RIGHT channel level
- Percentage level for each channel
- dBFS value for each channel
- RMS value for each channel
- ACTIVE indicator when a channel receives signal
The values refresh automatically every 300 ms.
๐ What is dBFS?
The displayed dB value is dBFS, not real-world sound pressure level.
dBFS means:
decibels relative to full scale
It shows the level of the digital audio signal inside the ESP32.
This is useful for checking:
- whether the microphone works
- which channel is active
- whether the signal changes when sound is present
- whether the wiring is correct
It is not a calibrated dB SPL or dB(A) measurement.
๐งช Testing
Test with one microphone
- Upload the code to the ESP32.
- Open Serial Monitor at:
115200 baud
- Connect to WiFi:
ESP32-INMP441
- Open:
http://192.168.4.1
- Make sound near the microphone.
If MIC_CHANNEL_RIGHT is set to:
#define MIC_CHANNEL_RIGHT true
then the RIGHT channel should react.
If it is set to:
#define MIC_CHANNEL_RIGHT false
then the LEFT channel should react.
Test with two microphones
Use two INMP441 modules:
- LEFT microphone:
L/Rconnected toGND - RIGHT microphone:
L/Rconnected to3V3
Both microphones should then react independently on the web page.
๐ ๏ธ Troubleshooting
The page opens, but both channels show 0%
Check:
VDDis connected to3V3, not 5VGNDis connected correctlySCKis connected toGPIO 26WSis connected toGPIO 25SDis connected toGPIO 33- The microphone is an INMP441 or compatible I2S microphone
Only LEFT or only RIGHT moves
This is normal if you use only one INMP441 microphone.
One INMP441 can transmit on only one channel at a time.
To get both channels moving at the same time, use two microphones.
The wrong channel moves
Change this line:
#define MIC_CHANNEL_RIGHT true
Use:
#define MIC_CHANNEL_RIGHT false
for LEFT channel.
Use:
#define MIC_CHANNEL_RIGHT true
for RIGHT channel.
Captive portal does not open automatically
Manually open:
http://192.168.4.1
Some phones or laptops may not automatically show captive portals every time.
๐ข Default pin configuration
#define I2S_WS 25
#define I2S_SCK 26
#define I2S_SD 33
#define MIC_LR_PIN 27
Pin meaning:
| Define | ESP32 GPIO | Function |
|---|---|---|
I2S_WS |
GPIO 25 |
Word select / LR clock |
I2S_SCK |
GPIO 26 |
Bit clock |
I2S_SD |
GPIO 33 |
Audio data input |
MIC_LR_PIN |
GPIO 27 |
Microphone LEFT / RIGHT select |
โ Summary
This project creates a WiFi captive portal on an ESP32 and displays live audio levels from an INMP441 I2S microphone.
Use one microphone to test either LEFT or RIGHT channel.
Use two microphones to get real stereo LEFT and RIGHT monitoring.
Default WiFi:
ESP32-INMP441
Default web page:
http://192.168.4.1