News

日本語 · English · 中文

[Contribution] From M5Stick to XIAO ESP32S3: Rebuilding Voice AI Gadgets on a Breadboard

During prototyping with the M5StickS3, we encountered two obstacles: low speaker volume and cumbersome expansion GPIOs. We switched the microcontroller to the XIAO ESP32S3 Sense and reassembled it on a breadboard. By removing the camera and placing an optical sensor and tactile switch, we confirmed the entire flow of sending MEMS microphone audio to an LLM server via Wi-Fi and receiving responses back. Currently, we are waiting for the arrival of the MAX98357A amplifier module for the speaker, and plan to consolidate everything compactly on a universal circuit board in the future.

Hello! Recently, due to circumstances, I have been developing a custom gadget that allows voice interaction with an LLM (Large Language Model).

Until now, I had been progressing with prototypes using the M5StackS3/M5StickS3, but I inevitably hit two major walls. The M5Stack was overkill, so I switched to the Stick.

【Guest Post】Building a Transceiver-Type LLM Plant Conversation Device After Migrating to M5StickS3

  1. The built-in speaker volume is too low
  2. Every time I add sensors, I have to messily plug in expansion GPIOs

Thinking, "Wouldn't it be faster to simply rebuild this from scratch on a breadboard?", I decided to restart by changing the microcontroller to the XIAO ESP32S3 Sense.


🛠️ Removing the camera and starting fresh on a breadboard

With a fresh start, I first removed the camera module from the XIAO S3 Sense. Since my goal this time is "voice" and "environmental sensors," simplicity is best. Not being familiar with it, I ended up using the Sense version with a MEMS microphone (which is costly).

This time, I restarted by placing the following parts on a breadboard:

  • Light sensor (GA1A2S100SS) + Resistor (to detect ambient brightness)
  • Tactile switch (a button for "recording only while pressed")

Actually, despite doing electronics work, this is the first time I have installed a tactile switch myself! The excitement of seeing it work when assembled by my own hands, dealing with pin orientations and pull-up/pull-down wiring, which are elementary yet fundamental tasks, was immense. Although I was told I could connect them diagonally, I compacted the layout due to space constraints.

I am using the moisture sensor separately for now, putting it on hold. For this project, I will focus only on the newly installed light sensor. With the M5Stack, I used the touch display as buttons, and utilized a proximity sensor as a light sensor, but since my finger shadow interfered each time I pressed it, preventing accurate readings, I configured it this time to speak via the tactile switch.


🎙️ Finally confirmed back-and-forth communication with the LLM!

After completing network settings using Wi-FiManager, I tried speaking into the MEMS microphone. While watching the serial monitor...
I was able to confirm the entire flow at once: "Capture microphone audio ➔ Send to LLM server via Wi-Fi ➔ Receive smart response data"!

Although I ported the program horizontally from the M5Stick, thanks to the ample memory (PSRAM) of the XIAO, it is running very stably. Don't forget to enable the memory.


🛑 Next wall: The problem of unavailable speaker amplifier modules

I confirmed that responses were coming back from the LLM. So, all that's left is to hear them with my ears! ...But here arose the next issue.

Since I moved away from the M5Stick, I need to attach an external "amplifier module" to drive the speaker. After researching which one to choose, I was instructed (by my AI companion) to use the classic I2S DAC amp, the "MAX98357A".

"Alright, let's quickly buy one at the Akihabara store!" I went around visiting stores, but...
They are completely unavailable in physical stores, and even when found occasionally, they are quite expensive.

In the end, I gave up on buying them in-store and decided to order online and wait for delivery.

I thought about connecting via earphones, but it seems the XiaoESP32S3 only supports BLE, making earphone connection difficult.


By the way, until now, I handled moisture levels, sunlight exposure, and conversation history with the LLM by setting up a Python server and managing it via HTML, but I converted it to an Android app and started operating it as a smartphone app. It's convenient not having to set up a frontend server...


⏳ Future prospects

Currently, I am waiting for the amplifier to arrive. Since the breadboard setup has somewhat cleared up, I plan to make it more compact and robust using a universal board.

Taking a step forward, then stopping again while waiting for parts... This kind of "frustration" is also part of the thrill of electronics work.

This article was translated from the Japanese original. 日本語で読む

← Latest articles