Hi everyone, we are back again with another interesting Arduino project. At this time, we aren’t dealing with well-known sensors, motors, and relay-like stuff. We are going to build a Stereo MP3 Player system using Arduino. Using a DFPlayer module which is very cheap, we can easily make this project. We already built a DFPlayer-based Thunder Lightning project previously. Make sure to check out.
MP3 players are getting old daily, as many types of alternatives are available in the market like mobile phones. But doing this project using Arduino is cool. Isn’t it?
This stereo MP3 player uses a DFPlayer module with all the functions and inputs/outputs a decent MP3 player should have. It allows play/pause, next, and previous features with advanced equaliser, looping and shuffling functions. Later we can also add some extra features like Bluetooth, LCD display, etc. We will build this into two steps.
In the first step, we will build the main circuit which includes DFPlayer and Arduino. And in the second step, we add a PAM8403 amplifier to boost the sound for a better experience with stereo sound. So let’s build it.
Project
Circuit Diagram
Components Required
- Arduino Nano
- DFPlayer Mini Module
- SD Card
- 1KΩ Resistance
- Push Buttons (x3)
- Speakers (x2)
- Connection Wire
- Lithium-Ion Battery (x2)
- Lithium-Ion Battery Holder
- Veroboard
DFPlayer Mini Module

The DFPlayer Mini is a small, cheap MP3 module with a clear audio output that can be modified as mono or stereo output as per requirement. This is a standalone module that can be used with a microcontroller, attached battery, speakers, and push buttons. There are two enabled pins (RX/TX) for serial communication. Through these simple serial pins, we can command the module to play/pause songs, next and previous songs, shuffle, etc. The module comes with an SDcard slot and supports both FAT16 and FAT32 file systems.
DFPlayer Mini Pinout

Circuit Connection of Stereo MP3 Player
- Connect 5V output from Arduino Nano to the input VCC pin of the DFPlayer module.
- Connect the Arduino Nano ground pin to the DFPlayer module ground.
- For the transmission process, the Arduino D10 pin is to the DFPlayer module TX pin.
- And connect the Arduino D11 pin to the 1KΩ resistor, the other side of the resistor is connected to the DFPlayer module RX pin.
- For a stereo speaker, connect the left side wire of the PAM8403 amplifier module to the DFPlayer module DACL pin and the right side wire to the DACR pin respectively. Also, connect the ground wire to the DFPlayer ground pin.
While uploading code to the Arduino, disconnect RX pin and after uploading just connect it again.
PCB Design
After designing the schematic diagram of the Digital RPM Meter, the assembled components and wiring are too clumsy and looked very unprofessional. In fact, the wiring also has a chance of loose connection. To give it a clean and professional look and also to compress the size, I decided to build its PCB prototype using EasyEDA software as it is so simple to use. Now come to the main part, where we need to order our PCB prototype. I always prefer PCBWay for their quality assurance, fastest delivery and also for 24/7 customer support.
PCB View


I’ve done several runs with PCBWay and am happy with the results, it’s good quality. It is one of the most experienced PCB manufacturing companies based in China with an experience of more than a decade in the field of PCB prototype and fabrication. PCBWay has always been committed to technological innovation and meeting the needs of their customers from different industries in terms of quality, delivery, cost-effectiveness and any other demanding requests. The etching, solder mask, and hole sizes are all done well and that is what matters to me. It takes a few hours for a design to get approved and then a couple of days to finish and ship.
With more than a decade in the field of PCB prototypes and fabrication, PCBWay has proved its assurance from time to time. They always look at the customer’s needs from different regions in terms of quality, on-time delivery, cost-effectiveness and any other demanding requests.


These PCBs were manufactured by PCBWay and the finish quality really impressive, especially with the gold finish path. If you want to finish your product faster you could also ask PCBWay to make a panelized order where you receive multiple PCBs in a single panel. With this, you will also receive SMT Stencil from PCBWay, saving you time and effort. All the orders are high quality and could select a lot of settings such as thickness, flexible PCB, the colour of the solder masks, the number of layers, material, surface finish and more.
Arduino Code
You need to install the “DFRobotDFPlayerMini.h” library before compiling the Arduino code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | #include "SoftwareSerial.h" #include "DFRobotDFPlayerMini.h" SoftwareSerial mySoftwareSerial(10, 11); // Define as RX & TX pin DFRobotDFPlayerMini myDFPlayer; int buttonNext = 2; int buttonPause = 3; int buttonPrevious = 4; boolean isPlaying = false; void setup() { pinMode(buttonPause, INPUT); digitalWrite(buttonPause, HIGH); pinMode(buttonNext, INPUT); digitalWrite(buttonNext, HIGH); pinMode(buttonPrevious, INPUT); digitalWrite(buttonPrevious, HIGH); mySoftwareSerial.begin(9600); Serial.begin(9600); delay(1000); Serial.println(); Serial.println("DFPlayer Mini"); Serial.println("Initializing DFPlayer..."); if (!myDFPlayer.begin(mySoftwareSerial)) { Serial.println("Unable to Begin"); Serial.println("1.Please Recheck The Connection"); Serial.println("2.Please Insert the SD Card"); while (true); } Serial.println(F("DFPlayer Mini Playing")); myDFPlayer.setTimeOut(500); myDFPlayer.volume(10); //Set Volume Value (0-30) //myDFPlayer.volumeUp(); //Volume Up //myDFPlayer.volumeDown(); //Volume Down myDFPlayer.EQ(DFPLAYER_EQ_NORMAL); // myDFPlayer.EQ(DFPLAYER_EQ_POP); // myDFPlayer.EQ(DFPLAYER_EQ_ROCK); // myDFPlayer.EQ(DFPLAYER_EQ_JAZZ); // myDFPlayer.EQ(DFPLAYER_EQ_CLASSIC); // myDFPlayer.EQ(DFPLAYER_EQ_BASS); myDFPlayer.outputDevice(DFPLAYER_DEVICE_SD); myDFPlayer.play(1); isPlaying = true; Serial.println("Playing.."); } void loop() { if (digitalRead(buttonPause) == LOW) { if (isPlaying) { myDFPlayer.pause(); isPlaying = false; Serial.println("Paused"); } else { isPlaying = true; myDFPlayer.start(); Serial.println("Playing"); } delay(500); } if (digitalRead(buttonNext) == LOW) { if (isPlaying) { myDFPlayer.next(); Serial.println("Next"); } delay(500); } if (digitalRead(buttonPrevious) == LOW) { if (isPlaying) { myDFPlayer.previous(); Serial.println("Previous"); } delay(500); } } |