Learn How To Interface DFPlayer Mini MP3 Module With Arduino 

Hello Electronics Lovers, in this tutorial i will show you how to Interface DFPlayer Mini MP3 Module With Arduino. This article is very important for those who want to add some sound or voice effects to their projects. You can use this precious DFPlayer Mini MP3 Module in your semester or final year project to play a respective sound against different commands or actions. You can buy this module online or you can search for it on your local Eshop market. 

DFPlayer Mini MP3 Module Pinout :

I am going to explain important and most usable Pinouts for DFPlayer Mini MP3 Module. 

  • Pin No 1, you can use this pin to supply a required DC voltage such as 3.3 – 5v to DFPlayer Module. This module is very sensitive, kindly provide a DC voltage in the given range otherwise you will damage its circuitry. 
  • Pin No 2,  this pin is associated with RX which mean Recivce. You can use this pin to Receive predefined commands from Arduino or computer. Most of the time Embedded system engineers prefer serial communication to send data to DFPlayer module via pin no 2. You can use your computer USB port for the purpose of serial communication, for this you need to buy TTL converter. 
  • Pin No 3, we can use this pin to transmit commands or data from our DFPlayer mini-module to other sources such as Arduino or computer. Suppose If someone Press pause button on DFPlayer Module then it will send a command to Arduino via pin No 3 to pause that song. 
  • We can use Pin No 4 DAC_L and Pin No 5 DAC_L for the interfacing of Earphone or handsfree with DFPlayer mini Module. You can easily make a female 3.5 mm Jack with it for better results. 
  • You can use Pin No 6 SPK 1 (+) and Pin No 8 SPk2 (-) to connect a minimum of a 3w speaker as an output. Right now this module can support a speaker up to 3w. Connect speaker directly to the respective pins and start listening to your favorite tone.  
  • Obviously, everyone will know the purpose of Pin No 7.
  • Pin No IO 1, if you want to play a previous song or decrease volume then you need to add an external push button to pin No 9.  It will play a previous song whenever your press that button for short time like 0.5 seconds. If you want to decrease volume then you need to press that push button for more time continuously. 
  • Pin No IO 2, if you want to play a Next song or increase volume then you need to add another external push button to pin No 11.  It will play the next song whenever your press that button for short time like 0.5 seconds. If you want to increase volume then you need to press that push button for more time continuously. 
  • If you don’t want to use SD card so there is a USB option in DFPlaer mini-module. A module will play the song directly from USB instead of SD card. Before going to connect your USB with this module you need to have look at this article Micro-USB Data cable Pin out Diagram + Others Usb standards

Schematic Diagram:

You need to have two external power supplies one for Module and another one for Arduino mini Pro. Sometimes it creates a noisy sound when you use the same power supply for both at the same time. You can try a 5V 1A external Power supply for both if you get good sound then its ok otherwise change it. Here we have attached a 3W speaker directly to DFPlayer module as an output. 

Partlist  :
  1. DFPlayer Mini module 
  2. Speaker 
  3. SD card – 2GB ~ 32GB formatted with FAT or FAT32
  4. MP3 / WAV – audio files
  5. Arduino mini Pro
  6. Few jump wires

How to Add Audio Files :

  • You need to Copy and paste your Mp3 or Wav files inside a folder in SD card.
  • Making of New Folder inside SD Card is Compulsory otherwise, Module will not read Mp3 or Wav Files accurately. 
  • Audio file must be named 0001.mp3, 0002.mp3…..0255.mp3 (4 letters not 2 or 3 letters)
  • Audio file names can have any characters after 4 digits, such as 0001_Bruno_Mars_Count_On Me.mp3 
  • You can easily change delay time for each Track inside Source Code. For our First track we have set a time delay of 10 seconds it means it will play that song for 10 seconds and then it will move on to the next one automatically. 

Download Source Code AND DFPlayer Library for Arduino IDE : 

Click Here To Download Source Code

Click Here To Download DFPlayer Library for Arduino IDE 

Future Work:

You can update this source code for your ROBOT project. Yes, you can play a specific Mp3 Sound or track if someone presses the desired button. You may use this in Face Detection Project. It will play a sound whenever it detects someone with the help of Motion Sensor.  It depends upon on your creativity that how much creative you are, just think and make some new cool stuff. We are here to help you if you found any difficulty while making this project so don’t hesitate to ask your query in the comment box. 

Pictures and Schematic Courtesy https://stonez56.blogspot.tw

Related posts

Arduino Opta PLC Pros & Cons

Breakthrough of Ardino-Pro Opta: Micro-PLC with industrial IoT proficiency

Top Arduino sensors – the ultimate list 2021

5 comments

Mohamemd March 17, 2018 - 9:45 pm

Could anyone help me, I need to get a dfplayer library for Proteus 8,

Mohammed March 17, 2018 - 9:46 pm

Could anyone help me, I need to get a dfplayer library for Proteus 8,

QuocN October 7, 2018 - 7:41 am

Could anyone help me, I need to get a dfplayer library for Proteus 8, mee too.

Gary October 2, 2020 - 6:44 pm

You say “Making of New Folder inside SD Card is Compulsory otherwise, Module will not read Mp3 or Wav Files accurately. ” but you don’t say what the directory name needs to be, should the directory name be “/play”

Hana September 26, 2023 - 12:16 am

what software you use to design schematic?

Add Comment