Dual INMP441 microphones on an ESP32 using ESP-IDF v6. The firmware captures stereo I2S audio, estimates approximate SPL for each mic, and computes a rough arrival angle from inter-mic delay.
Current firmware behavior:
- 16 kHz stereo capture
- GPIO 2 LED turns on when either mic exceeds the SPL threshold
- CSV metrics over UART
- Optional Wi-Fi UDP forwarding for logs and metrics
- Optional browser monitor in
web_monitor/
Both microphones share clocks and the same SD data line.
| Mic | INMP441 Pin | ESP32 Pin |
|---|---|---|
| Left mic | SD / DOUT | GPIO 19 |
| Left mic | WS / LRCLK | GPIO 32 |
| Left mic | SCK / BCLK | GPIO 33 |
| Left mic | L/R | GND |
| Right mic | SD / DOUT | GPIO 19 |
| Right mic | WS / LRCLK | GPIO 32 |
| Right mic | SCK / BCLK | GPIO 33 |
| Right mic | L/R | 3V3 |
| Both mics | VDD | 3V3 |
| Both mics | GND | GND |
One mic must be strapped left and the other right when they share the same SD line.
idf.py build
idf.py flash monitorThe app prints a CSV header followed by one metrics row about every 100 ms.
Current columns:
dBSPL1,dBSPL2,level_diff_db,corr_peak,delay_samples,delay_samples_frac,delay_us,angle_deg,delay_confidence,load_core0,load_core1,min_free_heap
When the input is too quiet for direction estimation, the direction-related fields are emitted as nan.
The repository includes a small local monitor in web_monitor/ for the angle_deg stream.
Run it with:
python3 web_monitor/serve.pyThen open http://127.0.0.1:8765 in Chrome or Edge and choose:
Connect Serialto read UART directly with Web SerialConnect Wi-Fito read UDP-forwarded metrics through the local bridge
By default the bridge listens for metrics on UDP port 30501.
To forward logs and CSV metrics over Wi-Fi:
- Copy
main/include/secrets_example.htomain/include/secrets.h. - Fill in
WIFI_SSID,WIFI_PASSWORD, andUDP_DEST_IP. - Build with Wi-Fi forwarding enabled:
idf.py -DENABLE_WIFI_LOGGING=1 buildDefaults:
- Log UDP port:
30500 - Metrics UDP port:
30501
You can override the ports at build time:
idf.py -DENABLE_WIFI_LOGGING=1 -DUDP_LOG_PORT=30500 -DUDP_METRICS_PORT=30501 buildmain/include/secrets.h is gitignored and should not be committed.
MIT. See LICENSE.

