-
1WIRING
Microphone - INMP441 (I2S)
SD -> GPIO 40
WS -> GPIO 41
SCK -> GPIO 42
L/R -> GND
VDD -> 3.3V
GND -> GNDAmplifier - MAX98357A
DIN -> GPIO 17 (shared I2S data)
BCLK -> GPIO 47 (shared)
LRC -> GPIO 21 (shared)
SD -> 3.3V, or GPIO 38 if you fit the PCM5102A
VIN -> 5V
GAIN -> 3.3V (6 dB)
GND -> GNDHeadphone DAC - PCM5102A (optional)
DIN -> GPIO 17 (shared)
BCK -> GPIO 47 (shared)
LCK -> GPIO 21 (shared)
SCK -> GND (internal PLL mode)
XSMT -> GPIO 39 (HIGH = play)
FMT / FLT / DEMP -> GND
VIN -> 3.3V
GND -> GNDDisplay - GC9A01, 240x240 round SPI
SCLK -> GPIO 6
MOSI -> GPIO 7
CS -> GPIO 5
DC -> GPIO 4
RST -> GPIO 2
BLK -> 3.3V
VCC -> 3.3V
GND -> GNDButton and LED
PTT button -> GPIO 1, INPUT_PULLUP, active LOW
NeoPixel -> GPIO 48 (built in on most S3 boards)Power: the 3.3V rail feeds the mic, the display and the optional DAC.
The MAX98357A wants 5V. Common ground throughout. -
2BOARD SETTINGS (Arduino IDE)
ESP32S3 Dev Module - CPU 240 MHz - Flash 16 MB - PSRAM: OPI PSRAM - Upload 921600 - Partition scheme: custom, uses partitions.csv.
Libraries: ArduinoJson, Adafruit NeoPixel, Arduino_GFX_Library.
Do NOT install ArduinoWebsockets from the Library Manager. A patched copy is vendored in src/, because 0.5.3 cannot open a WSS connection on ESP32 and fails silently. That one cost me a weekend.
PlatformIO: everything is pinned in platformio.ini. pio run -t upload pio run -t uploadfs
-
3TWO FLASHES (Code and Emotions)
The sketch and the emoji frames live in different partitions. Flash the sketch, then upload the LittleFS image separately - 56 pre-rendered RGB565 .bin files, about 11 MB. Serial prints "Display: loaded 8 frames for 'neutral'" when it worked. Skipping this is the usual way to end up staring at a blank screen.
-
4FIRST BOOT
No WiFi or OPENAI credentials are compiled in. On first boot the device opens an open AP called VOICE-AGENT-XXYY, flashes the LED yellow, and puts a QR code on the display. Join it, the captive portal opens by itself, enter your network, Save & Restart. After that it lives at voice-agent-XXYY.local. Credentials persist in NVS.
In the portal, you also need to add your OPENAI key. (Get one here; you get $5 when you register: https://platform.openai.com/ )
-
5LED STATES
- Yellow solid connecting to WiFi
- Yellow flashing AP config mode, waiting for credentials
- Green ready, push to talk
- Pink recording
- Blue waiting on the API
- Cyan speaking
-
6FULL BUILD INSTRUCTIONS
Toolchain versions, config.h, the portal admin zone and the parts list are in the repo, which stays current: https://github.com/iollama/Voice-Assistant-5/
Udi Tirosh
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.