DIY Alexa: on-device wake word on ESP32 with TensorFlow Lite
Build your own voice assistant: an ESP32 detects the wake word on-device with a TensorFlow Lite model, no cloud microphone, then runs the automation you wire up.

Key Facts
- Chip: ESP32
- ML: TensorFlow Lite Micro keyword spotting
- Mic: I2S MEMS (INMP441) or analog
- Intent: Wit.ai
About This Project
This project trains a small neural network to spot the wake word Marvin and runs it on an ESP32 with TensorFlow Lite for Microcontrollers. After waking, it streams audio to Wit.ai for intent recognition and toggles lights or responds. The repo includes training notebooks and firmware, making it one of the clearest end-to-end TinyML keyword-spotting tutorials for the ESP32.
Source & Attribution

How to Build It
Parts Needed
- ESP32 dev kit
- I2S MEMS microphone (INMP441 or ICS-43434), or an analog mic
- I2S amplifier (e.g. MAX98357) and a 4Ω/8Ω speaker
- Computer with Python 3 (for training)
- Free Wit.ai account
Steps
- 1
Wire the hardware
Connect the I2S mic and amp to the ESP32. The pin settings are in the firmware's config header.
- 2
Train or reuse the wake word
The repo's Python notebooks walk through generating spectrograms from the speech-commands dataset and training the model. A trained model is already included if you want to skip this step.
- 3
Set up Wit.ai
Create a Wit.ai app, train it with your intents (e.g. turn on or off, plus device names) and copy the access token.
- 4
Configure the firmware
Add your Wi-Fi details and the Wit.ai token to the firmware config. Define the actions for each intent, such as the GPIOs to toggle.
- 5
Build and flash
Open the firmware folder in PlatformIO with VS Code, then build and upload.
- 6
Test
Say 'Marvin', then a command. The serial monitor shows the detection scores and the intent Wit.ai sent back, which helps when tuning the detection threshold.
Bill of Materials
Parts list
4 parts · 4 linked
Heads up: some Buy links are affiliate links. If you buy through one, MCU Atlas may earn a small commission at no extra cost to you. It never changes which parts we list. How this works
1× I2S MEMS microphone
Elecrow US$5.00; an Amazon.ca 5-pack works out to ≈US$2.38 a mic (checked 2026-11-13)
1× I2S amplifier
Adafruit's $5.95 mono breakout (3006) is out of stock — in-stock pick: the $9.95 stereo dual (6513) (checked 2026-11-13)
Not included: 3D-printed case, wire, solder, USB cable
Related Projects





