✨ DIY AI Friend · ESP32

Build Your Own XiaoZhi AI Voice Chatbot
Using ESP32 — Cute & Complete Guide 2026

✨ Learn how to build a fully functional AI voice chatbot using an ESP32 microcontroller and the open-source XiaoZhi AI firmware. Flash it via browser, configure your AI personality, and start talking in minutes — no coding required. Perfect for students, hobbyists, and makers. ✨

~45 min total No coding needed 100% Free Firmware Hindi / Bilingual AI Chrome / Edge required

✨ Introduction — What is XiaoZhi AI?

Open-source, voice-first AI on ESP32

XiaoZhi AI (小智) is a revolutionary open-source firmware project that transforms a simple ESP32 microcontroller into a powerful, cloud-connected AI voice assistant. It supports real-time voice recognition, natural language understanding, and expressive text-to-speech — all tied to the xiaozhi.me platform. Whether you're a student building a college project, a hobbyist exploring IoT, or an educator demonstrating AI concepts, this project offers an accessible, hands-on introduction to embedded AI.

Unlike Amazon Alexa or Google Assistant, XiaoZhi gives you full control over your AI's personality, language, and behavior. You can configure it to speak Hindi, Hinglish, or English; give it a custom name and persona; and even connect it to external services like weather, music, and more — all for free using the open-source tier.

In this tutorial, we'll build the complete project from scratch — assembling the hardware circuit, flashing the firmware using a simple browser-based tool, and configuring a custom Hindi voice chatbot through the XiaoZhi cloud console. By the end, you'll have a fully functional voice AI assistant that you can further customize and expand.

🐻 SEO Keywords This Project Covers XiaoZhi AI ESP32 tutorial, ESP32 AI voice assistant, AI chatbot ESP32, Hindi AI voice bot, XiaoZhi firmware flash, open source ESP32 chatbot 2026, DIY voice assistant, ESP32 project for students, IoT AI project, cute AI robot

🧸 Required Components

Everything you need to build this project

Here is the complete list of components needed to build the XiaoZhi AI Voice Chatbot circuit. All parts are easily available online or at your local electronics store. This project is ideal for school/college submissions and hobbyist experiments.

ComponentDescriptionQty
ESP32 Dev Board38-pin variant recommended · Main controller1
INMP441 I2S MicDigital I2S microphone · Captures voice clearly1
MAX98357A AmplifierI2S DAC + amp module · Drives speaker1
2W 4Ω SpeakerSmall speaker for AI audio output1
0.96" OLED (128x64)I2C interface · Shows pairing code1
5mm LED + 220Ω ResistorControl using voice commands1
Breadboard 400 TieFor prototyping the circuit2
Jumper Wires (M-M)Male-to-Male · Various colors~20
USB Micro-B Data CableMust support data (not charge-only)1
Computer (Chrome/Edge)Required for Web Serial flashing1
🐼 Don't want to source parts separately? We sell a 100% tested, pre-assembled version of this project. Scroll down to the Buy Section to get yours delivered!

Get the Ready-Made XiaoZhi AI Kit!

Don't want to build from scratch? We offer a 100% tested and fully assembled XiaoZhi AI Voice Chatbot kit — just power it on and start talking. Perfect for quick demonstrations or as a gift. Whatsapp us for pricing and availability.

Order on WhatsApp — 8535889926
100% Tested Ready to Use Fast Delivery Support Included

🔌 Circuit Diagram

Complete wiring for XiaoZhi AI Voice Chatbot

The circuit connects four key modules to the ESP32: an I2S microphone for voice input, an I2S amplifier + speaker for audio output, an OLED display for the pairing code, and a status LED. Study the diagram carefully before assembling.

Circuit Diagram
Click to view full image
Circuit Diagram
Full circuit diagram — ESP32 + INMP441 + MAX98357A + OLED + LED

🐣Pin Connections:

  • INMP441 Mic: VDD→3.3V, GND→GND, SD→GPIO32, WS→GPIO25, SCK→GPIO26, L/R→GND (on mic module itself)
  • MAX98357A Amp: VIN→3.3V, GND→GND, LRC→GPIO33, DIN→GPIO27, BCLK→GPIO14, GAIN/SD→not connected
  • OLED: VCC→3.3V, GND→GND, SCL→GPIO15, SDA→GPIO4
  • LED: Anode→220Ω→GPIO18, Cathode→GND
  • Speaker: SPK+ and SPK- to MAX98357A speaker output pads
🐻‍❄️ Double check pin numbers before powering on! Incorrect connections, especially on the microphone and amplifier, can prevent the firmware from detecting the audio hardware.

