Build Your Own XiaoZhi AI Voice Chatbot Using ESP32
Easy step-by-step ESP32 AI voice assistant tutorial with components, wiring guide, firmware flashing, Wi-Fi setup and device pairing.
1 Introduction / What is XiaoZhi AI?
XiaoZhi AI is an open-source voice assistant project that runs on compatible ESP32 hardware and connects to an online AI service. An I2S microphone captures your voice, an amplifier and speaker play replies, and an OLED can show device status or pairing information. It is a practical demonstration for students, educators and electronics hobbyists.
2 Required Components
Typical parts for a XiaoZhi AI ESP32 voice assistant. Check your exact firmware and board before wiring.
| Component | Purpose | Qty |
|---|---|---|
| ESP32 development board | Main Wi-Fi / Bluetooth microcontroller | 1 |
| INMP441 microphone | I2S digital voice input | 1 |
| MAX98357A amplifier | I2S audio output and speaker driver | 1 |
| 4Ω speaker | AI voice audio output; rating must suit amplifier | 1 |
| 0.96-inch OLED | I2C status display, if supported by firmware | 1 |
| Breadboard | Prototyping and wiring | As needed |
| Jumper wires | Module connections | As needed |
| USB data cable / suitable power supply | Flashing and powering the device | 1 |
Get the Ready-Made Kit
Prefer a completed project for your demonstration? Explore the Skynet Robotics ready-made XiaoZhi AI ESP32 kit.
4 Circuit Diagram
Use the wiring diagram that matches your actual ESP32 board, modules and firmware build. GPIO assignments are firmware-specific.
5 Breadboard Assembly Guide
- Position the ESP32 and other modules securely on the breadboard.
- Connect power and ground according to each module's rated voltage.
- Wire the INMP441 microphone to the firmware's assigned I2S pins.
- Connect the MAX98357A amplifier and speaker correctly.
- Connect the OLED to the designated I2C pins, if used.
- Double-check polarity and every connection before applying power.
6 Flash XiaoZhi AI Firmware
Flash only firmware designed for your exact ESP32 chip and connected hardware. Use a desktop browser with Web Serial support and a USB data cable.
- Connect the ESP32 to your computer using a data-capable USB cable.
- Click the installation button below, then select the ESP32 serial port.
- Follow the installer prompts and do not disconnect power while flashing.
- Restart the board after the installation completes.
Install ESP32 Firmware
7 Wi-Fi Configuration
- Restart the ESP32 after successful flashing.
- Connect to the temporary Wi-Fi hotspot created by your firmware, if available.
- Open the configuration address shown by your device or firmware instructions.
- Select your 2.4 GHz Wi-Fi network, enter the password and save.
8 Create XiaoZhi Account
- Open the official XiaoZhi website.
- Create an account or log in using an available method.
- Open the agent or device management area in your dashboard.
9 Pair Your Device
- Open the add-device flow in your XiaoZhi dashboard.
- Read the pairing code shown on the device screen or serial output.
- Enter the code and confirm the device pairing.
10 Configure AI Personality
Give your assistant a name, select an available voice, and add a role prompt using the XiaoZhi dashboard.
| Setting | Example |
|---|---|
| Name | Skynet AI |
| Role | Friendly electronics learning assistant |
| Language | Hindi / English (if supported) |
| Response style | Simple and concise |
11 Features & Voice Commands
Interact with an AI using speech.
Learn about science, electronics and more.
Cloud-assisted responses over Wi-Fi.
Show status or pairing data, depending on firmware.
12 Frequently Asked Questions
Do I need to write Arduino code?
Not when you have compatible ready-made firmware. For custom hardware, firmware changes might still be required.
Can I use any ESP32 board?
No. Use firmware matched to your exact chip family, flash size, peripherals, pin connections and display.
Why does my computer not detect the ESP32?
Check the USB data cable, serial driver, browser permissions and board boot mode.
Will XiaoZhi work without the internet?
Cloud AI conversation generally needs a working internet connection.
Can I configure Hindi or English?
Language and voice options depend on the account, backend and firmware version.
Build Your Own AI Talking Robot
Learn with the tutorial, or explore a ready-made XiaoZhi AI project kit.