ESP32 C3 Super Mini - MP3 Player

Learn how to build a small MP3 player with the ESP32 C3 Super Mini, a serial MP3 player module, a Micro SD Card, and a speaker. Your songs live on the Micro SD Card, and the ESP32 C3 Super Mini sends simple serial commands to tell the module what to play. This beginner-friendly ESP32 C3 Super Mini MP3 player project only needs a few wires and a short sketch.

In this tutorial, you'll learn:

ESP32 C3 Super Mini - MP3 Player

Hardware Preparation

1×ESP32 C3 Super Mini
1×USB Cable Type-A to Type-C (for USB-A PC)
1×USB Cable Type-C to Type-C (for USB-C PC)
1×Serial MP3 Player Module
1×Micro SD Card
1×3.5mm Aux Speaker
1×Breadboard
1×Jumper Wires

Or you can buy the following kits:

1×DIYables Sensor Kit (18 sensors/displays)
Disclosure: Some of the links provided in this section are Amazon affiliate links. We may receive a commission for any purchases made through these links at no additional cost to you.
Additionally, some of these links are for products from our own brand, DIYables .

Overview of Serial MP3 Player Module and Speaker

The serial MP3 player module is a small audio player that reads MP3 files from a Micro SD Card and turns them into sound.

Key Features:

  • Plays MP3 files stored on a Micro SD Card
  • Controlled by simple serial (UART) commands
  • Has a built-in amplifier and a 3.5mm Aux output
  • Can play, pause, skip, repeat, and change volume
  • Works well with the ESP32 C3 Super Mini

Technical Specifications:

  • Power supply: 5V
  • Serial speed: 9600 baud, 8 data bits, no parity, 1 stop bit
  • Logic level on RX: 3.3V friendly, but a series resistor is recommended
  • Storage: Micro SD Card (FAT16 / FAT32)
  • Audio output: 3.5mm Aux female jack

Serial MP3 Player Module Pinout

The module has three interfaces.

  • The interface to the ESP32 C3 Super Mini includes 4 pins:
    • RX pin: data pin, connect it to a TX pin of the ESP32 C3 Super Mini
    • TX pin: data pin, connect it to an RX pin of the ESP32 C3 Super Mini
    • VCC pin: power pin, connect it to 5V
    • GND pin: power pin, connect it to GND (0V)
  • The interface to the speaker is a 3.5mm Aux output female jack.
  • The interface to the Micro SD Card is a Micro SD Card socket on the back of the module.
Serial MP3 Player Module Pinout

Speaker Pinout

A speaker usually has two interfaces.

  • Audio signal interface: a 3.5mm Aux male connector that plugs into the MP3 player module
  • Power interface: it can be USB, a 5V power adapter, or any other power source

How It Works

Getting sound out of the ESP32 C3 Super Mini MP3 player takes only a few steps.

  • Prepare the card: Copy the songs or recorded audio you want to play onto a Micro SD Card.
  • Insert the card: Push the Micro SD Card into the socket on the MP3 player module.
  • Wire it up: Connect the MP3 player module to the ESP32 C3 Super Mini, and plug the speaker into the module.
  • Power the speaker: Make sure the speaker has its own power source.

Each MP3 file on the Micro SD Card gets an ID, starting from 0. The ESP32 C3 Super Mini can then tell the module to do these things:

  • Play: Start playing the selected song.
  • Pause: Pause the song.
  • Play Next: Move to the next song.
  • Play Previous: Go back to the previous song.
  • Change Volume: Adjust how loud the music is.

When the MP3 player module gets a command, it reads the MP3 file from the Micro SD Card, turns it into an audio signal, and sends that signal to the speaker through the 3.5mm Aux connection.

※ NOTE THAT:

The ESP32 C3 Super Mini uses GPIO20 and GPIO21 for the Serial Monitor. Those two pins must stay free. That is why this tutorial uses a second hardware serial port on GPIO6 and GPIO7 for the MP3 player module.

Wiring Diagram

