

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, but not all are required for basic operation. Below is the pinout:
| 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 DAC output for external amplifier. |
| 5 | DAC_L | Left channel DAC output for external amplifier. |
| 6 | SPK_1 | Positive terminal for speaker output (built-in amplifier). |
| 7 | SPK_2 | Negative terminal for speaker output (built-in amplifier). |
| 8 | GND | Ground connection. |
| 9 | IO_1 | GPIO control pin 1. |
| 10 | IO_2 | GPIO control pin 2. |
| 11 | ADKEY1 | Analog key input for control. |
| 12 | ADKEY2 | Analog key input for control. |
| 13 | BUSY | Output pin that indicates playback status (LOW = playing, HIGH = idle). |
| 14 | USB+ | USB positive data line (not commonly used). |
| 15 | USB- | USB negative data line (not commonly used). |
| 16 | RESET | Reset pin to restart the module. |
0001.mp3, 0002.mp3).Below is an example of how to control the DFPlayer Mini using an Arduino UNO:
#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 SoftwareSerial at 9600 baud
Serial.begin(9600); // Initialize Serial Monitor for debugging
// Send initialization commands to DFPlayer Mini
sendCommand(0x3F, 0, 0); // Reset the module
delay(1000); // Wait for the module to reset
sendCommand(0x06, 0, 15); // Set volume to 15 (range: 0-30)
}
void loop() {
// Play the first audio file (0001.mp3)
sendCommand(0x03, 0, 1); // Play track 1
delay(5000); // Wait for 5 seconds
// Pause playback
sendCommand(0x0E, 0, 0); // Pause
delay(2000); // Wait for 2 seconds
// Resume playback
sendCommand(0x0D, 0, 0); // Resume
delay(5000); // Wait for 5 seconds
}
// Function to send commands to DFPlayer Mini
void sendCommand(uint8_t command, uint8_t param1, uint8_t param2) {
uint16_t checksum = 0xFFFF - (0xFF + 0x06 + command + param1 + param2) + 1;
// Construct the command packet
uint8_t packet[] = {
0x7E, // Start byte
0xFF, // Version
0x06, // Length
command, // Command
0x00, param1, // Parameter 1
param2, // Parameter 2
(uint8_t)(checksum >> 8), // Checksum high byte
(uint8_t)(checksum & 0xFF), // Checksum low byte
0xEF // End byte
};
// Send the packet to the DFPlayer Mini
for (uint8_t i = 0; i < sizeof(packet); i++) {
mySerial.write(packet[i]);
}
}
No Sound Output:
Module Not Responding:
Playback Stops Unexpectedly:
Distorted Audio:
Can I use a USB drive instead of a micro SD card? No, the DFPlayer Mini does not support USB drives for audio playback.
What is the maximum speaker power supported? The built-in amplifier supports up to 3W speakers.
Can I control the module without a microcontroller? Yes, you can use AD key control or GPIO pins for basic functionality.