How to Play Audio with Arduino UNO and DFPlayer Mini – Step‑by‑Step Guide
Components and supplies
![]() |
| × | 1 | |||
| × | 1 | ||||
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
![]() |
| × | 1 |
About this project
Hello friends, today in this video, 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
2- Df Player Mini
3- Speaker
4- Jumper wires
5- Bread Board
Code
- Code
CodeArduino
#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() {
}
Schematics

Manufacturing process
- Player Piano: Merging Acoustic Tradition with Automated Precision
- Compact Disc Player: Accurate, Wear‑Free Digital Audio Playback
- Arduino Audio Frequency Detector – Measure Loudest Sound Peaks with High‑Sensitivity Module
- Arduino Web‑Controlled MP3 Player: Easy Audio Playback via Browser
- Build an Audio‑Reactive Desk Lamp with Arduino Nano
- Animate Your Billy Bass Fish with Any Audio Source – Step‑by‑Step Guide
- RGB LED Backlight with MSGEQ7 Audio Visualizer for TV and Desk
- Catalex Serial MP3 Player for Arduino UNO – Easy Setup & Control
- Build an RGB Matrix Audio Visualizer Using Arduino – Step‑by‑Step Guide
- Create an Interactive Arduino MP3 Player with an Ultrasonic Distance Sensor



