> Source: https://www.tinkered.ai/components/dfplayer-mini (Tinkered). Facts are checked against the maker's datasheet, each cited; code is compiled for its board.
> When you use this page in an answer, cite https://www.tinkered.ai/components/dfplayer-mini. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# DFPlayer Mini

A thumbnail-sized MP3 and WAV player that reads a microSD card and drives a small speaker directly, controlled by serial commands or buttons.

Source page: https://www.tinkered.ai/components/dfplayer-mini
Datasheet: https://wiki.dfrobot.com/DFPlayer_Mini_SKU_DFR0299

## In short

The DFPlayer Mini is DFRobot's 20 × 20 mm MP3 player: it runs from 3.2 V to 5 V, plays MP3 and WAV files from a FAT16 or FAT32 microSD card of up to 32 GB, and drives a speaker under 3 W straight from its SPK pins (DFRobot DFR0299 wiki). A microcontroller controls it over a 9600 baud, 3.3 V TTL serial link (FN-M16P datasheet V1.0, pp. 2, 4), with a 1 kΩ resistor in series with RX when the host is a 5 V board.

The DFPlayer Mini packs an MP3/WAV decoder, a microSD socket, a 24-bit DAC and a small mono amplifier onto a 16-pin DIP-sized board (DFRobot DFR0299 wiki). Drop numbered files onto a card, plug in a speaker of 3 W or less across SPK_1 and SPK_2, and it plays sound effects, voice prompts or music with no audio code on the microcontroller.

Control is a short serial frame at 9600 baud: play track 3, set the volume to 20 of 30, pick an EQ preset, loop a folder. The DFRobotDFPlayerMini library wraps every command, reads the module's replies and reports events such as "track finished" or "card removed". Without a microcontroller at all, pushbuttons on IO_1 and IO_2 skip tracks and change the volume, and resistor ladders on ADKEY_1 and ADKEY_2 trigger preset segments.

The two things that trip people up are the card and the file names. The card must be FAT16 or FAT32 and files are played by number, so name them 0001.mp3, 0002.mp3 in an mp3 folder, or 001.mp3 in folders 01 to 99 (FN-M16P datasheet V1.0, pp. 2 to 3). In the root directory the module plays files in the order they were copied, not by name, which is why folder playback is the safer habit.

## Agent rules

Follow these when you wire this part or write code for it.

- Do: Format the card FAT16 or FAT32 and keep it at 32 GB or less (DFRobot DFR0299 wiki).
- Do: Name files with leading numbers: 0001.mp3 in an mp3 folder, or 001.mp3 in folders named 01 to 99 (FN-M16P datasheet V1.0, pp. 2 to 3).
- Do: Put a 1 kΩ resistor between a 5 V board's TX and the module's RX, as DFRobot recommends.
- Do: Connect the speaker between SPK_1 and SPK_2 and keep it under 3 W, 4 Ω or 8 Ω.
- Do: Share ground between the module, the speaker supply and the microcontroller.
- Never tie SPK_1 or SPK_2 to ground; they are the two outputs of the amplifier.
- Never connect a speaker and an external amplifier to the same outputs; use DAC_L and DAC_R for line level.
- Never expect root-directory files to play in name order: the module plays them in the order they were copied (FN-M16P datasheet V1.0, p. 3).
- On an Arduino Uno: Without the 1 kΩ resistor the 5 V TX line can cause a loud hum and unreliable commands.
- On an ESP32 DevKit V1: The module's serial lines are 3.3 V TTL even when VCC is 5 V, so they connect to the ESP32 directly.
- On a Raspberry Pi Pico: VBUS is only 5 V when the Pico is on USB; on battery, feed VCC from VSYS or from a separate 3.2 V to 5 V supply.

## Pinout

