DF Player Mini Play Audio File
by munir03125344286 in Circuits > Arduino
3597 Views, 3 Favorites, 0 Comments
DF Player Mini Play Audio File
Hello friends, today in this Project, I show you how to Play audio file by using Arduino and Df player. The DFPlayer Mini is a small and low cost MP3 module player with an simplified output directly to the speaker. The module can be used as a stand alone module with attached battery, speaker and push buttons or used in combination with an Arduino UNO or any other with RX/TX capabilities. For making this, I am using:-
1- Arduino UNO https://amzn.to/3vXP8Ht
2- Df Player Mini https://amzn.to/3En5vQY
3- Speaker https://amzn.to/3En5vQY
4- Jumper wires https://amzn.to/3En5vQY
5- Bread Board https://amzn.to/3En5vQY
Connect Speaker
First of all connect 3 watt speaker to DF mini Player.
Connect DF Player Mini to Arduino
Connect DF player Mini to arduino
Copy Mp3 File to SD Card
Insert SD Card Into DF Player Mini
Code Write to the 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(30);
// Play the first MP3 file on the SD card
player.play(1);
}
else {
Serial.println("Connecting to DFPlayer Mini failed!"); } }
void loop() { }
Lets Test
You can Purchase from:-
1- Arduino UNO https://amzn.to/3vXP8Ht
2- Df Player Mini https://amzn.to/3En5vQY
3- Speaker https://amzn.to/2ZDQ207
4- Jumper wires https://amzn.to/2ZDQ207
5- Bread Board https://amzn.to/2ZDQ207