Ordered on weekdays before 14:00 = shipped the same day and delivered the next day in 98% of cases. Free returns 30-day reflection period 1-year warranty

Wiring diagram and code example

How to connect the DFPlayer Mini (clone) MP3 module with MicroSD card slot to an Arduino UNO or ESP32, with an example sketch you can upload straight away.

DFPlayer Mini MP3 Player Demo

This project demonstrates how to play MP3 audio files using the DFPlayer Mini module and Arduino Uno. Ensure your microSD card is formatted in FAT32 with an MP3 file placed in an 'mp3' folder (or root named 0001.mp3). When powered, the Arduino initializes the player, sets the playback volume, and starts playing the first audio track.

Wiring diagram: DFPlayer Mini (clone) MP3 module with MicroSD card slot on an Arduino UNO
Wiring diagram · Click to enlarge
Connection table: DFPlayer Mini (clone) MP3 module with MicroSD card slot on an Arduino UNO
Connection table · Click to enlarge
DFPlayer_Mini_MP3_Player_Demo.ino · compiled and verified
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : DFPlayer Mini MP3 Player Demo
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : DF Player Mini
 *  Libraries : DFRobotDFPlayerMini 1.0.6
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

#include <SoftwareSerial.h>
#include <DFRobotDFPlayerMini.h>

// Arduino pin 10 connects to DFPlayer TX, pin 11 connects to DFPlayer RX
SoftwareSerial dfSerial(10, 11);
DFRobotDFPlayerMini myDFPlayer;

void setup() {
  Serial.begin(115200);
  dfSerial.begin(9600);

  Serial.println(F("Initializing DFPlayer Mini..."));

  if (!myDFPlayer.begin(dfSerial)) {
    Serial.println(F("Unable to begin DFPlayer Mini:"));
    Serial.println(F("1. Recheck wiring"));
    Serial.println(F("2. Insert formatted micro SD card with MP3 files"));
    while (true) {
      delay(100);
    }
  }

  Serial.println(F("DFPlayer Mini online."));
  
  // Set volume (0 to 30)
  myDFPlayer.volume(20);
  
  // Play the first MP3 file on the micro SD card
  myDFPlayer.play(1);
  Serial.println(F("Playing track 1..."));
}

void loop() {
  // Print status messages if received from the player
  if (myDFPlayer.available()) {
    uint8_t type = myDFPlayer.readType();
    int value = myDFPlayer.read();
    
    if (type == DFPlayerPlayFinished) {
      Serial.print(F("Track finished: "));
      Serial.println(value);
    }
  }
}

Required libraries: DFRobotDFPlayerMini 1.0.6

Wiring diagram and example code generated by Codey.online — https://www.codey.online

ESP32 DFPlayer Mini MP3 Player Demo

This project connects an ESP32 to a DFPlayer Mini MP3 module to play audio tracks from a micro SD card through a connected speaker. The DFPlayer Mini is powered from 3.3V, and the ESP32 communicates with it using hardware Serial2 on GPIO 16 (RX2) and GPIO 17 (TX2). Format your micro SD card with FAT32 and place audio files in an 'mp3' folder (e.g. 0001.mp3) to begin playback.

Wiring diagram: DFPlayer Mini (clone) MP3 module with MicroSD card slot on an ESP32 DevKit V1
Wiring diagram · Click to enlarge
Connection table: DFPlayer Mini (clone) MP3 module with MicroSD card slot on an ESP32 DevKit V1
Connection table · Click to enlarge
ESP32_DFPlayer_Mini_MP3_Player_Demo.ino · compiled and verified
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : ESP32 DFPlayer Mini MP3 Player Demo
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : DF Player Mini
 *  Libraries : DFRobotDFPlayerMini 1.0.6
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

#include <DFRobotDFPlayerMini.h>

DFRobotDFPlayerMini myDFPlayer;

void setup() {
  Serial.begin(115200);
  // Serial2: RX on GPIO 16, TX on GPIO 17
  Serial2.begin(9600, SERIAL_8N1, 16, 17);

  Serial.println(F("Initializing DFPlayer Mini..."));

  if (!myDFPlayer.begin(Serial2)) {
    Serial.println(F("Unable to begin. Check SD card and wiring!"));
    while (true) {
      delay(500);
    }
  }

  Serial.println(F("DFPlayer Mini online."));
  myDFPlayer.volume(20);  // Set volume (0 to 30)
  myDFPlayer.play(1);      // Play track 0001.mp3
}

void loop() {
  // Play next track every 10 seconds
  delay(10000);
  Serial.println(F("Playing next track..."));
  myDFPlayer.next();
}

Required libraries: DFRobotDFPlayerMini 1.0.6

Wiring diagram and example code generated by Codey.online — https://www.codey.online

DFPlayer Mini (clone) MP3 module with MicroSD card slot

The DFPlayer Mini (clone) is a compact and powerful MP3 player module, ideal for audio applications in projects such as Arduino or other microcontrollers. This module can play MP3 files directly from a microSD card or USB stick, without requiring any additional hardware.

Key features:

  • Easy operation: Controllable via serial communication, buttons, or a combination of both.
  • Supports multiple formats: Plays MP3, WAV, and WMA files.
  • Storage: Works with microSD cards up to 32 GB.
  • Built-in amplifier: Connect a speaker directly for clear sound without extra amplifiers.
  • Power supply: Operates on 3.2V to 5V, ideal for portable projects.
  • Compact size: Fits easily into small enclosures thanks to its dimensions of 22mm x 30mm.

The DFPlayer Mini is a versatile solution for all your audio-related projects, whether you want to add sound effects to your design or build a complete audio system!

NOTE: This is not the original YX5200 chip. Existing code for the YX5200 chip may need to be adjusted for proper operation.

 

  • MP3 player module
  • Serial control
  • microSD slot
  • Compact size
Playing loads the video from YouTube.

Why choose this product?

  • Direct playback – Plays from microSD card or USB stick.
  • Easy operation – Can be controlled serially, with buttons, or both combined.
  • Multiple formats – Supports MP3, WAV and WMA files.
  • Direct speaker – Built-in amplifier, no extra amplifier needed.
  • Compact size – Fits easily in small enclosures.
Specifications
Compact sizeFits easily in small enclosures thanks to the dimensions of 22mm x 30mm
Power supplyOperates on 3.2V to 5V, ideal for portable projects
Dimensions22mm x 30mm
Suitable forArduino and other microcontrollers
Simple operationControllable via serial communication, buttons, or a combination of both
Supports multiple formatsPlays MP3, WAV and WMA files
StorageWorks with microSD cards up to 32 GB
Built-in amplifierConnect a speaker directly for clear sound without extra amplifiers
MicroSD cardup to 32 GB

Frequently bought together

Total: € 20,48

Reviews

★★★★★ 5,0/5 4 reviews
  • ★★★★★Wim Rijsemus

    Works fine. Does what it is supposed to do.

  • ★★★★★Marcel PayensVerified purchase

    Works fine

  • ★★★★★Maarten de WitVerified purchase

    Bought a few of these, works well

Write a review
Your rating

Shipping & returns

Shipping

  • Parcel with track & trace€ 7,70Within 24 hours
  • Pick up at PostNL location€ 7,40Within 24 hours
  • Letterbox parcel€ 3,70Within 2 business days
  • Letterbox parcel 24 hours€ 4,55Within 24 hours
  • Pick up in storeFree
All about shipping

Returns

Not satisfied? You have 30 days after delivery to return the product.

All about returns