

The DFRobot DFPlayer Mini is a compact and cost-effective MP3 player module designed for embedded audio applications. It can play audio files directly from a micro SD card and features a built-in amplifier, making it suitable for standalone or microcontroller-based projects. The module supports various audio formats, including MP3, WAV, and WMA, and offers multiple control modes such as serial communication, AD key control, and GPIO control.








The DFPlayer Mini has 16 pins. Below is the pinout and description:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (3.2V to 5.0V). |
| 2 | RX | UART receive pin for serial communication. |
| 3 | TX | UART transmit pin for serial communication. |
| 4 | DAC_R | Right channel audio output (stereo). |
| 5 | DAC_L | Left channel audio output (stereo). |
| 6 | SPK_1 | Positive terminal for mono speaker output (built-in amplifier). |
| 7 | SPK_2 | Negative terminal for mono speaker output (built-in amplifier). |
| 8 | IO_1 | GPIO pin 1 for AD key or GPIO control. |
| 9 | IO_2 | GPIO pin 2 for AD key or GPIO control. |
| 10 | BUSY | Indicates playback status (HIGH when idle, LOW when playing). |
| 11 | GND | Ground connection. |
| 12 | ADKEY_1 | Analog input for AD key control. |
| 13 | ADKEY_2 | Analog input for AD key control. |
| 14 | SD/TF_CS | Chip select for micro SD card interface. |
| 15 | SD/TF_CLK | Clock signal for micro SD card interface. |
| 16 | SD/TF_DIO | Data input/output for micro SD card interface. |
Power Supply:
Audio Output:
Control via UART:
Micro SD Card:
Serial Communication:
SoftwareSerial library on Arduino to communicate with the module.#include "SoftwareSerial.h"
// Define RX and TX pins for SoftwareSerial
SoftwareSerial mySerial(10, 11); // RX = Pin 10, TX = Pin 11
void setup() {
mySerial.begin(9600); // Initialize DFPlayer Mini at 9600 baud rate
Serial.begin(9600); // Initialize Serial Monitor for debugging
// Send initialization command to DFPlayer Mini
mySerial.write(0x7E); // Start byte
mySerial.write(0xFF); // Version
mySerial.write(0x06); // Length
mySerial.write(0x09); // Command: Select device
mySerial.write(0x00); // Feedback
mySerial.write(0x02); // Parameter: TF card
mySerial.write(0xFE); // Checksum high byte
mySerial.write(0xED); // Checksum low byte
mySerial.write(0xEF); // End byte
Serial.println("DFPlayer Mini initialized.");
}
void loop() {
// Example: Play the first track
mySerial.write(0x7E); // Start byte
mySerial.write(0xFF); // Version
mySerial.write(0x06); // Length
mySerial.write(0x03); // Command: Play track
mySerial.write(0x00); // Feedback
mySerial.write(0x00); // Parameter high byte
mySerial.write(0x01); // Parameter low byte (track number)
mySerial.write(0xFE); // Checksum high byte
mySerial.write(0xF7); // Checksum low byte
mySerial.write(0xEF); // End byte
delay(5000); // Wait for 5 seconds before repeating
}
No Sound Output:
Module Not Responding:
Playback Stops Unexpectedly:
Noise or Distortion in Audio:
Q: Can I use the DFPlayer Mini without a microcontroller?
A: Yes, the module supports standalone operation using AD key or GPIO control.
Q: What is the maximum speaker power supported?
A: The built-in amplifier supports up to 3W for an 8Ω speaker.
Q: How many tracks can the module handle?
A: The DFPlayer Mini can handle up to 3000 audio files stored in the root directory or folders.
Q: Can I adjust the volume programmatically?
A: Yes, volume can be controlled via UART commands or AD key inputs.