Hi guys, welcome to this tutorial. Today, we will build an mp3 player using an Arduino and the DFPlayer mini MP3 module.The DFplayer mini is a small, low-cost mp3 module with a simplified audio output that can be connected directly to a speaker or an earphone jack. The module can be used as a stand-alone module with attached battery, speaker, and push buttons or used in combination with a microcontroller or development board like the Arduino, enabled for RX/TX (Serial) communication, thus through simple serial commands we can play music and perform other functions like playing the next and previous song, shuffle, pause the song currently being played etc.


Step 1: Things You Need:



The following components are required to build this project;

DFPlayer Mini

Arduino Uno

Breadboard

Push Buttons

Speaker

Resistor

Jumper wires



Step 2: Features of DF Player Mini

Some of the features of the DF player mini include:Support of sampling rate of 8KHz, 11.025KHz, 12KHz, 16KHz, 22.05KHz, up to 48KHz24-bit DAC output, dynamic range support 90dB, SNR supports 85dBSupports FAT16, FAT32 file system, maximum support 32GB TF cardA variety of control modes, serial mode, AD key control modeThe broadcast language spots feature, you can pause the background music being playedBuilt-in 3W amplifierThe audio data is sorted by folder; supports up to 100 folders, each folder can be assigned to close to 1000 songs30 levels of volume adjustable, 10 levels EQ adjustable.


Step 3: Schmatics

As seen above the connection between the Arduino and the DFplayer mini is very simple as we only need to connect two pins aside VCC and GND. It should be noted that the 1k resistor added in between the Rx pin of the module and the Arduino was added to reduce noise but it’s not necessary if your module setup is not accompanied with noise on the Rx line. The connection is described below for clarity


Step 4: Code

Please copy the following code and upload it to your arduino Board :