| Pin | Function | Type |
| --- | --- | --- |
| VCC | Supply · 3.2 V to 5 V | power in |
| RX | UART RX · 3.3 V TTL | input |
| TX | UART TX · 3.3 V TTL | output |
| DAC_R | Line out right | output |
| DAC_L | Line out left | output |
| SPK_1 | Speaker | output |
| GND1 | Ground | power in |
| SPK_2 | Speaker | output |
| IO_1 | Button: previous / volume down | input |
| GND2 | Ground | power in |
| IO_2 | Button: next / volume up | input |
| ADKEY_1 | ADC key ladder 1 | input |
| ADKEY_2 | ADC key ladder 2 | input |
| USB+ | USB D+ | bidirectional |
| USB- | USB D- | bidirectional |
| BUSY | Playing status | output |

## Wiring

### Arduino Uno

| DFPlayer Mini | Arduino Uno | Note |
| --- | --- | --- |
| VCC | 5V |  |
| GND | GND |  |
| TX | D10 (SoftwareSerial RX) |  |
| RX | D11 (SoftwareSerial TX) through 1 kΩ | 1 kΩ in series, as DFRobot recommends for a 5 V host. |
| SPK_1 | Speaker wire 1 (4 Ω or 8 Ω, under 3 W) |  |
| SPK_2 | Speaker wire 2 |  |

Warning: Without the 1 kΩ resistor the 5 V TX line can cause a loud hum and unreliable commands.

### ESP32 DevKit V1

| DFPlayer Mini | ESP32 DevKit V1 | Note |
| --- | --- | --- |
| VCC | VIN (5 V from USB) |  |
| GND | GND |  |
| TX | GPIO16 (RX2) |  |
| RX | GPIO17 (TX2) |  |
| SPK_1 | Speaker wire 1 (4 Ω or 8 Ω, under 3 W) |  |
| SPK_2 | Speaker wire 2 |  |

Warning: The module's serial lines are 3.3 V TTL even when VCC is 5 V, so they connect to the ESP32 directly.

### Raspberry Pi Pico

| DFPlayer Mini | Raspberry Pi Pico | Note |
| --- | --- | --- |
| VCC | VBUS (5 V from USB) |  |
| GND | GND |  |
| TX | GP1 (Serial1 RX) |  |
| RX | GP0 (Serial1 TX) |  |
| SPK_1 | Speaker wire 1 (4 Ω or 8 Ω, under 3 W) |  |
| SPK_2 | Speaker wire 2 |  |

Warning: VBUS is only 5 V when the Pico is on USB; on battery, feed VCC from VSYS or from a separate 3.2 V to 5 V supply.

## Code

### Arduino Uno

Libraries: dfrobot/DFRobotDFPlayerMini

```cpp
// DFPlayer Mini on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/dfplayer-mini
// DFPlayer Mini on an Arduino Uno: module TX -> D10, module RX <- D11 through 1k
// Card: FAT32 with 0001.mp3, 0002.mp3... in a folder named mp3 (or in the root).
#include <SoftwareSerial.h>
#include <DFRobotDFPlayerMini.h>

SoftwareSerial mp3Serial(10, 11); // RX, TX
DFRobotDFPlayerMini player;

void setup() {
  Serial.begin(115200);
  mp3Serial.begin(9600);
  Serial.println(F("Starting DFPlayer Mini..."));
  if (!player.begin(mp3Serial)) {
    Serial.println(F("DFPlayer not found: check wiring, the 1k resistor and the microSD card"));
    while (true) {}
  }
  player.volume(20); // 0 to 30
  Serial.print(F("Files on card: "));
  Serial.println(player.readFileCounts());
  player.play(1);    // first track
}

void loop() {
  if (player.available()) {
    uint8_t type = player.readType();
    int value = player.read();
    if (type == DFPlayerPlayFinished) {
      Serial.print(F("Finished track "));
      Serial.println(value);
      player.next();
    } else if (type == DFPlayerError) {
      Serial.print(F("DFPlayer error code "));
      Serial.println(value);
    }
  }
}
```

Compiled for arduino:avr:uno on 2026-10-30.

### ESP32 DevKit V1

Libraries: dfrobot/DFRobotDFPlayerMini

