Hackster is hosting Hackster Holidays, Ep. 4: Livestream & Giveaway Drawing. Start streaming on Wednesday!Stream Hackster Holidays, Ep. 4 on Wednesday!
Muhammad_Munir
Published © GPL3+

DFPlayer Mini Interface with Arduino

DFPlayer Mini Interface with Arduino and Audio Amplifier

BeginnerFull instructions provided1 hour3,358
DFPlayer Mini Interface with Arduino

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Df player mini
×1
SD Card
×1
5v Audio amplifire
×1
Jumper wires
×1
Bread board
×1
3watt speaker
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Diagram

Code

Code

Arduino
#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"

// Use pins 2 and 3 to communicate with DFPlayer Mini
static const uint8_t PIN_MP3_TX = 2; // Connects to module's RX 
static const uint8_t PIN_MP3_RX = 3; // Connects to module's TX 
SoftwareSerial softwareSerial(PIN_MP3_RX, PIN_MP3_TX);

// Create the Player object
DFRobotDFPlayerMini player;

void setup() {

  // Init USB serial port for debugging
  Serial.begin(9600);
  // Init serial port for DFPlayer Mini
  softwareSerial.begin(9600);

  // Start communication with DFPlayer Mini
  if (player.begin(softwareSerial)) {
   Serial.println("OK");

    // Set volume to maximum (0 to 30).
    player.volume(20);
    // Play the first MP3 file on the SD card
    player.play(1);
  } else {
    Serial.println("Connecting to DFPlayer Mini failed!");
  }
}

void loop() {

 
   }

Credits

Muhammad_Munir

Muhammad_Munir

77 projects โ€ข 50 followers
I am Arduino programmer, also expertise in ESP32 and 8266 wifi modules.

Comments