The DFPlayer Pro, manufactured by DFRobot, is a compact and versatile MP3 player module designed for audio playback applications. It supports audio files stored on a micro SD card and features a built-in amplifier for direct speaker output. The module is compatible with various audio formats, such as MP3, WAV, and WMA, and can be easily controlled via serial communication, making it an excellent choice for projects involving microcontrollers like Arduino.
Below are the key technical details of the DFPlayer Pro:
Parameter | Specification |
---|---|
Operating Voltage | 3.3V - 5.0V |
Operating Current | 20mA (idle), up to 200mA (playback) |
Audio Formats Supported | MP3, WAV, WMA |
Storage Media | Micro SD card (up to 32GB) |
Communication Interface | UART (Serial) |
Built-in Amplifier | Yes (3W for 4Ω speakers) |
Output Modes | Speaker output, headphone output |
Dimensions | 22mm x 22mm |
The DFPlayer Pro has a total of 16 pins. Below is the pinout and description:
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply input (3.3V - 5.0V) |
2 | GND | Ground connection |
3 | RX | UART receive pin (connect to microcontroller TX) |
4 | TX | UART transmit pin (connect to microcontroller RX) |
5 | SPK_1 | Speaker output (positive terminal) |
6 | SPK_2 | Speaker output (negative terminal) |
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 | BUSY | Indicates playback status (LOW = playing, HIGH = idle) |
10 | IO_1 | General-purpose input/output pin |
11 | IO_2 | General-purpose input/output pin |
12 | ADKEY1 | Analog input for key control (e.g., buttons) |
13 | ADKEY2 | Analog input for key control (e.g., buttons) |
14 | USB+ | USB data positive (for USB communication) |
15 | USB- | USB data negative (for USB communication) |
16 | RESET | Reset pin (active LOW) |
Below is an example of how to control the DFPlayer Pro 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); // Wait for the DFPlayer Pro to initialize
// Send initialization command to DFPlayer Pro
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
Serial.println("DFPlayer Pro initialized.");
}
void loop() {
// Example: Play the first audio file
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 1: High byte of track number
mySerial.write(0x01); // Parameter 2: Low byte of 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:
Q1: Can I use the DFPlayer Pro without a microcontroller?
A1: Yes, the DFPlayer Pro can be controlled using buttons connected to the ADKEY1 and ADKEY2 pins.
Q2: What is the maximum speaker power supported?
A2: The built-in amplifier supports up to 3W for 4Ω speakers.
Q3: How do I adjust the volume?
A3: Volume can be adjusted via UART commands or by using external buttons connected to the ADKEY pins.
Q4: Can I use a USB drive instead of a micro SD card?
A4: Yes, the DFPlayer Pro supports USB drives via the USB+ and USB- pins.