🧵 How to Assemble on Breadboard

Step-by-step hardware assembly guide

Follow these steps to assemble the circuit on a breadboard. Take your time — a clean build makes troubleshooting much easier. This is a great hands-on activity for students learning electronics and IoT.

Assembly Guide
Click to view full image
Assembly Guide
Assembled XiaoZhi AI chatbot circuit on a breadboard — ready for firmware flashing
1
Place the ESP32 on the breadboard

Seat the ESP32 dev board centrally across the breadboard's center gap.

2
Connect power rails (3.3V and GND)

Use red wire from ESP32's 3.3V pin to positive rail, black from GND to negative rail.

3
Place and wire the INMP441 microphone

VDD→3.3V, GND→GND, SD→GPIO32, WS→GPIO25, SCK→GPIO26, L/R→GND on mic module.

4
Place and wire the MAX98357A amplifier

VIN→3.3V, GND→GND, LRC→GPIO33, DIN→GPIO27, BCLK→GPIO14.

5
Connect the speaker to the amplifier

Speaker positive to SPK+, negative to SPK- on MAX98357A output pads.

6
Wire the OLED display (I2C)

VCC→3.3V, GND→GND, SCL→GPIO15, SDA→GPIO4.

7
Add the status LED with 220Ω resistor

GPIO18 → resistor → LED anode (+). Cathode to GND.

8
Double-check all connections

Visually verify every wire against the circuit diagram before plugging in USB.

🐣 Build complete? Great! Now plug the ESP32 into your computer and proceed to firmware flashing.
1

⚡ Flash the XiaoZhi Firmware via Web Flasher

Browser-based · No drivers · ~2 minutes

The XiaoZhi firmware is flashed directly from your browser using ESP Web Tools — no Arduino IDE, no drivers needed. Use Google Chrome or Microsoft Edge on a desktop.

