Offline Voice Keyword Spotting with XIAO ESP32-S3, INMP441 Microphone, and MAX7219 LED Matrix
This project uses a XIAO ESP32-S3 paired with an INMP441 I²S microphone to recognize the voice command “halo esp”. When the keyword is detected, it scrolls “HALO” on a MAX7219 8x8 LED matrix (4 devices). If any other sound or noise is heard, it displays “...” for noise and "no" for unknown sound instead.
The entire system runs offline, powered by a compact AI model trained on Edge Impulse, ensuring fast and reliable keyword spotting with no need for internet or cloud services.
Hardware- XIAO ESP32S3
- MAX 7219 LED Dot Matrix 8x8 4 Devices
- Microphone INMP 441 + I²S
- Male-female jumper wires
- Breadboard MB-102 830 point solderless
- Arduino IDE
- Edge Impulse Studio (for training and exporting your keyword spotting model)
- MD_Parola.h
- MD_MAX72xx.h
- SPI.h
- driver/i2s.h
- freertos/FreeRTOS.h
- MAX 7219 LED Dot Matrix 8x8 4 Devices
- VCC → 5V
- GND → GND
- DIN → GPIO6
- CS → GPIO5
- CLK → GPIO7
- Microphone INMP 441 + I²S
- VCC → 3V
- BCLK → GPIO2
- WS → GPIO3
- DIN → GPIO1
Step-by-Step Guide1. Install LibrariesOpen the Arduino IDE, and install the following libraries via the Library Manager:
MD_Parola
MD_Parola
MD_MAX72XX
MD_MAX72XX
SPI
SPI
Also, install the Edge Impulse library exported as a .zip
file:
Go to Sketch → Include Library → Add .ZIP Library, and select the .zip
you downloaded from the Edge Impulse Deployment page (e.g., kamaru123-project-1_inferencing.zip
).
Note: Libraries like driver/i2s.h
and freertos/task.h
are built-in when you select XIAO ESP32-S3 in the Board Manager.
Note: Libraries like2. Arduino Codedriver/i2s.h
andfreertos/task.h
are built-in when you select XIAO ESP32-S3 in the Board Manager.
Use a program that does the following:
1. Initializes the INMP441 microphone via I2S
- Initializes the INMP441 microphone via I2S
2. Runs audio inference using the Edge Impulse model
- Runs audio inference using the Edge Impulse model
Displays "HALO"
on the MAX7219 LED Matrix when the keyword "halo esp"
is detected
- Displays
"HALO"
on the MAX7219 LED Matrix when the keyword"halo esp"
is detected
Displays "NO"
if the keyword is not recognized
- Displays
"NO"
if the keyword is not recognized
5. Ensure your pin configuration matches:
MAX7219: DIN = GPIO6, CLK = GPIO7, CS = GPIO5
- MAX7219: DIN = GPIO6, CLK = GPIO7, CS = GPIO5
INMP441: BCK = GPIO2, WS = GPIO3, SD = GPIO1
- INMP441: BCK = GPIO2, WS = GPIO3, SD = GPIO1
1. Connect the XIAO ESP32-S3 to your computer using a USB-C cable
- Connect the XIAO ESP32-S3 to your computer using a USB-C cable
2. Open Arduino IDE
- Open Arduino IDE
3. Go to Tools → Board and select:
✅ XIAO_ESP32S3
- Go to Tools → Board and select:
✅XIAO_ESP32S3
4. Go to Tools → Port and select the correct COM port
- Go to Tools → Port and select the correct COM port
5. Click the Upload button
- Click the Upload button
6. Open the Serial Monitor (baud rate: 115200
)
- Open the Serial Monitor (baud rate:
115200
)
7. Say "halo esp" near the microphone:
✅ If detected, the LED matrix will scroll "HALO"
- ✅ If detected, the LED matrix will scroll "HALO"
❌ If not detected, it will display "NO"
- ❌ If not detected, it will display "NO"
- Say "halo esp" near the microphone:
✅ If detected, the LED matrix will scroll "HALO"
❌ If not detected, it will display "NO"
Comments