march 2026 – april 2026
The goal was to build a small music player from scratch. Breadboard prototype as a working proof of concept, with a custom PCBA designed for the next iteration.
> Built a handheld MP3 player from scratch on breadboard, integrating an ESP32, PCM5102A DAC over I2S, eInk display, microSD card, and LiPo power system into a 3d-printed enclosure.
> Diagnosed and resolved a silent I2S audio failure caused by a version conflict between the ESP32 Arduino core v3.x and the audio library; fix required rolling back to core 2.0.17.
> Implemented a four-screen firmware state machine in C++ for playback, library browsing, and settings, with MP3 decoding running fully in software on the ESP32.
Circuit Layout
All components connect back to the ESP32, which acts as the brain. The key connections are:
> Audio (I2S): BCK → GPIO22, LRCK → GPIO21, DIN → GPIO27
> Display (SPI): MOSI → GPIO19, SCK → GPIO18, CS → GPIO5, DC → GPIO4, RST → GPIO16, BUSY → GPIO2
> SD Card (SPI): Shares MOSI/SCK with display, separate CS pin → GPIO23
> Buttons: GPIO34, 35, 36, 39 (with external 10kΩ pull-up resistors to 3.3V)
> Scroll Wheel: Rotary encoder on two GPIO pins
Firmware
The firmware was written in Cpp using the Arduino framework for ESP32. It implements a state machine with four screens:
> Now Playing: shows track name, artist, playback progress
> Library: scrollable list of songs on the SD card
> Menu: settings and options
> Settings: volume, display brightness, etc.
MP3 decoding uses the ESP32-audioI2S library, which runs the decode entirely in software on the ESP32’s dual-core processor.