Real-time wake word detection running entirely on ESP32-S3 using TensorFlow Lite Micro. No cloud required - all AI inference happens on-device.
This project is based on the microWakeWord library from the ESPHome project, adapted for standalone ESP32-S3 deployment using ESP-IDF. The original example code was modified and optimized for the XIAO ESP32-S3 Sense hardware with PDM microphone support.
Key modifications:
- Adapted PDM microphone configuration for XIAO ESP32-S3 Sense
- Integrated pre-trained professional models (Alexa, Hey Jarvis, Hey Mycroft)
- Optimized audio parameters (16kHz, 16-bit) for better accuracy
- Multi-model support with easy switching
Detect wake words like "Alexa", "Hey Jarvis", or "Hey Mycroft" with <70ms latency on a $7 microcontroller. Perfect showcase of TinyML/Edge AI in action.
- ✅ On-device inference - <10ms per prediction, no cloud
- ✅ Production ready - >90% accuracy with professional models
Say "ALEXA"
✅ Ready! Say 'ALEXA' to trigger detection.
[Listening... loops=500]
*** WAKE WORD DETECTED! ***
| Model | Wake Word | Size | Accuracy |
|---|---|---|---|
| alexa.h | "Alexa" | 55KB | >90% (active) |
| hey_jarvis.h | "Hey Jarvis" | 52KB | >90% |
| hey_mycroft.tflite | "Hey Mycroft" | 56KB | >90% |
| okay_nabu.tflite | "Okay Nabu" | 55KB | >90% |
You have two options:
How to train:
- Visit microWakeWord releases
- Use training scripts to create custom model
- Export as
.tfliteand convert to.hfile - Drop into your project
How to train:
- Create project at edgeimpulse.com
- Record 100+ samples via phone
- Train in web UI
- Download C++ library and integrate
Edit main/main.cpp line 60:
// Stricter (fewer false positives)
wakeWord.add_wake_word_model(model, 0.9f, 5, "Alexa", 22348);
// More sensitive (easier detection, more false positives)
wakeWord.add_wake_word_model(model, 0.5f, 5, "Alexa", 22348);PDM Mic (16kHz) → I2S Buffer → FFT → Mel Filterbank →
MFCC (13 coeffs) → Neural Network → Softmax → Threshold → DETECTED!
Performance:
- Inference: ~10ms
- Total latency: <70ms
- RAM usage: ~150KB
- Model size: 55KB
- Power: ~100mW
main/
├── main.cpp # Main application (Alexa model)
├── alexa.h # Alexa model (55KB)
└── hey_jarvis.h # Hey Jarvis model (52KB)
models/
├── alexa.tflite # Pre-trained models
├── hey_mycroft.tflite
└── okay_nabu.tflite
managed_components/
├── micro_wake_word/ # Wake word engine
├── esp-tflite-micro/ # TensorFlow Lite runtime
└── esp-nn/ # Hardware acceleration