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
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.
- DFPlayer Mini module
- SD card – 2GB ~ 32GB formatted with FAT or FAT32
- MP3 / WAV – audio files
- Arduino mini Pro
- 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 :
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