A 74 CNY AI voice assistant: ESP32-S3 with Xiaozhi firmware, from wiring to talking
For the past month a small box on a desk has been all over one short-video platform. You say something, it blinks, then it talks back. The comments all ask the same two things: how much, and where to buy. Finished products start at two or three hundred CNY, and four or five hundred with a case and screen. But inside there are only four things: an ESP32-S3, a digital microphone, an amplifier module and a small speaker. The screen is optional. Priced against the exact specification you would actually buy, the full set is 74 CNY. This article writes the wiring, flashing, networking and the inevitable pitfalls in one pass. Two hours later it can talk.
What it can and cannot do
It can wake on Nihao Xiaozhi, then chat normally, ask about the weather, general knowledge, or tell a bad joke. It is full-duplex, so you can interrupt it mid-sentence. The official backend lets you set a persona, swap voice and language, and connect your own agent. Cut the network and it is useless, but on Wi-Fi it responds faster than you might expect.
It cannot run a local large language model. Speech recognition, model inference and speech synthesis all run in the cloud, so a home without network is a mute ornament. There is latency: from finishing a sentence to it speaking is normally about one second and can reach three or four seconds on a bad network. It connects only to 2.4 GHz Wi-Fi; the 5 GHz band will not connect, which is a known ESP32 limitation. The sound is what it is: a 4 ohm 3 watt speaker gets muddy when loud, and a better speaker and amplifier are needed for real fidelity. The microphone picks up at roughly two to three metres, so a larger room means moving closer.
One more precondition: you must register an account on the official backend and bind the device before it will talk. Flashing the firmware is not the finish line; there is a verification-code step described below.
The real bill: 74 CNY, every fen checked against the specification
The price on a listing page is almost always a starting price; the product carries a pile of specifications and the listing shows the cheapest one. This pricing was done by opening the specification on each item.
| Part | Specification | Price |
|---|---|---|
| Main board | ESP32-S3-DevKitC-1, N16R8 module, headers soldered | 25 CNY |
| Digital microphone | INMP441 original-chip version, headers soldered | 12.82 CNY |
| Amplifier module | MAX98357A, I2S digital amplifier | 5.4 CNY |
| Speaker | 4 ohm 3 watt cavity speaker | 10.2 CNY |
| Screen, optional | 0.96-inch OLED, I2C 4-pin, white or blue | 6.7 CNY |
| Breadboard | 400 holes | 6.8 CNY |
| Dupont wires | 65 soft jumper wires | 6.8 CNY |
| Total | 73.72 CNY |
Four points matter. First, never buy the 4 CNY microphone. On the same product page the 4.11 CNY unit is the compatible-chip version, not the original INMP441. The original-chip version with soldered headers is 12.82 CNY. The eight CNY difference is the difference between clean pickup and no pickup; the model number must match. Second, choose the N16R8 module, 16 MB flash and 8 MB PSRAM, which is the most stable configuration for the Xiaozhi firmware. Some shops sell an 8.5 or 10 CNY board that is a bare board without a module or a different model; do not be fooled by price. The N8R2 version in the same shop is cheaper but runs tight on memory with Xiaozhi. Third, some shops sell a Xiaozhi combo kit at 54 to 55 CNY with board, microphone, amplifier and screen pre-soldered; it saves trouble but you still add your own speaker and wires, landing near 78 CNY, a few CNY more than buying separately, worth it for matched parts. Fourth, the screen can wait; without it the assistant still talks, only you cannot see status or the code, so for a first build add it and the full set without screen is 67 CNY.
Wiring: three groups, each with a trap
The wiring below follows the official documentation for the 44-pin standard development board, ESP32-S3-DevKitC-1, firmware 0.3.0 or newer.
INMP441 microphone, I2S. ESP32-S3 GPIO 4 to WS, GPIO 5 to SCK, GPIO 6 to SD, 3V3 to VDD, GND to GND, and L/R shorted to GND.
MAX98357A amplifier, I2S. ESP32-S3 GPIO 7 to DIN, GPIO 15 to BCLK, GPIO 16 to LRC, 3V3 to Vin, GND to GND, SD shorted to 3V3, and GAIN shorted to GND.
0.96-inch OLED, I2C, optional. ESP32-S3 GPIO 41 to SDA, GPIO 42 to SCK, 3V3 to VCC, GND to GND.
Speaker to the amplifier audio plus and audio minus, red to positive.
Trap one: L/R must be grounded. The INMP441 has a left or right channel select pin; leave it floating and pickup is either silent or a mess. The official documentation calls this out specifically; the first build here failed on exactly this and wasted forty minutes blaming the firmware.
Trap two: the amplifier SD and GAIN must also be connected. SD to 3V3, otherwise the amplifier stays in shutdown and you hear only silence. GAIN to GND sets the gain. Miss these two and the microphone is fine while the speaker stays silent.
Trap three: not enough 3V3 and GND pins. The microphone, amplifier and screen all need 3V3 and GND, and the board has only a couple of pins. Use a two-sided breadboard or splitter Dupont wires. This is most people's first wall.
Trap four: a reverse-soldered microphone. Some INMP441 modules ship with headers on the back and the sound hole facing down. Either remap the pins using the official reverse-wiring diagram or re-solder it yourself. Beginners should not solder; read the reverse table in the documentation first.
Flashing: no toolchain, flash from the browser
This is the most comfortable part of the project: no ESP-IDF, no toolchain, flash from a browser. Download the firmware package from the official open-source repository. The breadboard build uses the bread-compact-wifi variant; the name containing bread is for breadboard wiring. Plug a data cable into the board; it must be a cable that transfers data, because a two-wire charge-only cable only supplies power and the computer will not see a serial port, which you might mistake for a driver problem. Open Device Manager and confirm a COM port appears; if not, install the serial-chip driver, usually CH340 or CP2102, from the seller. Open the ESP-Launchpad online flasher in Chrome or Edge, click Connect at the top right, select your COM port, switch to the DIY page, choose the firmware file, fill the flash address and flash. Two notes: use Chrome or Edge, not another browser, and disable antivirus and PC managers during flashing because they grab the serial port. After flashing the board reboots and the blue LED blinks, meaning it has entered configuration mode.
Networking and activation: there is a verification code, do not get stuck
Networking. In the phone Wi-Fi list find a hotspot named Xiaozhi-XXXX with no password and connect. The configuration page usually opens automatically; if not, open a browser and go to 192.168.4.1. Select your 2.4 GHz Wi-Fi, enter the password and connect. After connecting the board reboots, the blue LED stays on or a voice prompt plays, and it is online.
Activation, the key step. Once online the device speaks a sentence containing a six-digit verification code. This code is the binding credential. Open the Xiaozhi official console on a computer or phone and register or log in. On the left click New agent, name it and pick a role and voice. In device management click Add device and enter the six-digit code. Binding succeeds and the device can talk normally. Did not hear the code? Wake it and ask again and it repeats. On the screen version the code shows directly on the display, which is why adding a screen for the first build is recommended.
Re-networking. In a new Wi-Fi environment, hold the BOOT button at power on, tap RST, release RST then release BOOT, and it returns to configuration mode.
Details you only learn by building
Microphone gain defaults conservatively; a slightly larger room and it cannot hear. The official backend can adjust it, or change it in configuration before flashing. Set it to the middle and normal speech within two metres is fine. The wake word defaults to Nihao Xiaozhi; changing it needs an ESP-IDF recompile, which the browser flash cannot do, so beginners should leave it. Sound is muddy; a cavity speaker beats a bare one, but 3 watts is 3 watts, and a filtered amplifier with an 8 ohm 3 watt speaker helps a little, only a little. Heat is normal during long conversations; do not seal it in a closed case. After a router restart it reconnects on its own in about ten seconds, and after three failed attempts it returns to configuration mode. Do not use 5 GHz Wi-Fi; again, ESP32 sees only 2.4 GHz, and if your Wi-Fi does not appear in the configuration page this is almost certainly why.
Is it worth it
74 CNY for a box that talks back is worth it. It is not an AI assistant for hard questions; ask it something complex and the answer is so-so. But on a desk it makes a child curious, a guest asks about it, and you poke at it now and then. For going deeper the path is clear: add a 1.28-inch round screen for a face, add a servo to make a head-turning robot, swap in a better microphone array for far-field pickup, or connect your own agent for domain questions and answers. This hardware is a good starting point; everything after is addition.
Source: Hardcore Electronics DIY (Zhao Hongtao), WeChat, 6 November 2026.