
做一台 AI 陪伴设备,光有喇叭不够,还需要一个“表情”。这套方案选择 GC9A01 圆形 LCD,240×240 分辨率、SPI 接口,价格低且容易采购。接线方式与常见方屏类似,SCLK、MOSI、DC、CS、RST、BLK 对应开发板的 SPI 引脚;用 ESP-IDF 的 SPI Master 驱动,LVGL 在上面绘制表情动画。由于分辨率不高,一张卡通表情只有几十 KB,放进 PSRAM 做帧缓冲完全没有问题。
双核资源要合理划分。SPI 刷新屏幕会占用 CPU 时间,因此不能把 UI 刷新和音频采集放在同一个核心上。ESP32-S3 是双核芯片,项目把音频、网络和唤醒词放在 core0,把 UI、LED 灯效和按键扫描放在 core1,并用 FreeRTOS 的任务绑核避免高优先级音频任务被 UI 刷新卡住。圆形屏常见的状态映射包括唤醒时眼睛睁开、聆听时嘴巴动作、说话时眼睛变亮、断网时显示断线云朵,这些表情与设备状态机一一对应。
端侧唤醒是隐私与功耗的关键。设备上电后并不持续录音上传,而是先跑唤醒词引擎,只有检测到指定唤醒词才进入聆听状态。乐鑫官方的 ESP-SR 支持“你好小智”等默认唤醒词,也可用 ESP-WakeNet 自定义;项目定制了“小贝小贝”,训练数据覆盖不同年龄、语速和背景噪声,实测唤醒率超过 95%,误唤醒则靠阈值调节。麦克风走 I2S,16kHz 单声道 16bit 是 ASR 与 TTS 的常用规格;若使用 PDM 麦克风,需要 2.048MHz 时钟抽取到 16kHz PCM。
本文来源:https://www.hqwc.cn/a/1581196.html
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。
An AI companion device needs more than a speaker; it needs a face. This build uses a GC9A01 round LCD at 240 by 240 pixels over SPI, chosen for low cost and wide availability. Wiring is similar to a square panel: SCLK, MOSI, DC, CS, RST and BLK map to the board's SPI pins. With ESP-IDF's SPI Master driver, LVGL can draw expression animations on top. At this resolution, a cartoon face takes only tens of kilobytes, so a frame buffer in PSRAM is sufficient.
The dual-core architecture matters. SPI screen refresh consumes CPU time, so UI updates and audio capture should not share a core. The project assigns audio, networking and wake-word detection to core0, and UI, LED effects and button scanning to core1, using FreeRTOS task pinning to prevent high-priority audio tasks from being blocked by screen refreshes. Round displays are used for state feedback: eyes open on wake, the mouth moves while listening, eyes brighten while speaking and a broken-cloud icon appears offline. These expressions map directly to the device state machine.
On-device wake detection is key to both privacy and power use. The device does not stream audio continuously; it runs a wake-word engine and only enters listening mode after hearing the trigger. Espressif's ESP-SR supports default phrases such as "Nihao Xiaozhi", while ESP-WakeNet allows custom training. This project uses a custom Chinese wake phrase, with training data covering different ages, speaking rates and background noise. Measured wake rate exceeded 95 percent, with false triggers controlled by threshold tuning. The microphone runs over I2S at 16 kHz mono, 16 bit; PDM microphones require a 2.048 MHz clock decimated to 16 kHz PCM.
本文来源:https://www.hqwc.cn/a/1581196.html
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。