esp32.diy

ESP32-S3 AI Voice Assistant with Gemini Live API

Oct 13, 2026 · 5 min read

Intermediate 31 stars 7 forks C MIT Updated 2026-03-22

Minimal wiring schematic showing INMP441 microphone and MAX98357A amplifier connected to the ESP32-S3 via shared I2S clock lines.

TL;DR This project turns an ESP32-S3 into a full conversational AI interface using local wake-word detection and the Gemini Live API. It supports MQTT, webhooks, GPIO control, and script execution through natural voice commands.
What you need
  • ESP32-S3 DevKitC-1 N16R8
  • MAX98357A I2S 3W Mono Amplifier Class D
  • INMP441 I2S Microphone
BoardESP32-S3 DevKitC-1 N16R8
LanguageC
AI BackendGemini Live API
LicenseMIT
Latest Releasev1.0.13 (2026-03-22)
DifficultyIntermediate

What You Will Build

This project gives you a standalone voice-activated AI device built around the ESP32-S3. Say a wake word — Alexa or Jarvis — and the device starts listening. Your speech travels through a local middleware agent to a cloud AI backend, and the assistant's spoken reply plays back through a small I2S speaker.

What makes this more than a novelty is the function-calling layer. The assistant can send MQTT commands to a broker, fire HTTP webhooks to services like Home Assistant or n8n, toggle GPIO pins directly on the ESP32, and run scripts on a local server — all triggered by natural language. Extended conversation context means you are not limited to single-command interactions; you can hold a real back-and-forth dialogue.

TUI configuration screen for entering Wi-Fi credentials, server host, API key, and wake-word settings.\2
TUI configuration screen for entering Wi-Fi credentials, server host, API key, and wake-word settings.
Detail view of the configuration parameter fields including location, sensitivity, volume, and wake detection mode.\2
Detail view of the configuration parameter fields including location, sensitivity, volume, and wake detection mode.
PROD system architecture: ESP32-S3 client, local Voice Assistant middleware agent, and cloud proxy routing to the AI model.\2
PROD system architecture: ESP32-S3 client, local Voice Assistant middleware agent, and cloud proxy routing to the AI model.
DEV system architecture using a direct connection to the AI provider with your own API keys, bypassing the cloud proxy.\2
DEV system architecture using a direct connection to the AI provider with your own API keys, bypassing the cloud proxy.

What You Need

Hardware

Wiring

The microphone and amplifier share the I2S clock lines:

Signal ESP32-S3 Pin
BCLK (SCK) — shared 2
WS (LRC) — shared 1
INMP441 SD (mic data) 16
MAX98357A DIN (amp data) 42

Connect the INMP441's L/R pin to GND. Adjust the amplifier gain with a resistor on the Gain pin. Pins are hardcoded in src/main.c; change the #define block at the top of that file if you need different pins.

Software and accounts

Typical use cases

On-Device Wake Word

The ESP32-S3 runs wake-word detection entirely on-chip, so the device listens locally without sending audio to the cloud until you say the trigger phrase.

Smart Home Commands

Function calling lets the assistant send MQTT messages, fire HTTP webhooks to Home Assistant or n8n, or flip GPIO pins — all from a spoken sentence.

Local Script Execution

The Exec function type lets you trigger arbitrary scripts on your local server through voice, enabling automation without touching firmware.

Extended Conversation Context

Unlike simple command-response assistants, this project maintains conversation context, so you can have a genuine multi-turn dialogue with the AI.

How It Works

The system has three parts working together:

  1. ESP32-S3 client — listens continuously for the wake word using on-chip processing. When triggered, it records audio and streams it to the middleware, then plays back the AI's response through the amplifier.
  2. Voice Assistant agent — a middleware program running on a local server. It handles noise suppression, Opus audio encoding and decoding, and manages the connection between the ESP32 and the cloud.
  3. Cloud proxy — routes traffic to the AI model.

In the PROD environment (via voice-assistant.io), the agent uses an Enterprise Vertex model with web search, AI voice-activity detection, noise cancellation, and compressed voice traffic at roughly 70 kb/sec. Billing is per second of actual usage.

In the DEV environment, you supply your own Google AI Studio API key and model name directly. There is no traffic compression and no web search, and model behaviour can be less reliable — but it is free within Google's quotas and useful for experimentation.

Configure the Device

Configuration is handled by a cross-platform TUI (text user interface) script that writes Wi-Fi credentials, server address, API key, and audio parameters to the ESP32's NVS (non-volatile storage) partition.

Run the configuration script:

# Linux / macOS
./configure_settings.sh

# Windows
configure_settings.cmd

Inside the menu you will set:

If you prefer a text editor over the TUI, you can edit settings.csv directly instead.

Build and Flash

A single script compiles the firmware, flashes it to the connected ESP32-S3, and opens the serial monitor:

# Linux / macOS
./run_upload.sh

# Windows (PowerShell)
.\run_upload.ps1

The script detects the ESP32 port automatically.

Flashing prebuilt firmware (faster iteration)

If you have already compiled once and only changed settings, use the prebuilt firmware scripts to skip recompilation:

# Linux / macOS
./run_upload_firmware.sh

# Windows (PowerShell)
.\run_upload_firmware.ps1

This script checks the firmware/ directory. If valid binaries are present, it rebuilds only settings.bin from your current settings.csv and uploads the cached firmware plus the fresh settings — no full recompile needed. If the directory is missing or incomplete, it falls back to a full build automatically.

Ideas to Extend It and Known Limitations

Ways to extend the build

Limitations to be aware of

Verdict

The voice-assistant project is a well-automated, practical path to a real conversational AI device on ESP32-S3, with scripted configuration and one-command flashing removing most of the friction. The function-calling support for MQTT, webhooks, GPIO, and scripts makes it genuinely useful for smart home and local automation — not just a demo. The dependency on a local middleware server and a cloud account means it is best suited to makers who already have a home server running and are comfortable managing API keys.

Sources

github.comvisorbarnis/voice-assistant — repository & README voice-assistant.ioOfficial website

Facts in this article come from the project's public README and GitHub metadata at the time of writing. Images belong to their respective owners and link back to the original source.