🤖 AI Chatbot Xiaozhi (1): Bread Board DIY Hardware List and Tutorial
Share
Recently, there is a very low-cost AI chatbot called Xiaozhi has emerged on the Internet from China. It is completely open-source with detailed tutorials for tech enthusiasts to follow. I played with it and found it quite fascinating. It opened up a brand-new opportunity for people to explore the world of popular AI models, such as Large Language Models (LLM), like ChatGPT and DeepSeek.
However, due to language limitation, it is currently only popular in China. I would like to make it more accessible to International enthusiasts, especially those in Canada and United States.
Using the original tutorial as a reference and incorporating my own experience, I have drafted this English version tutorial to help English-speaking individuals benefit from this intriguing AI chatbot.
This article provides a DIY hardware list and wiring tutorial for the Xiaozhi AI chatbot with breadboard, covering required hardware, wiring diagrams, and common problem solutions.
Hardware List
- CPU module: ESP32-S3-DevKitC-1
- Digital microphone module: INMP441
- Audio amplifier module: MAX98357A
- Speaker: 8Ω 2~3W or 4Ω 2~3W
- Bread board: single 830-point or dual 400-point bread boards
- Screen: 128x32 or 128x64 I2C (IIC) OLED with SSD1306 driver (recommended)
- Wires: some solid-core wires
- Push buttons: to control speaking and listening manually (optional)
Besides these required hardware components, the common multi-meter, soldering station, type-C USB cable and a PC/Laptop are also required.
ESP32-S3 Development Board
The ESP32-S3-DevKitC-1-N16R8 is recommended which contains 16MB flash and 8MB PSRAM. But N8R8 is also feasible in this project. I use N8R8 in my first demo board.
Note that some of the ESP32-S3 dev board does not connect the RGB LED to the CPU module. You need to solder them by yourself. I do not recommend to use such kind of dev board if your a newbee. Ignore this information if you are an expert 😁.
MEMS Digital Microphone (INMP441)
The microphone module is the smallest one in the list. I recommend to buy the soldered module if you are a newbee. When connecting the module to ESP32S3, note the pinout especially the VCC and GND connections. If they are reversed by accidence, it may be totally broken. Buy one more as backup.
Audio Amplifier Module (MAX98357A)
The audio amplifier MAX98357A module is used to amplify the audio and drive the speaker. There are many sellers on Amazon to sell this module. However, not all of them work normally. I purchased from three sellers and eventually got a working one. Sad! 😟 Returned most of them to Amazon.
Speaker
I use a 4 Ohm 3 Watt speaker for my chatbot. The connector is JST-PH2.0mm with 2 pins. The performance os this speaker is good enough to me and the audio amplifier module drives it very well.
Bread Board
A 830-point breadboard is shown as follows:
A 400-point breadboard is shown as follows:
Both bread boards are feasible in building the AI chatbot system.
OLED Screen (IIC Interface, Recommended, Optional)
I selected a 128x64 OLED for better display. 128x32 also works in this project. Note that the SSD1306 driver chip is tested. I did not test other driver chips.
Solid Core Wires
Solid-core wires are required to connect different components on the bread board.
Push Buttons
Push buttons are used to control speaking and listening manually, and adjust speaker volume. They are optional. The volume can also be controlled by speech command. For instance, speak to the system: set the volume to 80. The system will adjust the volume after confirming your commands.
Connections
Connection table is shown as follows:
ESP32-S3 DevKit | Microphone INMP441 (I2S) |
GPIO4 | WS (data selection) |
GPIO5 | SCK (clock) |
GPIO6 | SD (data) |
3V3 | VDD |
GND | GND, L/R |
Audio Amplifier (MAX98357A) | |
GPIO7 | DIN (data) |
GPIO15 | BCLK (bit clock) |
GPIO16 | LRC (left/right clock) |
3V3 | VIN, SD |
GND | GND, GAIN |
Analog audio output +, connect to + of speaker (usually red wire) | |
Analog audio output -, connect to - of speaker (usually black wire) | |
Screen (OLED, I2C) | |
GPIO41 | SDA (data) |
GPIO42 | SCK (clock) |
3V3 | VCC |
GND | GND |
Buttons (Optinoal) | |
GPIO40 | Volume (+) Button PIN 1 |
GND | Volume (+) Button PIN 2 |
GPIO39 | Volume (-) Button PIN 1 |
GND | Volume (-) Button PIN 2 |
Pinout of ESP32-S3-DevKit:
Wire Connections
The picture of the final wire connections are shown below. I try my best to show it clearly. If you have questions, please leave comments.
Suggestions
- It is highly recommended to use consistent wire color in signal connections. For example: VCC uses RED; GND uses BLACK; other digital signals use colorful other than RED and BLACK.
- Buy a multi-meter. It is better to double check connections before power on the system to avoid short-circuit connections.
FAQ
- Speaker does not have audio output: change your MAX98357A module.
- If you have any questions, leave it in comments.
Safety Notes
- If you do not know how to use soldering station, I recommend you start with a pre-built board. Supervision is required on your first-time using soldering station. IT IS DANGEROURS!!!
- Before first-time powering on the fully-built board, double check the connection is correct, especially to avoid short-circuits.
Credits
Great thanks to Xiaoxia who published the reference tutorial.
Next Step
Explore the firmware flashing tutorial: 🤖 AI Chatbot Xiaozhi (2): Flash Firmware without ESP-IDF development environment.
If you have further questions, please leave your comments below this article.