Codey OnlineArduino & ESP32 component library › DF Player Mini
DF Player Mini
Sensors

DF Player Mini

DF Player Mini Mp3 player with TF Card reader

Width: 44.8 mm

Pinout — DF Player Mini

Pin Signal Description
VCC power Top-left header pad, top pin
RX RX Left header pad, second pin from top
TX TX Left header pad, third pin from top
DAC_R analog Left header pad, fourth pin from top
DAC_I analog Left header pad, fifth pin from top
SPK_1 data Left header pad, sixth pin from top
GND ground Left header pad, seventh pin from top
SPK_2 data Left header pad, bottom pin
BUSY digital Top-right header pad, top pin
USB- data Right header pad, second pin from top
USB+ data Right header pad, third pin from top
ADKEY_2 analog Right header pad, fourth pin from top
ADKEY_1 analog Right header pad, fifth pin from top
IO_2 digital Right header pad, sixth pin from top
GND ground Left header pad, seventh pin from top
IO_1 digital Right header pad, bottom pin

Example wiring diagram — DF Player Mini

From To Wire
board:5V x1:VCC red
board:GND x1:GND black
board:D10 x1:RX green
board:D11 x1:TX blue

Example Arduino code — DF Player Mini

This example was written and compile-checked for the arduino-uno. Codey Online adapts it to any other supported board for you.

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

SoftwareSerial dfSerial(10, 11); // Arduino RX, TX
DFRobotDFPlayerMini dfPlayer;

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

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

  if (!dfPlayer.begin(dfSerial)) {
    Serial.println("DFPlayer Mini not detected. Check wiring and SD card.");
    while (true) {
      delay(1000);
    }
  }

  Serial.println("DFPlayer Mini ready.");
  dfPlayer.volume(20); // Range: 0 to 30

  // Play the first track on the microSD card.
  dfPlayer.play(1);
  Serial.println("Playing track 1.");
}

void loop() {
  // Nothing to do here for the basic example.
}

Related components

18650 Battery Shield with USB-C Charger and 5V Boost Converter

18650 Battery Shield with USB-C Charger and 5V Boost Converter

2.4 inch OLED Display I2C 3.3V

2.4 inch OLED Display I2C 3.3V

3.5 inch TFT LCD Shield

3.5 inch TFT LCD Shield

50kg Load Cell Weight Sensor

50kg Load Cell Weight Sensor

Build your Arduino or ESP32 project with AI

Describe what you want to build. Codey Online writes the code, draws the wiring diagram, compiles it and flashes your board straight from the browser.

Start for free