ESP32-S3 INMP441 noise indicator
This ESP-IDF sample reads audio from an INMP441 I2S microphone and indicates the smoothed sound level (RMS) using the ESP32-S3 board's onboard RGB LED. The microphone's left channel is used because its L/R pin is grounded.
The LED fades from off to green as the smoothed RMS rises from 0 to 100,000. From 100,000 to 1,000,000 RMS, it smoothly changes from green to red; at or above 1,000,000 it remains red. These thresholds are 10 times higher than the previous settings to make red less likely during ordinary background noise.
The thresholds are defined by GREEN_NOISE_RMS and RED_NOISE_RMS near the
top of main/main.c. Adjust them after checking the RMS values in
the serial monitor for your microphone and environment.
Wiring
| Module | Pin | ESP32-S3 |
|---|---|---|
| INMP441 | SCK / BCLK | GPIO 3 |
| INMP441 | WS / LRCLK | GPIO 4 |
| INMP441 | SD | GPIO 5 |
| INMP441 | L/R | GND |
| INMP441 | VDD | 3.3V |
| INMP441 | GND | GND |
| Onboard RGB LED | Data | GPIO 48 (on supported board variants) |
Build and run
Open this folder as an ESP-IDF project, select the esp32s3 target, then build,
flash, and open the serial monitor. The firmware uses ESP-IDF's I2S driver and
the espressif/led_strip component.