

The 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 ideal 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 standalone operation.








The DFPlayer Mini has 16 pins, but not all are required for basic operation. Below is a table of the most commonly used pins:
| Pin Name | Description |
|---|---|
| VCC | Power supply input (3.2V to 5.0V DC). |
| GND | Ground connection. |
| RX | UART receive pin for serial communication. Connect to the TX pin of a microcontroller. |
| TX | UART transmit pin for serial communication. Connect to the RX pin of a microcontroller. |
| SPK_1 | Positive terminal for speaker output (built-in amplifier). |
| SPK_2 | Negative terminal for speaker output (built-in amplifier). |
| DAC_R | Right channel audio output (for external amplifier or headphones). |
| DAC_L | Left channel audio output (for external amplifier or headphones). |
| ADKEY_1 | Input for AD key control (resistor-based button control). |
| ADKEY_2 | Additional input for AD key control. |
| BUSY | Output pin that indicates playback status (LOW = playing, HIGH = idle). |
Power Supply:
Speaker Connection:
Microcontroller Interface:
Micro SD Card Preparation:
Serial Communication:
Below is an example of how to use the DFPlayer Mini with an Arduino UNO to play an audio file:
#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 hardware serial for debugging
Serial.println("Initializing DFPlayer Mini...");
// 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 1: SD card
mySerial.write(0x00); // Parameter 2
mySerial.write(0xFE); // Checksum (high byte)
mySerial.write(0xED); // Checksum (low byte)
mySerial.write(0xEF); // End byte
delay(1000); // Wait for initialization
Serial.println("DFPlayer Mini ready.");
// Play the first audio file (0001.mp3)
playTrack(1);
}
void loop() {
// Add your code here to control playback
}
// Function to play a specific track
void playTrack(int trackNumber) {
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((trackNumber >> 8) & 0xFF); // High byte of track number
mySerial.write(trackNumber & 0xFF); // Low byte of track number
mySerial.write(0xFE - ((0x03 + ((trackNumber >> 8) & 0xFF) +
(trackNumber & 0xFF)) & 0xFF)); // Checksum (high byte)
mySerial.write(0xEF); // End byte
}
No Sound Output:
Playback Stutters or Noise:
Module Not Responding to Commands:
Files Not Playing in Order:
Can I use the DFPlayer Mini without a microcontroller? Yes, the module supports standalone mode using AD key control or predefined playback sequences.
What is the maximum speaker power supported? The built-in amplifier supports up to 3W speakers. For higher power, use an external amplifier.
Can I adjust the volume programmatically? Yes, volume can be adjusted using UART commands or the DFPlayer Mini library for Arduino.