The DF Player Mini is a compact MP3 player module designed to play audio files directly from a micro SD card or USB drive. It is widely used in DIY audio projects due to its small size, affordability, and ease of integration. The module supports serial communication, making it compatible with microcontrollers like Arduino for precise control over playback functions such as play, pause, stop, and volume adjustment.
The DF Player Mini is a versatile module with the following key specifications:
Parameter | Value |
---|---|
Operating Voltage | 3.2V to 5.0V |
Operating Current | 20mA to 30mA (idle), up to 100mA (playback) |
Audio Output | 3W (speaker output) or stereo via AUX |
Supported File Formats | MP3, WAV, WMA |
Storage Support | Micro SD card (up to 32GB), USB drive |
Communication Protocol | UART (9600 bps default) |
Dimensions | 22mm x 20mm x 16mm |
The DF Player Mini has 16 pins, but only a subset is commonly used in most applications. Below is the pinout and description:
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply input (3.2V to 5.0V). |
2 | GND | Ground connection. |
3 | RX | UART receive pin for serial communication. |
4 | TX | UART transmit pin for serial communication. |
5 | SPK_1 | Speaker output (positive terminal). |
6 | SPK_2 | Speaker output (negative terminal). |
7 | DAC_R | Right channel audio output (for AUX connection). |
8 | DAC_L | Left channel audio output (for AUX connection). |
9-16 | Other Pins | Reserved for advanced features (e.g., IO control, ADKEY, BUSY signal, etc.). |
0001.mp3
, 0002.mp3
, etc., for proper indexing.Below is an example of how to control the DF Player Mini using an Arduino UNO:
#include "SoftwareSerial.h"
// Define RX and TX pins for communication with DF Player Mini
SoftwareSerial mySerial(10, 11); // RX = Pin 10, TX = Pin 11
void setup() {
mySerial.begin(9600); // Initialize software serial at 9600 bps
Serial.begin(9600); // Initialize hardware serial for debugging
Serial.println("Initializing DF Player Mini...");
delay(1000);
// Send initialization command to DF Player 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: TF card
mySerial.write(0xFE); // Checksum high byte
mySerial.write(0xED); // Checksum low byte
mySerial.write(0xEF); // End byte
Serial.println("DF Player Mini initialized.");
}
void loop() {
// Example: Play the first track
Serial.println("Playing track 1...");
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
}
SoftwareSerial
library to communicate with the DF Player Mini.10
and 11
with the appropriate pins on your Arduino if needed.No Sound Output:
Module Not Responding:
Distorted Audio:
Playback Stops Unexpectedly:
Q: Can I use the DF Player Mini without a microcontroller?
A: Yes, the module can operate in standalone mode using buttons connected to its IO pins.
Q: What is the maximum storage capacity supported?
A: The DF Player Mini supports micro SD cards and USB drives up to 32GB.
Q: Can I adjust the volume programmatically?
A: Yes, volume can be adjusted via UART commands or by using the ADKEY pins.
Q: Does the module support stereo output?
A: Yes, stereo output is available via the DAC_R and DAC_L pins for AUX connections.