Blogs
MP3-TF-16P SD Card MP3 Module with Serial Port

MP3-TF-16P SD Card MP3 Module with Serial Port
Compact Audio Playback Solution for Arduino and Microcontroller Projects
Introduction
The MP3-TF-16P module is a low-cost, high-quality audio playback solution that supports MP3 and WAV files from micro SD cards. Featuring a built-in DAC and amplifier, this module provides simple serial control and requires minimal external components.
Key Features
Audio Formats
Supports MP3 and WAV files (8-320kbps)
Storage
Micro SD card slot (up to 32GB supported)
Simple Interface
UART serial control (9600 baud default)
Built-in Amplifier
3W output (requires 5V power)
Technical Specifications
Model | MP3-TF-16P |
---|---|
Control Interface | UART Serial (TTL level) |
Audio Output | Mono 3W (8Ω speaker) |
Operating Voltage | 3.2-5V (5V recommended) |
Supported Cards | Micro SD (FAT16/FAT32) |
Standby Current | <20mA |
Pin Configuration

Pin | Label | Description | Connection |
---|---|---|---|
1 | VCC | Power (5V recommended) | 5V |
2 | RX | Serial Receive | Arduino TX |
3 | TX | Serial Transmit | Arduino RX |
4 | DAC_R | Right Audio (not used) | – |
5 | DAC_L | Left Audio Output | Speaker+ |
6 | GND | Ground | GND |
7 | SPK1 | Amplifier Output+ | Speaker+ |
8 | SPK2 | Amplifier Output- | Speaker- |
9 | IO1 | GPIO (optional) | – |
10 | IO2 | GPIO (optional) | – |
11 | ADKEY1 | Analog Key 1 | – |
12 | ADKEY2 | Analog Key 2 | – |
13 | BUSY | Playback Status | Digital Input |
14 | RESET | Active Low Reset | – |
15 | GND | Ground | GND |
16 | GND | Ground | GND |
Note: For basic playback, you only need to connect VCC, GND, RX, and speaker pins
Basic Wiring with Arduino

1 2 3 4 5 6 7 |
// Basic Connections: // MP3 Module VCC → Arduino 5V // MP3 Module GND → Arduino GND // MP3 Module RX → Arduino TX (Pin 11) // MP3 Module TX → Arduino RX (Pin 10) // Speaker+ → SPK1 or DAC_L // Speaker- → SPK2 or GND |
Library Setup
- Install the DFRobotDFPlayerMini library via Arduino Library Manager
- Include the library and SoftwareSerial in your sketch:
12#include "SoftwareSerial.h"#include "DFRobotDFPlayerMini.h" - Set up the serial connection:
12SoftwareSerial mySoftwareSerial(10, 11); // RX, TXDFRobotDFPlayerMini myDFPlayer;
Basic Playback Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
#include "SoftwareSerial.h" #include "DFRobotDFPlayerMini.h" //Inicia a serial por software nos pinos 10 e 11 SoftwareSerial mySoftwareSerial(10, 11); // RX, TX DFRobotDFPlayerMini myDFPlayer; char command; int pausa = 0; void setup() { delay (2000); //Comunicacao serial com o modulo mySoftwareSerial.begin(9600); //Inicializa a serial do Arduino Serial.begin(115200); //Verifica se o modulo esta respondendo e se o //cartao SD foi encontrado Serial.println(); Serial.println(F("DFRobot DFPlayer Mini")); Serial.println(F("Initializing DFPlayer module ... Wait!")); if (!myDFPlayer.begin(mySoftwareSerial)) { Serial.println(F("Not initialized:")); Serial.println(F("1. Check the DFPlayer Mini connections")); Serial.println(F("2. Insert an SD card")); while (true); } Serial.println(); Serial.println(F("DFPlayer Mini module initialized!")); //Definicoes iniciais myDFPlayer.setTimeOut(500); //Timeout serial 500ms myDFPlayer.volume(5); //Volume 5 myDFPlayer.EQ(0); //Equalizacao normal menu_opcoes(); } void loop() { //Waits for data entry via serial while (Serial.available() > 0) { command = Serial.read(); if ((command >= '1') && (command <= '9')) { Serial.print("Music reproduction"); Serial.println(command); command = command - 48; myDFPlayer.play(command); menu_opcoes(); } //Reproduction //Stop if (command == 's') { myDFPlayer.stop(); Serial.println("Music Stopped!"); menu_opcoes(); } //Pausa/Continua a music if (command == 'p') { pausa = !pausa; if (pausa == 0) { Serial.println("Continue..."); myDFPlayer.start(); } if (pausa == 1) { Serial.println("Music Paused!"); myDFPlayer.pause(); } menu_opcoes(); } //Increases volume if (command == '+') { myDFPlayer.volumeUp(); Serial.print("Current volume:"); Serial.println(myDFPlayer.readVolume()); menu_opcoes(); } if (command == '<') { myDFPlayer.previous(); Serial.println("Previous:"); Serial.print("Current track:"); Serial.println(myDFPlayer.readCurrentFileNumber()-1); menu_opcoes(); } if (command == '>') { myDFPlayer.next(); Serial.println("next:"); Serial.print("Current track:"); Serial.println(myDFPlayer.readCurrentFileNumber()+1); menu_opcoes(); } //Decreases volume if (command == '-') { myDFPlayer.volumeDown(); Serial.print("Current Volume:"); Serial.println(myDFPlayer.readVolume()); menu_opcoes(); } } } void menu_opcoes() { Serial.println(); Serial.println(F("==================================================================================================================================")); Serial.println(F("Commands:")); Serial.println(F(" [1-3] To select the MP3 file")); Serial.println(F(" [s] stopping reproduction")); Serial.println(F(" [p] pause/continue music")); Serial.println(F(" [+ or -] increases or decreases the volume")); Serial.println(F(" [< or >] forwards or backwards the track")); Serial.println(); Serial.println(F("=================================================================================================================================")); } |
File Preparation
- Format micro SD card as FAT32
- Create a folder named mp3 in the root directory
- Name your audio files as 0001.mp3, 0002.mp3, etc.
- Insert card into module before powering on
Tip: Files are played in numerical order (0001.mp3, 0002.mp3, etc.)
Advanced Features
Volume Control
1 2 3 |
myDFPlayer.volume(10); // 0-30 myDFPlayer.volumeUp(); // Increase myDFPlayer.volumeDown();// Decrease |
Playback Modes
1 2 3 4 5 |
myDFPlayer.play(1); // Play specific track myDFPlayer.next(); // Next track myDFPlayer.previous(); // Previous track myDFPlayer.pause(); // Pause playback myDFPlayer.start(); // Resume playback |
Equalizer Settings
1 2 3 |
// Available presets: // Normal, Pop, Rock, Jazz, Classic, Bass myDFPlayer.EQ(DFPLAYER_EQ_BASS); |
Playback Status
1 2 3 |
uint16_t track = myDFPlayer.readCurrentFileNumber(); uint16_t volume = myDFPlayer.readVolume(); uint16_t state = myDFPlayer.readState(); |
Troubleshooting
No Sound Output
- Check speaker connections
- Verify SD card is properly inserted
- Confirm files are named correctly (0001.mp3, etc.)
- Check volume setting (myDFPlayer.volume(20))
Module Not Responding
- Verify power supply (5V recommended)
- Check serial connections (RX/TX swapped?)
- Ensure proper baud rate (9600 default)
- Try resetting the module
File Playback Issues
- Reformat SD card as FAT32
- Check file format (MP3 or WAV)
- Ensure files are in /mp3 folder
- Try different bitrates (128kbps works well)