🐻 IMPORTANT — Read Before Clicking! The order matters. Click flash, note ports, then plug in while holding BOOT.
1
Click "Start Flashing" below (don't plug in USB yet)

Note the ports currently listed.

2
Hold BOOT button on ESP32 and plug in USB

Keep holding BOOT.

3
Select the new COM port that just appeared

That's your ESP32. Select it and click Connect.

4
Click "Install Firmware" → check "Erase Device" → Next → Install

Enabling Erase Device is recommended.

5
Wait ~2 minutes — do not unplug!

Progress bar shows flashing. Once complete, release BOOT.

Screenshot — Flashing in Progress
Click to view full image
Flashing Screenshot
One-Click XiaoZhi Firmware Flasher
Hold BOOT on ESP32 → plug USB → then click below
Your browser does not support Web Serial. Please use Chrome or Edge on desktop.
🐼 No new port appearing? Your USB cable may be charge-only. Try a different cable or install CH340/CP2102 drivers.
2

📶 Connect to Your Wi-Fi Network

Via captive portal at 192.168.4.1 · 2.4 GHz only

After flashing, the ESP32 creates a temporary Wi-Fi hotspot named XiaoZhi-XXXX.

1
Connect to "XiaoZhi-XXXX" Wi-Fi

No password needed.

2
Open 192.168.4.1 in browser

You'll see the Network Configuration portal.

3
Click your home Wi-Fi name (2.4 GHz only)

SSID auto-fills.

4
Enter Wi-Fi password and click Connect

Type carefully.

5
Wait for success screen

Device will restart and join your network.

Wi-Fi Configuration Portal
Click to view full image
Wi-Fi Setup
🐣 Only 2.4 GHz is supported! ESP32 does not support 5 GHz.
3

🧑‍💻 Create Your XiaoZhi AI Account

Free account at xiaozhi.me · Google login recommended

Before pairing, create a free account at xiaozhi.me.

1
Reconnect to home Wi-Fi

Switch back from XiaoZhi hotspot.

2
Open xiaozhi.me

Click "Console".

3
Sign up with Google

Fastest method.

XiaoZhi.me Homepage
Click to view full image
XiaoZhi.me Homepage
4

🤝 Pair Your ESP32 Device

Enter the 6-digit code shown on your OLED display
1
Click "+ Add Device" in Agents console

Dialog appears.

2
Read 6-digit code scrolling on OLED

Act quickly — it refreshes.

3
Type code and click Confirm

Device links to account.

4
Accept Agreement → "Start Using"

Select Open Source (Free).

Add Device Dialog
Click to view full image
Add Device Dialog
🐼 Device paired successfully! Your ESP32 now appears in the console.
5

🎭 Configure Your AI Agent's Personality

Set name, voice, language, role prompt & advanced settings

This is the most exciting step — you get to design your AI's identity. Click "Configure Role" on your device card to open the full configuration panel.

🧠 What is "Role Introduction"? This is the system prompt — the core instruction set that tells the AI who it is, how it should behave, what language to use, and what its purpose is. Think of it as giving your robot its personality.

Here's what every setting in the Configure Role page does:

SettingWhat It DoesRecommended
Assistant NameThe name the AI calls itself when greeting youAnything you like — e.g., "Jarvis" or "Mitra"
Dialogue LanguagePrimary language the AI speaks in voiceChinese (default), or switch to your preferred language
Voice RoleThe voice/accent used for TTS (Text-to-Speech)Try different voices and pick what sounds best
Role IntroductionThe system prompt — AI's full personality & instructionsUse the generator below to craft a perfect prompt
Memory TypeHow the AI remembers past conversationsMemory (Short-term) for context awareness
Language ModelThe AI brain powering responsesXiaozhi Lite (free tier, fast & capable)
Voice Recognition SpeedHow fast the speech-to-text processes your voiceNormal (adjust if it mishears you)
Character Speech SpeedHow fast the AI talks back to youNormal — slower for easier comprehension
Voice PitchLow to High slider for the AI's vocal pitchCenter position is natural; adjust to taste
Official Services (MCP)Built-in tools the AI can use: Weather, Jokes, Music, etc.Keep Weather & Music enabled for richer interactions

Use the interactive prompt generator below to create a detailed, personalized system prompt that defines your AI's behavior, tone, and knowledge.

✨ Master Prompt GeneratorBuild a detailed XiaoZhi system prompt — fully personalized
Quick Start Templates
About Your AI Assistant
About the User (optional but helpful)
Language & Communication
Primary Purpose & Expertise
Additional Behavior Traits
Your Generated Role Introduction
0 / 2000 characters

🐻‍❄️ Features & Voice Commands

What your XiaoZhi AI can do out of the box

Voice Volume Control

Say "Volume 50%" or "Increase volume".

Display Brightness

"Increase brightness" / "Dim screen".

Live Weather

"What's the weather in Mumbai?"

Music Playback

"Play Hindi music".

Jokes & Fun

"Tell me a joke".

Conversation Memory

Remembers context.

Auto Sleep Mode

Press BOOT to wake.

OTA Updates

Change personality anytime.

Multilingual

Hindi, English, Hinglish.

✨ This project is an excellent foundation for further experimentation — integrate additional sensors, connect to home automation, or even deploy it as a learning tool in classrooms. The XiaoZhi AI framework supports MCP (Model Context Protocol) allowing you to control GPIO, relays, and other hardware with just your voice! ✨

🎉 Save, Reset & Launch Your AI!

You're one step away from talking to your very own AI voice assistant

You're one step away from talking to your very own AI voice assistant. Perform these final steps to bring it to life.

💾
Click Save in Console

Save your configuration changes in the xiaozhi.me console.

🔄
Hard Reset your ESP32

Press the physical Reset/EN button on the ESP32 board.

👆
Press BOOT once to activate

A short press wakes the agent and starts listening mode.

🗣️
Start talking!

Say "Hello" or your wake word to begin.

Using Your AI Voice Assistant — Daily Tips

Activate: Press the BOOT button

A short press on the BOOT button wakes the agent and starts the listening mode. The OLED will show it's active.

Auto-sleep after silence

After a few seconds of no conversation, the device automatically goes back to sleep to save power. Simply press BOOT again to wake it.

Change personality anytime

You can go back to xiaozhi.me/console at any time to update the Role Introduction, switch voice, or change language. Hit Save and reset the ESP32 for changes to take effect.

MCP Tools (Weather, Music, Jokes)

With Official Services enabled in MCP Settings, your AI can fetch live weather, play music, or tell jokes when you ask. Make sure you enabled them in Step 5.

💡 Not responding after save? Always do a hard reset (press the physical Reset/EN button on the ESP32 board) after saving configuration changes. A soft reboot won't always apply new settings.

🎉 Your AI Voice Bot is Ready!

You've successfully built, flashed, and configured your own XiaoZhi AI voice chatbot. Press BOOT and start talking! Share your creation with friends, or use it as a unique project submission.

Save in Console Hard Reset ESP32 Press BOOT to Activate Say Hello!

🐼 Want It Pre-Built & Ready to Go?

Skip the building and get a fully assembled, tested XiaoZhi AI kit delivered. WhatsApp us for pricing!

Order on WhatsApp — +91 8535889926
Pre-Tested Fast Shipping Free Support
Fullscreen View

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top