Skip to content
MCU Atlas

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.

Difficulty:AdvancedSource available

Photos

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

Photos: atomic14/diy-alexa

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/15/2026
DIY Alexa: on-device wake word on ESP32 with TensorFlow Lite

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.

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

Download CSV

Related Projects

XiaoZhi: open-source ESP32 AI voice chatbot
Illustration
ESP32ESP32-S3
XiaoZhi is open-source firmware that turns ESP32-S3 boards into an AI voice assistant over the MCP protocol — many supported client boards and a large community.
Intermediate·Code
5 parts listed
Whistle: offline speech-to-text on the ESP32-S3
Illustration
ESP32ESP32-S3
Real speech-to-text entirely on an ESP32-S3, fully offline: hold a button and say a command in one of seven languages — the onboard LED obeys.
Intermediate·Code
5 parts listed
Hermes Gadget SDK: give your AI agent an ESP32 body
Illustration
ESP32ESP32-S3
MIT-licensed firmware and tools that give a Hermes AI agent a body — 30+ ESP32 profiles, a Raspberry Pi client, and a desktop simulator you can try tonight.
Beginner·Code
3 parts listed