Wire the MP3 player module to the ESP32 C3 Super Mini as shown below.

The wiring diagram between ESP32 C3 Super Mini MP3 player module

This image is created using Fritzing. Click to enlarge image

  • Note: TX goes to RX and RX goes to TX. Crossing these two wires is the most common mistake.
  • Note: Power the module from 5V, not 3.3V. It needs 5V to drive the speaker.
  • Note: Do not connect any module pin to GPIO20 or GPIO21 — they belong to the Serial Monitor.
Serial MP3 Player Module Pin ESP32 C3 Super Mini Pin
VCC 5V
GND GND
RX GPIO6 (ESP32 TX)
TX GPIO7 (ESP32 RX)

※ NOTE THAT:

The Serial MP3 Player module needs 5V power, but its RX pin expects 3.3V logic. The ESP32 C3 Super Mini is a 3.3V board, so its TX level is already safe. To protect the module and keep the signal clean, it is recommended to put a 1kΩ resistor in series on the RX line, between the ESP32 C3 Super Mini GPIO6 pin and the module RX pin.

ESP32 C3 Super Mini Code - Play Music

This first sketch plays the first song stored on the Micro SD Card.

What This Code Does:

  • Starts the Serial Monitor at 115200 baud
  • Starts a second hardware serial port on GPIO6 (TX) and GPIO7 (RX) at 9600 baud
  • Tells the module to use the Micro SD Card as the storage device
  • Sends a Play command so the first song starts right away
  • Builds each command as an 8-byte frame the module understands
/* * This ESP32 C3 Super Mini code was developed by newbiely.com * * This ESP32 C3 Super Mini code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/esp32-c3/esp32-c3-super-mini-mp3-player */ #include <HardwareSerial.h> #define CMD_PLAY_NEXT 0x01 #define CMD_PLAY_PREV 0x02 #define CMD_PLAY_W_INDEX 0x03 #define CMD_SET_VOLUME 0x06 #define CMD_SEL_DEV 0x09 #define CMD_PLAY_W_VOL 0x22 #define CMD_PLAY 0x0D #define CMD_PAUSE 0x0E #define CMD_SINGLE_CYCLE 0x19 #define DEV_TF 0x02 #define SINGLE_CYCLE_ON 0x00 #define SINGLE_CYCLE_OFF 0x01 #define RX1PIN 7 // The ESP32 C3 SuperMini pin connected to the TX of the Serial MP3 Player module #define TX1PIN 6 // The ESP32 C3 SuperMini pin connected to the RX of the Serial MP3 Player module HardwareSerial mp3Serial(1); // use UART1 of ESP32 C3 SuperMini, UART0 is used by Serial Monitor void setup() { Serial.begin(115200); mp3Serial.begin(9600, SERIAL_8N1, RX1PIN, TX1PIN); // the MP3 module always uses 9600 baud delay(500); // wait chip initialization is complete mp3_command(CMD_SEL_DEV, DEV_TF); // select the TF card delay(200); // wait for 200ms mp3_command(CMD_PLAY, 0x0000); // Play mp3 //mp3_command(CMD_PAUSE, 0x0000); // Pause mp3 //mp3_command(CMD_PLAY_NEXT, 0x0000); // Play next mp3 //mp3_command(CMD_PLAY_PREV, 0x0000); // Play previous mp3 //mp3_command(CMD_SET_VOLUME, 30); // Change volume to 30 } void loop() { } void mp3_command(int8_t command, int16_t dat) { int8_t frame[8] = { 0 }; frame[0] = 0x7e; // starting byte frame[1] = 0xff; // version frame[2] = 0x06; // The number of bytes of the command without starting byte and ending byte frame[3] = command; // frame[4] = 0x00; // 0x00 = no feedback, 0x01 = feedback frame[5] = (int8_t)(dat >> 8); // data high byte frame[6] = (int8_t)(dat); // data low byte frame[7] = 0xef; // ending byte for (uint8_t i = 0; i < 8; i++) { mp3Serial.write(frame[i]); } }

