

The DFPlayer is a compact and affordable MP3 player module designed for embedded systems and DIY projects requiring audio playback. It supports audio files stored on a microSD card and can be controlled via simple serial communication. The module features a built-in amplifier, making it suitable for directly driving small speakers or headphones. Its versatility and ease of use make it a popular choice for applications such as interactive displays, talking devices, and audio-enabled IoT projects.








| Parameter | Value |
|---|---|
| Operating Voltage | 3.2V - 5.0V |
| Operating Current | 20mA - 30mA (idle), up to 100mA (playback) |
| Audio Output | 3W (mono) via built-in amplifier |
| Storage Support | microSD card (up to 32GB, FAT16/FAT32) |
| Audio Formats Supported | MP3, WAV, WMA |
| Communication Interface | UART (9600 bps default) |
| Dimensions | 22mm x 30mm x 11mm |
| Pin Name | Pin Number | Description |
|---|---|---|
| VCC | 1 | Power supply input (3.2V - 5.0V) |
| GND | 2 | Ground |
| RX | 3 | UART receive pin (connect to TX of MCU) |
| TX | 4 | UART transmit pin (connect to RX of MCU) |
| SPK_1 | 5 | Speaker output (positive terminal) |
| SPK_2 | 6 | Speaker output (negative terminal) |
| DAC_R | 7 | Right channel audio output (line out) |
| DAC_L | 8 | Left channel audio output (line out) |
| ADKEY_1 | 9 | Key input for external control (optional) |
| ADKEY_2 | 10 | Key input for external control (optional) |
Below is an example of how to control the DFPlayer 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 DFPlayer communication at 9600 bps
Serial.begin(9600); // Initialize Serial Monitor for debugging
delay(1000); // Allow time for DFPlayer to initialize
// Send initialization command to DFPlayer
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
delay(500); // Wait for the command to take effect
}
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:
Distorted Audio:
Q: Can the DFPlayer play audio files from a USB drive?
A: No, the DFPlayer only supports microSD cards formatted as FAT16 or FAT32.
Q: How many audio files can the DFPlayer handle?
A: The DFPlayer can handle up to 3000 audio files stored in the root directory or subfolders.
Q: Can I control the DFPlayer without a microcontroller?
A: Yes, the DFPlayer can be controlled using external buttons connected to the ADKEY pins.
Q: What is the maximum speaker power supported?
A: The built-in amplifier supports up to 3W output for a 4Ω speaker.