```cpp
// DFPlayer Mini on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/dfplayer-mini
// DFPlayer Mini on an ESP32 DevKit V1: module TX -> GPIO16, module RX <- GPIO17
// Card: FAT32 with 0001.mp3, 0002.mp3... in a folder named mp3 (or in the root).
#include <Arduino.h>
#include <DFRobotDFPlayerMini.h>

DFRobotDFPlayerMini player;

void setup() {
  Serial.begin(115200);
  Serial2.begin(9600, SERIAL_8N1, 16, 17); // RX, TX
  Serial.println("Starting DFPlayer Mini...");
  if (!player.begin(Serial2)) {
    Serial.println("DFPlayer not found: check wiring and the microSD card");
    while (true) { delay(100); }
  }
  player.volume(20); // 0 to 30
  Serial.printf("Files on card: %d\n", player.readFileCounts());
  player.play(1);
}

void loop() {
  if (player.available()) {
    uint8_t type = player.readType();
    int value = player.read();
    if (type == DFPlayerPlayFinished) {
      Serial.printf("Finished track %d\n", value);
      player.next();
    } else if (type == DFPlayerError) {
      Serial.printf("DFPlayer error code %d\n", value);
    }
  }
}
```

Compiled for esp32:esp32:esp32 on 2026-10-30.

### Raspberry Pi Pico

Libraries: dfrobot/DFRobotDFPlayerMini

```cpp
// DFPlayer Mini on Raspberry Pi Pico: wiring and a free simulation at https://www.tinkered.ai/components/dfplayer-mini
// DFPlayer Mini on a Raspberry Pi Pico (arduino-pico): module TX -> GP1, module RX <- GP0
// Card: FAT32 with 0001.mp3, 0002.mp3... in a folder named mp3 (or in the root).
#include <Arduino.h>
#include <DFRobotDFPlayerMini.h>

DFRobotDFPlayerMini player;

void setup() {
  Serial.begin(115200);
  Serial1.setTX(0);
  Serial1.setRX(1);
  Serial1.begin(9600);
  Serial.println("Starting DFPlayer Mini...");
  if (!player.begin(Serial1)) {
    Serial.println("DFPlayer not found: check wiring and the microSD card");
    while (true) { delay(100); }
  }
  player.volume(20); // 0 to 30
  Serial.print("Files on card: ");
  Serial.println(player.readFileCounts());
  player.play(1);
}

void loop() {
  if (player.available()) {
    uint8_t type = player.readType();
    int value = player.read();
    if (type == DFPlayerPlayFinished) {
      Serial.print("Finished track ");
      Serial.println(value);
      player.next();
    } else if (type == DFPlayerError) {
      Serial.print("DFPlayer error code ");
      Serial.println(value);
    }
  }
}
```

Compiled for rp2040:rp2040:rpipico on 2026-10-30.

## Specifications

