

The DFPlayer Mini, manufactured by DFRobot, is a compact and cost-effective MP3 player module designed for embedded systems. It allows users to play audio files stored on a micro SD card with minimal external components. The module supports serial communication, making it easy to integrate into microcontroller-based projects. Its small size and versatile functionality make it ideal for applications requiring audio playback.








The DFPlayer Mini is packed with features that make it a versatile audio playback module. Below are its key technical specifications:
| Parameter | Specification |
|---|---|
| Operating Voltage | 3.2V - 5.0V |
| Operating Current | 20mA - 30mA (idle), up to 100mA (playback) |
| Audio Formats Supported | MP3, WAV, WMA |
| Storage Media | Micro SD card (up to 32GB, FAT16/FAT32 format) |
| Communication Interface | UART (9600 bps default, adjustable) |
| Output Modes | DAC (stereo), Speaker (mono, 3W max) |
| Dimensions | 22mm x 30mm x 11mm |
The DFPlayer Mini has 16 pins, but only a subset is typically used in most applications. Below is the pin configuration:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (3.2V - 5.0V). |
| 2 | RX | UART receive pin for serial communication. |
| 3 | TX | UART transmit pin for serial communication. |
| 4 | DAC_R | Right channel audio output (for external amplifier or headphones). |
| 5 | DAC_L | Left channel audio output (for external amplifier or headphones). |
| 6 | SPK_1 | Speaker output 1 (connect directly to a speaker). |
| 7 | SPK_2 | Speaker output 2 (connect directly to a speaker). |
| 8 | GND | Ground connection. |
| 9-16 | Reserved | Not commonly used in basic applications. |
The DFPlayer Mini is straightforward to use and can be controlled via UART commands. Below are the steps to integrate it into a circuit and use it effectively:
VCC pin to a 3.3V or 5V power source and the GND pin to ground.RX pin to the TX pin of your microcontroller and the TX pin to the RX pin of your microcontroller.DAC_L and DAC_R pins.SPK_1 and SPK_2 pins.0001.mp3, 0002.mp3).VCC and GND to stabilize the power supply.Below is an example of how to 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 bps
Serial.begin(9600); // Initialize hardware Serial for debugging
delay(1000); // Allow the DFPlayer Mini to initialize
// Send initialization command to DFPlayer Mini
sendCommand(0x3F, 0, 0); // Query the module's status
Serial.println("DFPlayer Mini initialized.");
}
void loop() {
// Example: Play the first track
sendCommand(0x03, 0, 1); // Play track 1
delay(5000); // Wait for 5 seconds
// Example: Pause playback
sendCommand(0x0E, 0, 0); // Pause playback
delay(2000); // Wait for 2 seconds
// Example: Resume playback
sendCommand(0x0D, 0, 0); // Resume playback
delay(5000); // Wait for 5 seconds
}
// Function to send commands to the DFPlayer Mini
void sendCommand(uint8_t command, uint16_t parameter1, uint16_t parameter2) {
uint8_t commandBuffer[10] = {0x7E, 0xFF, 0x06, command, 0x00,
(uint8_t)(parameter1 >> 8), (uint8_t)(parameter1),
(uint8_t)(parameter2 >> 8), (uint8_t)(parameter2),
0xEF};
for (uint8_t i = 0; i < 10; i++) {
mySerial.write(commandBuffer[i]); // Send each byte of the command
}
}
sendCommand function sends UART commands to the DFPlayer Mini. Each command consists of 10 bytes.10 and 11 in SoftwareSerial with the pins you are using for RX and TX on your Arduino UNO.No Sound Output:
Module Not Responding:
RX and TX pins are correctly connected to the microcontroller.Distorted Audio:
Q: Can I use the DFPlayer Mini without a microcontroller?
A: Yes, the module can operate in standalone mode by connecting buttons to specific pins for basic playback control.
Q: What is the maximum storage capacity supported?
A: The DFPlayer Mini supports micro SD cards up to 32GB formatted in FAT16 or FAT32.
Q: Can I adjust the volume programmatically?
A: Yes, you can use the volume control command via UART to set the volume level (0-30).
By following this documentation, you can effectively integrate the DFPlayer Mini into your projects and troubleshoot common issues.