

The DFPlayer Mini (Manufacturer: LOA, Part ID: Mini) is a compact and cost-effective MP3 player module designed for embedded systems. It can play audio files directly from a micro SD card and is controlled via serial communication. This module is widely used in projects requiring audio playback, such as interactive displays, voice alerts, and IoT devices.








The DFPlayer Mini has 16 pins, but only a subset is commonly used in most applications. Below is the pinout:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (3.2V to 5.0V DC). |
| 2 | GND | Ground connection. |
| 3 | RX | UART serial data input (connect to microcontroller TX pin). |
| 4 | TX | UART serial data output (connect to microcontroller RX pin). |
| 5 | SPK_1 | Positive terminal for mono speaker output. |
| 6 | SPK_2 | Negative terminal for mono speaker output. |
| 7 | DAC_R | Right channel audio output (for external amplifier or headphones). |
| 8 | DAC_L | Left channel audio output (for external amplifier or headphones). |
| 9 | ADKEY1 | Analog input for AD key control (optional). |
| 10 | IO_1 | General-purpose input/output pin (optional). |
| 11 | IO_2 | General-purpose input/output pin (optional). |
| 12 | BUSY | Output pin that indicates playback status (LOW = playing, HIGH = idle). |
| 13-16 | NC | Not connected (reserved for internal use). |
0001.mp3, 0002.mp3, etc.Below is an example of how to connect and 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 hardware serial for debugging
delay(1000); // Allow time for DFPlayer Mini to initialize
sendCommand(0x3F, 0, 0); // Send initialization command
Serial.println("DFPlayer Mini initialized.");
}
void loop() {
playTrack(1); // Play the first track (0001.mp3)
delay(5000); // Wait for 5 seconds
stopPlayback(); // Stop playback
delay(2000); // Wait for 2 seconds
}
// Function to send a command to the DFPlayer Mini
void sendCommand(uint8_t command, uint16_t param1, uint16_t param2) {
uint8_t packet[10] = {0x7E, 0xFF, 0x06, command, 0x00,
(uint8_t)(param1 >> 8), (uint8_t)param1,
(uint8_t)(param2 >> 8), (uint8_t)param2, 0xEF};
for (uint8_t i = 0; i < 10; i++) {
mySerial.write(packet[i]);
}
}
// Function to play a specific track
void playTrack(uint16_t trackNumber) {
sendCommand(0x03, 0, trackNumber); // Command 0x03: Play track
Serial.print("Playing track: ");
Serial.println(trackNumber);
}
// Function to stop playback
void stopPlayback() {
sendCommand(0x16, 0, 0); // Command 0x16: Stop playback
Serial.println("Playback stopped.");
}
No Sound Output:
Module Not Responding:
Distorted Audio:
Q: Can I use a 3.3V microcontroller with the DFPlayer Mini?
A: Yes, but use a logic level shifter for the RX pin to avoid damaging the module.
Q: How many audio files can the DFPlayer Mini handle?
A: The module supports up to 3000 audio files, provided they are named sequentially (e.g., 0001.mp3, 0002.mp3).
Q: Can I control the volume?
A: Yes, you can adjust the volume using serial commands (range: 0-30).
Q: Does the DFPlayer Mini support stereo output?
A: Yes, stereo output is available via the DAC_R and DAC_L pins for external amplifiers or headphones.