XiaoZhi AI Budget Version - ESP32 Development Board Implementation
The “budget version” means building XiaoZhi AI on an early ESP32 development board (not an ESP32-S3 or ESP32-C3). The typical board has 4 MB flash and no external PSRAM, for example NodeMCU-32S or ESP32-DevKitC. It matches the bread-compact-esp32 family of variants in the upstream firmware. It is cheap and good for a first try, but offers somewhat fewer capabilities than the ESP32-S3 version, see “1. Capability Differences” below.
1. Capability Differences
Upstream treats ESP32 differently from S3, so know this before you start:
| Item | ESP32 (budget) | ESP32-S3 |
|---|---|---|
| Audio input engine | LiteAudioEngine, raw mono PCM | AfeAudioEngine, with acoustic echo cancellation (AEC) and VAD |
| On-device wake word | Off by default; Wakenet model without AFE is selectable only with PSRAM | AFE wake word enabled by default when PSRAM is present |
| Chat trigger | Button chat; an external wake-up module can also trigger it | Wake word or button |
Sources: upstream main/audio/README.md and main/Kconfig.projbuild. So an ESP32 board without PSRAM triggers a chat with a button by default, or through an external wake-up module on GPIO19.
2. Firmware Variants
The variant names of the prebuilt firmware match the directories under upstream main/boards/:
| Variant | Screen |
|---|---|
bread-compact-esp32 | OLED SSD1306 128x64 |
bread-compact-esp32-128x32 | OLED SSD1306 128x32 |
bread-compact-esp32-lcd | ST7789 LCD (7-pin 240x240 configuration) |
For the full list see Supported Boards, and for download and flashing see Firmware Download and Installation.
3. Hardware and Wiring
Besides the development board, the parts are the same as in the Hardware Build Guide: an INMP441 microphone, a MAX98357A amplifier, a speaker, a breadboard and jumper wires; the screen is optional. The pins below are taken from bread-compact-esp32/config.h.
Microphone (INMP441)
| ESP32 | INMP441 |
|---|---|
| GPIO25 | WS |
| GPIO26 | SCK |
| GPIO32 | SD |
| 3V3 | VDD |
| GND | GND, and tie L/R to it |
Amplifier (MAX98357A)
| ESP32 | MAX98357A |
|---|---|
| GPIO33 | DIN |
| GPIO14 | BCLK |
| GPIO27 | LRC |
| 3V3 | VIN |
| GND | GND |
Handle the SD and GAIN pins as in the ESP32-S3 plan, see the amplifier wiring in the Hardware Build Guide.
OLED (SSD1306, optional)
| ESP32 | OLED |
|---|---|
| GPIO4 | SDA |
| GPIO15 | SCL |
| 3V3 | VCC |
| GND | GND |
Buttons and other pins
| Pin | Function (from esp32_bread_board.cc) |
|---|---|
| GPIO0 | BOOT button: a click toggles the chat; during startup a click enters Wi-Fi provisioning mode |
| GPIO5 | Touch/button: hold to talk and release to finish (maps to StartListening / StopListening) |
| GPIO19 | Input from an external wake-up module: a click equals saying “你好小智” |
| GPIO2 | On-board LED |
| GPIO18 | MCP lamp control test pin (LAMP_GPIO) |
LCD variant (bread-compact-esp32-lcd)
The screen switches to an SPI interface with the pins MOSI GPIO4, CLK GPIO15, DC GPIO21 and RST GPIO18. The 7-pin screen has no CS pin and its backlight is on GPIO22; other models use GPIO22 for CS and GPIO23 for the backlight. Audio and button wiring are the same as in the tables above.
4. Build and Flashing
Use the prebuilt firmware: download the matching variant from Firmware Download and Installation and write it at address 0x0 as described there. When flashing, connect the board to the computer on its own instead of leaving it plugged into the wired breadboard, so the download is not disturbed.
Build it yourself: prepare the environment as in ESP-IDF Development Environment Setup, then run the commands given by the upstream board README:
idf.py set-target esp32
idf.py menuconfig
# Xiaozhi Assistant -> Board Type -> 面包板 ESP32 DevKit
idf.py buildThe menu entry is labeled in Chinese upstream: “面包板 ESP32 DevKit” means “breadboard ESP32 DevKit”.
5. FAQ
- Flashing or erasing fails: take the board off the breadboard, connect it to the computer on its own and retry; for other flashing problems see the FAQ.
- Networking and provisioning: the flow is the same as for the ESP32-S3 version, see First Boot and Network Configuration.
- No wake word: this is the default behavior of an ESP32 without PSRAM; chat with the button or add an external wake-up module.
Related Documents
- Hardware Build Guide: the ESP32-S3 breadboard plan
- Supported Boards: all firmware variants
- Custom Assets Guide: custom fonts, emoji and wake words
Sources: main/boards/bread-compact-esp32/ and main/boards/bread-compact-esp32-lcd/ of 78/xiaozhi-esp32 v2.5.2.