Detailed Instructions

  • New to ESP32 C3 Super Mini? Complete our Getting Started with ESP32 C3 Super Mini tutorial first to set up your development environment.
  • Prepare the card: Copy a few MP3 files to the Micro SD Card and insert it into the module.
  • Wire the parts: Follow the wiring diagram above, and plug the speaker into the module's Aux jack.
  • Connect the board: Plug the ESP32 C3 Super Mini into your computer with the USB Type-C cable.
  • Select the board: Make sure ESP32 C3 Super Mini is selected in Tools > Board.
  • Select the port: Pick the right COM port in Tools > Port.
  • Upload the code: Copy the code above into Arduino IDE and click the Upload button.
  • Open Serial Monitor: Set the baud rate to 115200 to watch the messages.
  • Enjoy the music: The first song on the card starts playing through the speaker.
  • Pro Tip: If you hear nothing, swap the RX and TX wires first — crossed data lines are the usual cause.

ESP32 C3 Super Mini Code - Play Music with Control Buttons

This second sketch is an upgrade of the first one. It adds four buttons so you can control the ESP32 C3 Super Mini MP3 player by hand.

What This Code Does:

  • Reads four buttons with the ezButton library, with 50 ms debounce
  • Sends a Play command when the button on GPIO2 is pressed
  • Sends a Pause command when the button on GPIO3 is pressed
  • Sends a Play Next command when the button on GPIO4 is pressed
  • Sends a Play Previous command when the button on GPIO5 is pressed
  • Prints what it is doing to the Serial Monitor
/* * This ESP32 C3 Super Mini code was developed by newbiely.com * * This ESP32 C3 Super Mini code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/esp32-c3/esp32-c3-super-mini-mp3-player */ #include <HardwareSerial.h> #include <ezButton.h> #define CMD_PLAY_NEXT 0x01 #define CMD_PLAY_PREV 0x02 #define CMD_PLAY_W_INDEX 0x03 #define CMD_SET_VOLUME 0x06 #define CMD_SEL_DEV 0x09 #define CMD_PLAY_W_VOL 0x22 #define CMD_PLAY 0x0D #define CMD_PAUSE 0x0E #define CMD_SINGLE_CYCLE 0x19 #define DEV_TF 0x02 #define SINGLE_CYCLE_ON 0x00 #define SINGLE_CYCLE_OFF 0x01 #define RX1PIN 7 // The ESP32 C3 SuperMini pin connected to the TX of the Serial MP3 Player module #define TX1PIN 6 // The ESP32 C3 SuperMini pin connected to the RX of the Serial MP3 Player module HardwareSerial mp3Serial(1); // use UART1 of ESP32 C3 SuperMini, UART0 is used by Serial Monitor ezButton button_play(2); // create ezButton object for pin GPIO2 ezButton button_pause(3); // create ezButton object for pin GPIO3 ezButton button_next(4); // create ezButton object for pin GPIO4 ezButton button_prev(5); // create ezButton object for pin GPIO5 void setup() { Serial.begin(115200); mp3Serial.begin(9600, SERIAL_8N1, RX1PIN, TX1PIN); // the MP3 module always uses 9600 baud delay(500); // wait chip initialization is complete mp3_command(CMD_SEL_DEV, DEV_TF); // select the TF card delay(200); // wait for 200ms button_play.setDebounceTime(50); // set debounce time to 50 milliseconds button_pause.setDebounceTime(50); // set debounce time to 50 milliseconds button_next.setDebounceTime(50); // set debounce time to 50 milliseconds button_prev.setDebounceTime(50); // set debounce time to 50 milliseconds } void loop() { button_play.loop(); // MUST call the loop() function first button_pause.loop(); // MUST call the loop() function first button_next.loop(); // MUST call the loop() function first button_prev.loop(); // MUST call the loop() function first if (button_play.isPressed()) { Serial.println("Play mp3"); mp3_command(CMD_PLAY, 0x0000); } if (button_pause.isPressed()) { Serial.println("Pause mp3"); mp3_command(CMD_PAUSE, 0x0000); } if (button_next.isPressed()) { Serial.println("Play next mp3"); mp3_command(CMD_PLAY_NEXT, 0x0000); } if (button_prev.isPressed()) { Serial.println("Play previous mp3"); mp3_command(CMD_PLAY_PREV, 0x0000); } } void mp3_command(int8_t command, int16_t dat) { int8_t frame[8] = { 0 }; frame[0] = 0x7e; // starting byte frame[1] = 0xff; // version frame[2] = 0x06; // The number of bytes of the command without starting byte and ending byte frame[3] = command; // frame[4] = 0x00; // 0x00 = no feedback, 0x01 = feedback frame[5] = (int8_t)(dat >> 8); // data high byte frame[6] = (int8_t)(dat); // data low byte frame[7] = 0xef; // ending byte for (uint8_t i = 0; i < 8; i++) { mp3Serial.write(frame[i]); } }

