ESP32-S3 SuperMini desktop pet using an SSD1306 OLED, INMP441 microphone, and MAX98357A speaker amp.
The project now runs the gateway-based voice-chat flow:
voice trigger
-> record WAV from INMP441
-> POST WAV to AdPet Gateway
-> Gateway handles STT / LLM / TTS / memory
-> play WAV through MAX98357A
-> update OLED emotions
The ESP32 no longer talks directly to STT/LLM/TTS providers. See docs/gateway.md.
All GPIO assignments are centralized in src/board/BoardPins.h. When the enclosure layout changes, edit that file only and rewire the matching signals. Duplicate active GPIO assignments cause a compile-time error.
OLED:
| OLED | ESP32-S3 SuperMini |
|---|---|
| VCC | 3V3 |
| GND | GND |
| SDA | GPIO8 |
| SCL | GPIO9 |
INMP441:
| INMP441 | ESP32-S3 SuperMini |
|---|---|
| VDD | 3V3 |
| GND | GND |
| SCK/BCLK | GPIO4 |
| WS/LRCLK | GPIO5 |
| SD/DOUT | GPIO6 |
| L/R | GND |
MAX98357A:
| MAX98357A | ESP32-S3 SuperMini |
|---|---|
| VIN | 5V |
| GND | GND |
| BCLK | GPIO10 |
| LRC | GPIO11 |
| DIN | GPIO12 |
| SPK+ | Speaker + |
| SPK- | Speaker - |
- In Arduino IDE select
ESP32S3 Dev Module. - Set the flash size to match the module marking. If the module includes PSRAM, select its matching
QSPI PSRAMorOPI PSRAM; otherwise selectDisabled. - Upload
AdPet.inowith Arduino IDE. - Open Serial Monitor at
115200and check the[Memory]line forpsram=yes/no. - Connect your phone/computer to Wi-Fi AP
AdPet-Setup, passwordadpet1234. - Open the setup page printed in Serial Monitor, usually
http://192.168.4.1. - Fill Wi-Fi and Gateway settings.
- Save config and reset the board.
Default gateway settings:
Gateway Base URL: http://192.168.1.100:8787
Device ID: adpet-001
When the microphone level crosses the configured threshold:
- OLED changes to the configured listening expression.
- ESP32 includes about 300 ms of pre-roll audio so the first word is not cut off.
- Recording ends after about 700 ms of silence or at the configured maximum duration.
- Gateway receives WAV and handles STT, LLM, TTS, and memory.
- Gateway returns WAV audio and an emotion name.
- The speaker plays the reply, then microphone triggering resumes after a short guard period.
Serial Monitor prints each step, including HTTP status codes.
Without PSRAM, recording is capped at 3000 ms to preserve memory for Wi-Fi and HTTP. With PSRAM enabled, recordings, HTTP request bodies, and TTS WAV data prefer PSRAM.
AdPet.ino
src/app app orchestration
src/board all hardware GPIO assignments
src/core config, emotions, pet state
src/drivers/audio INMP441/MAX98357A audio
src/drivers/display SSD1306 faces
src/services/network Wi-Fi and web config
src/services/llm AdPet Gateway client