Skip to content
MCU Atlas
ESP32ESP32Draft

DIY Alexa: on-device wake word on ESP32 with TensorFlow Lite

A home-made voice assistant that detects a wake word locally on an ESP32 using a TensorFlow Lite model.

Difficulty:AdvancedCost:Source available

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

Source: GitHub
License: MIT
Last verified: 10/16/2026
How to Build It
Build your own Alexa-style assistant on an ESP32. A small TensorFlow Lite model trained on the 'Marvin' wake word runs on the chip. When it hears the word, it records your command and sends it to Wit.ai, which works out the intent, so the ESP32 can act on it, for example switching lights.

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. 1

    Wire the hardware

    Connect the I2S mic and amp to the ESP32. The pin settings are in the firmware's config header.

  2. 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. 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. 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. 5

    Build and flash

    Open the firmware folder in PlatformIO with VS Code, then build and upload.

  6. 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.

Photos

Photos from github.com

Parts List (BOM)
Parts list inferred by MCU Atlas — check the original
inferred
PartQtyRoleEst. PriceBuy
1main board$5–$10View
1mic$2–$5View
1amp$3–$6View
1speaker$2–$5View
Estimated Total$12–$26 USD

Not included: 3D-printed case, wire, solder, USB cable

Download CSV

Related Projects

Watchy: open-source ESP32 e-ink smartwatch
Illustration
ESP32Draft
An open-source smartwatch with a 1.54in e-paper screen and ESP32, hackable watch faces in Arduino.
Beginner·Under $15·Code
2 parts listed
Low-power ESP32 e-paper weather display (7.5in)
Illustration
ESP32Draft
A wall-mounted 7.5in e-paper weather display on an ESP32 that runs for months on one battery charge.
Intermediate·Cost varies·Code
5 parts listed
OpenEPaperLink: reuse e-ink shelf labels with an ESP32 access point
ESP32ESP32-S3Draft
Turns cheap second-hand electronic shelf labels into a Wi-Fi-managed e-ink display fleet via an ESP32 access point.
Advanced·Under $15·Code
3 parts listed