How-to · Beginner · 4 min read
DFPlayer Mini MP3 Module
Wiring, SD Card Setup and Arduino Code
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
The DFPlayer Mini plays MP3 and WAV files from a microSD card and has a built-in 3 W amplifier, so it can drive a small speaker on its own. Power it from 5 V, connect its RX through a 1 kΩ resistor to a serial TX pin and its TX to a serial RX pin, put files named 0001.mp3, 0002.mp3 in an mp3 folder, and control it with the DFRobotDFPlayerMini library.
Key specs at a glance
- Supply
- 3.2 to 5 V (5 V typical)
- Card
- microSD up to 32 GB, FAT16 or FAT32
- Formats
- MP3, WAV, WMA
- Speaker output
- About 3 W mono into 4 to 8 Ω (SPK_1, SPK_2)
- Line output
- DAC_L and DAC_R for an external amplifier
- Control
- Serial at 9600 baud, buttons (ADKEY) or IO pins
- Volume
- 0 to 30
DFPlayer Mini pinout and wiring
| Pin | Function | Arduino Uno wiring |
|---|---|---|
| VCC | 3.2 to 5 V | 5V |
| GND | Ground (two pins) | GND |
| RX | Serial in (3.3 V logic) | D11 via a 1 kΩ resistor |
| TX | Serial out | D10 |
| SPK_1, SPK_2 | Speaker, up to 3 W | Small 4 or 8 Ω speaker; never to ground |
| DAC_L, DAC_R | Line out | To an amplifier such as the PAM8403 |
| BUSY | LOW while playing | Optional, to any input pin |
| IO1, IO2, ADKEY1, ADKEY2 | Button control | Optional standalone use |
- VCC
- Function:
- 3.2 to 5 V
- Arduino Uno wiring:
- 5V
- GND
- Function:
- Ground (two pins)
- Arduino Uno wiring:
- GND
- RX
- Function:
- Serial in (3.3 V logic)
- Arduino Uno wiring:
- D11 via a 1 kΩ resistor
- TX
- Function:
- Serial out
- Arduino Uno wiring:
- D10
- SPK_1, SPK_2
- Function:
- Speaker, up to 3 W
- Arduino Uno wiring:
- Small 4 or 8 Ω speaker; never to ground
- DAC_L, DAC_R
- Function:
- Line out
- Arduino Uno wiring:
- To an amplifier such as the PAM8403
- BUSY
- Function:
- LOW while playing
- Arduino Uno wiring:
- Optional, to any input pin
- IO1, IO2, ADKEY1, ADKEY2
- Function:
- Button control
- Arduino Uno wiring:
- Optional standalone use
Preparing the SD card
Format the card as FAT32 (or FAT16) and copy files in this order. The simplest layout for the library's play-by-number functions is:
/mp3/0001.mp3,/mp3/0002.mp3... forplayMp3Folder(1)./01/001.mp3,/01/002.mp3,/02/001.mp3... forplayFolder(folder, track).- Files in the root are played by the order they were copied, not by their names, which confuses many beginners. Copy one file at a time in the order you want, or use the numbered folders.
You can add text after the number (for example 0001_welcome.mp3). Remove hidden files that some computers add, such as the System Volume Information or ._ files on a Mac, if tracks play out of order.
Arduino code: play a track
Install the DFRobotDFPlayerMini library from the Library Manager.
#include <SoftwareSerial.h>
#include <DFRobotDFPlayerMini.h>
SoftwareSerial dfSerial(10, 11); // RX, TX (TX goes through 1k to DFPlayer RX)
DFRobotDFPlayerMini player;
void setup() {
Serial.begin(115200);
dfSerial.begin(9600);
delay(1500); // give the module time to read the card
if (!player.begin(dfSerial)) {
Serial.println("DFPlayer not found: check wiring and SD card");
while (true) {}
}
player.volume(20); // 0 to 30
player.playMp3Folder(1); // plays /mp3/0001.mp3
}
void loop() {
if (player.available() && player.readType() == DFPlayerPlayFinished) {
Serial.println("Track finished");
}
}Using it with ESP32 or Pico
On an ESP32, use a hardware serial port instead of SoftwareSerial: Serial2.begin(9600, SERIAL_8N1, 16, 17); then player.begin(Serial2). On a Pico, use Serial1 (GP0 TX, GP1 RX by default). Both boards use 3.3 V logic, which the DFPlayer accepts directly; keep the 1 kΩ resistor anyway, as it reduces the clicking noise caused by serial traffic. Power the DFPlayer from 5 V, not from the 3.3 V pin, as playback at volume draws a few hundred milliamps. See the UART guide for wiring rules.
Fixing noise, clicks and 'not found'
RX and TX swapped, no common ground, card not FAT32, or the code starts before the module is ready (add a 1 to 2 s delay).
use the 1 kΩ resistor on RX, power from a separate 5 V supply, and add a 100 to 470 µF capacitor across VCC and GND.
use numbered folders, or re-copy root files in order.
some boards use a different decoder chip and need a longer start-up delay or player.begin(serial, true, false) to skip the acknowledgement check.
the built-in amplifier is only about 3 W; for louder sound use the DAC pins into a PAM8403.
Play an MP3 from Arduino with a DFPlayer Mini
You need: Arduino Uno, DFPlayer Mini, microSD card (32 GB or less), 1 kΩ resistor, 4 or 8 Ω speaker, Jumper wires · Tools: Computer with Arduino IDE, microSD card reader
Get the parts6 of 6 found in our store · ₹744
Arduino UnoArduino Uno R3 Development Board with USB Cable₹385
DFPlayer MiniDFPlayer Mini MP3 Player Module (MP3-TF-16P)₹94
microSD card (32 GB or less)MicroSD Card Module (SPI)₹45Closest match, check the specs
1 kΩ resistorCarbon Film Resistor 1/2W, 1W and 2W₹3
4 or 8 Ω speakerMini Speaker 8Ω₹42
Jumper wiresDupont Jumper Wires (40 pcs)₹49
- 1Prepare the cardFormat the card as FAT32 and copy your file to /mp3/0001.mp3.
- 2Wire powerConnect VCC to 5V and GND to GND.
- 3Wire serialConnect DFPlayer TX to D10, and D11 through a 1 kΩ resistor to DFPlayer RX.
- 4Connect the speakerWire the speaker across SPK_1 and SPK_2.
- 5Upload and playInstall the DFRobotDFPlayerMini library, upload the sketch and the track plays at start-up.
Common mistakes to avoid
- Connecting a speaker pin to ground.
- Expecting files in the root to play in name order.
- Using an exFAT-formatted card larger than 32 GB.
- Leaving out the 1 kΩ resistor and getting clicks.
- Powering it from a 3.3 V pin that cannot supply the current.
Frequently asked questions
What SD card does the DFPlayer Mini support?
microSD cards up to 32 GB formatted as FAT16 or FAT32. Larger cards formatted as exFAT will not be read.
Does the DFPlayer Mini need an amplifier?
Not for a small speaker: it has a built-in amplifier of about 3 W. For more volume or stereo, take the DAC_L and DAC_R outputs to an amplifier module.
Why does my DFPlayer play the wrong track?
Files in the root folder play in the order they were copied to the card, not by name. Use the mp3 folder with 0001.mp3-style names, or numbered folders.
Can I use DFPlayer Mini with ESP32?
Yes. Use a hardware serial port such as Serial2 at 9600 baud. The DFPlayer accepts 3.3 V logic.
Why do I hear clicking from the DFPlayer?
Serial traffic and supply noise. Add a 1 kΩ resistor in series with its RX pin, use a separate 5 V supply and a capacitor across the power pins.
Parts for this guide
Terms in this guide
Projects that use it
Put this into practice: 413 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
- DFRobot DFPlayer Mini product wiki and manual
- DFRobotDFPlayerMini library documentation
- YX5200 MP3 decoder datasheet
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.


