The DFPlayer Mini (Manufacturer Part ID: DFR0299) is a compact and cost-effective MP3 player module designed by Arduino. It is capable of playing audio files directly from a micro SD card and can be controlled via serial communication. This module is widely used in DIY electronics projects for sound playback, such as voice prompts, sound effects, or background music in interactive systems.
The DFPlayer Mini is designed to be simple yet powerful, with the following key specifications:
Parameter | Value |
---|---|
Operating Voltage | 3.2V to 5.0V |
Operating Current | 20mA to 30mA (idle), up to 100mA (during playback) |
Audio Output | 3W (mono) via speaker output, or stereo via headphone output |
Supported File Formats | MP3, WAV, WMA |
Storage Medium | Micro SD card (up to 32GB, FAT16/FAT32 file system) |
Communication Protocol | UART (Serial) |
Baud Rate | Default: 9600 bps |
Dimensions | 22mm x 20mm x 3.2mm |
The DFPlayer Mini has 16 pins, but only a subset is commonly used in most applications. Below is the pinout and description:
Pin Name | Pin Number | Description |
---|---|---|
VCC | 1 | Power supply input (3.2V to 5.0V). |
GND | 2 | Ground connection. |
RX | 3 | Serial data input (connect to TX of microcontroller). |
TX | 4 | Serial data output (connect to RX of microcontroller). |
SPK_1 | 5 | Speaker output (positive terminal). |
SPK_2 | 6 | Speaker output (negative terminal). |
DAC_R | 7 | Right channel audio output (for headphones or external amplifier). |
DAC_L | 8 | Left channel audio output (for headphones or external amplifier). |
ADKEY1 | 9 | Key input for controlling playback (optional). |
IO1 | 10 | General-purpose input/output pin (optional). |
The DFPlayer Mini is easy to integrate into a circuit and can be controlled using a microcontroller like the Arduino UNO. Below are the steps to use the module:
Connect the DFPlayer Mini to an Arduino UNO as follows:
mp3
or advert
(optional).0001.mp3
, 0002.mp3
, etc.Below is an example Arduino sketch to control the DFPlayer Mini using the SoftwareSerial library:
#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...");
delay(1000);
// 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: TF card
mySerial.write(0xFE); // Checksum high byte
mySerial.write(0xED); // Checksum low byte
mySerial.write(0xEF); // End byte
Serial.println("DFPlayer Mini initialized.");
}
void loop() {
// Example: Play the first audio file (0001.mp3)
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
}
No sound output:
Module not responding to commands:
Distorted or low audio quality:
Micro SD card not detected:
Can I use the DFPlayer Mini without a microcontroller?
Yes, the module can be controlled using physical buttons connected to the ADKEY1 pin.
What is the maximum speaker output power?
The module supports up to 3W output for a mono speaker.
Can I use a larger micro SD card?
No, the module supports cards up to 32GB formatted as FAT16 or FAT32.
Is stereo output supported?
Yes, stereo output is available via the DAC_L and DAC_R pins for headphones or an external amplifier.