Community project

ESP32 SD MP3 Player

Photo of ESP32 SD MP3 Player
Generated with AI

Tommy Doan

Published December 1, 2026

Build a portable MP3 player powered by an ESP32 microcontroller that reads music files from an SD card and plays them through an 8Ω speaker. This project combines audio decoding, file management, and playback control into a compact device that can store and play your entire music library.

This guide provides a complete wiring diagram, parts list, and step-by-step assembly instructions to get your player up and running. The included firmware handles MP3 decoding, file searching, and playback logic, so you'll have a fully functional music player after connecting the speaker and loading your SD card with MP3 files.

Wiring diagram

Wiring diagram for ESP32 SD MP3 Player
Loading diagram…

Gather all the parts

QtyComponent
1

8Ω Speaker

8 Ω, 2 W, with matching JP3 plug

Generic small 8Ω 0.5-3W loudspeaker (~28mm typical). Pair with an I2S amp (MAX98357A) or class-D amp (TPA3116D2) for usable volume; do not drive directly from a GPIO pin. Audio output for music/voice playback.

Assemble it in 2 steps

1. Connect the speaker with USB unplugged

Plug an 8 Ω, 2 W speaker with a matching 1.25 mm two-pin plug into JP3. Speaker positive goes to SP+ and speaker negative goes to SP-.

  • Neither speaker pin goes to ground.

2. Insert the music card

Copy MP3 files directly onto a FAT32 microSD card, safely eject it from your computer, then insert it in the board before plugging in USB.

Review all connections

1. Connections between "speaker" and "ESP32"

FunctionspeakerESP32
analogPOS → Board JP3 SP+ (amplified speaker output)EXT
analogNEG → Board JP3 SP- (amplified speaker return, not ground)EXT

Deploy the firmware

Loading src/main.cpp…

Remix this project

Make it yours in one click

Open a full copy of this project in your own Schematik workspace, diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.

Open in Schematik