The wiring diagram for the above code:

The wiring diagram between ESP32 C3 Super Mini MP3 player speaker

This image is created using Fritzing. Click to enlarge image

Button ESP32 C3 Super Mini Pin
Play button GPIO2
Pause button GPIO3
Next button GPIO4
Previous button GPIO5
Other side of every button GND
  • Note: Each button connects between its GPIO pin and GND. The ezButton library turns on the internal pull-up for you.
  • Note: The MP3 module still uses GPIO6 and GPIO7, so do not reuse those pins for buttons.

Serial Monitor Output

Press the buttons and you will see messages like this at 115200 baud.

Newbiely | Arduino IDE 2.3.8
──
File
Edit
Sketch
Tools
Help
ESP32C3 Dev Module
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32C3 Dev Module' on 'COM15')
New Line
9600 baud
[2026-04-15 09:12:03] Play mp3 [2026-04-15 09:12:19] Pause mp3 [2026-04-15 09:12:27] Play mp3 [2026-04-15 09:13:41] Play next mp3 [2026-04-15 09:14:58] Play previous mp3
Ln 11, Col 1
ESP32C3 Dev Module on COM15
2

※ NOTE THAT:

You may NOT see the first line on the Serial Monitor if your upload finishes before you open the Serial Monitor. Just press a button again.

Now you can extend the ESP32 C3 Super Mini MP3 player with more features, for example:

  • Volume knob: Add a potentiometer to control the volume, see the ESP32 C3 Super Mini Potentiometer tutorial
  • Remote control: Add an IR remote controller so you can change songs from across the room
  • RFID player: Add an RFID reader and cards to make an RFID MP3 player, see the ESP32 C3 Super Mini RFID tutorial

Applications and Project Ideas

Here are some fun things you can build with an ESP32 C3 Super Mini MP3 player.

  • Kids story box: Play a bedtime story when a big button is pressed.
  • Doorbell: Play a custom tune or a recorded greeting when someone rings.
  • Museum guide: Play the right audio clip for each RFID tag.
  • Alarm clock: Wake up to your own music instead of a beep.
  • Talking robot: Play recorded voice lines while your robot moves.
  • Shop announcer: Play a welcome message when a motion sensor sees a customer.

Challenge Yourself

Try these small upgrades to learn more.

  • Easy: Change the code to start playing song number 3 instead of song number 1.
  • Easy: Set the volume in setup() with the CMD_SET_VOLUME command.
  • Medium: Add a fifth button that turns single-song repeat on and off.
  • Medium: Use a potentiometer on GPIO4 to set the volume in real time.
  • Advanced: Add an OLED display that shows the current track number.
  • Advanced: Control the MP3 player over WiFi from a web page on the ESP32 C3 Super Mini.

Function References

※ OUR MESSAGES

  • As freelancers, We are AVAILABLE for HIRE. See how to outsource your project to us
  • Please feel free to share the link of this tutorial. However, Please do not use our content on any other websites. We invested a lot of effort and time to create the content, please respect our work!