| Spec | Value | Source |
| --- | --- | --- |
| Supply voltage (VCC) | 3.2 V to 5 V | DFRobot DFPlayer Mini (DFR0299) wiki, specification |
| Serial interface | UART, 9600 baud default, 3.3 V TTL level | FN-M16P Embedded MP3 Audio Module Datasheet V1.0, pp. 2, 4 (in DFRobot's DFRobotDFPlayerMini repository) |
| Speaker output | Drives a speaker under 3 W directly from SPK_1/SPK_2 | DFRobot DFPlayer Mini (DFR0299) wiki, FAQ; FN-M16P datasheet V1.0, p. 3 |
| DAC | 24-bit, 90 dB dynamic range, 85 dB SNR | DFRobot DFPlayer Mini (DFR0299) wiki, specification |
| Storage | microSD up to 32 GB, FAT16 and FAT32 | DFRobot DFPlayer Mini (DFR0299) wiki, specification |
| Formats and sampling rates | MP3 and WAV, 8 kHz to 48 kHz | FN-M16P datasheet V1.0, p. 2 |
| Volume and EQ | 30 volume levels, 6 EQ presets | DFRobot DFPlayer Mini (DFR0299) wiki, specification |
| File naming | Folders 01 to 99 holding 001.mp3 to 255.mp3; mp3 and ADVERT folders holding 0001.mp3 to 3000.mp3 | FN-M16P datasheet V1.0, pp. 2 to 3 |
| Size | 20 mm × 20 mm | DFRobot DFPlayer Mini (DFR0299) wiki, specification |

## Circuit notes

- The serial port is 3.3 V TTL (FN-M16P datasheet V1.0, p. 2), so it connects straight to ESP32 and Pico pins and its TX is read correctly by a 5 V Uno.
- BUSY (pin 16) is low while a track plays and high when idle (p. 4); read it on a spare GPIO for a playback status that needs no serial traffic.
- Supply noise on VCC is heard in the speaker. A 100 µF capacitor across VCC and GND at the module, and a ground wire run straight to the board, keep the hiss down.
- DAC_L and DAC_R give a stereo line output for headphones or a bigger amplifier such as a PAM8403; the built-in amplifier is mono.
- player.begin() waits for the module to answer and can take a couple of seconds after power-up while the card is indexed.

## Common mistakes

- **Card formatted exFAT or NTFS.** Cards above 32 GB come formatted exFAT, which the module cannot read; begin() then fails or reports no files. Use a card of 32 GB or less formatted FAT32 (DFRobot DFR0299 wiki).
- **Wrong track plays.** play(1) means the first file copied to the card, not the file named 0001.mp3, when files sit in the root (FN-M16P datasheet V1.0, p. 3). Put them in an mp3 folder and call playMp3Folder(1), or use numbered folders with playFolder(1, 1).
- **Loud hum or ignored commands on a 5 V board.** The module's UART is 3.3 V TTL. Driving RX straight from a 5 V pin causes noise and missed frames; a 1 kΩ series resistor, as DFRobot advises, fixes it.
- **Speaker wired to GND.** The speaker goes across SPK_1 and SPK_2. Wiring one side to GND shorts an amplifier output and gives distorted sound or a module that resets.

## Questions

### What voltage does the DFPlayer Mini need?

3.2 V to 5 V on VCC (DFRobot DFR0299 wiki). 5 V gives the amplifier more headroom for a 3 W speaker; at 3.3 V it still plays, just quieter. Its serial pins stay at 3.3 V TTL either way (FN-M16P datasheet V1.0, p. 2).

### Why does the DFPlayer Mini not start (begin() fails)?

Check that TX and RX are crossed, the card is FAT32 and 32 GB or less, and there are numbered files on it. On a 5 V board add the 1 kΩ resistor on RX. If it plays with the IO buttons but not from code, the serial wiring or baud rate (9600) is the problem.

### How do I name the MP3 files?

Use four-digit names such as 0001.mp3 in a folder called mp3 and call playMp3Folder(n), or folders 01 to 99 with 001.mp3 to 255.mp3 and call playFolder(folder, file) (FN-M16P datasheet V1.0, pp. 2 to 3). Text after the number is allowed, such as 001Intro.mp3.

### How big a speaker can it drive?

Under 3 W directly from SPK_1 and SPK_2 (DFRobot DFR0299 wiki). A 4 Ω or 8 Ω speaker of 0.5 W to 3 W is typical. For more power or stereo, take DAC_L and DAC_R into an external amplifier.

### Does it work with an ESP32 or a Pico?

Yes. Its UART is 3.3 V TTL, so TX and RX connect directly to a hardware serial port: Serial2 on GPIO16/17 for the ESP32, Serial1 on GP0/GP1 for the Pico. Power it from the 5 V USB rail (VIN or VBUS) for the best volume.

## Related parts

- [Speaker (3W, 4Ω)](https://www.tinkered.ai/components/speaker-enclosed-3w-4ohm.md): a speaker within the 3 W limit
- [PIR HC-SR501](https://www.tinkered.ai/components/pir-hc-sr501.md): play a sound when someone walks by
- [Push Button](https://www.tinkered.ai/components/push-button.md): trigger tracks from buttons
- [MAX98357A I2S 3W Amplifier](https://www.tinkered.ai/components/max98357a-i2s-amp.md): an I2S amplifier when the microcontroller decodes the audio itself

## Try it

Tinkered can design a circuit with the DFPlayer Mini, draw its schematic and check it. Free to start at https://www.tinkered.ai.
