Introduction To The DFPlayer Pro

What Is DFPlayer PRO

The DFPlayer Pro-is a simple but powerful MP3 Player! This MP3 player module supports four controlling modes: Arduino, AT command, on-board buttons, and ADKEY. You can directly press the on-board button to play or switch music without using a controller. By using a USB cable, you can easily copy your favorite songs into this module to play them any where you want, or use it as a sound card for your PC or Raspberry Pi after connecting them together.
Compared with the previous DFPlayer Mini, the DFPlayer Pro has 128MB storage that can be directly used without a TF card, and the on-board Type-C socket makes it much convenient to use. And it offers dual channel output, better sound effects. Besides that, DFPlayer Pro is equipped with new functions like fast-forward, fast-rewind, play the audio from a particular point of the audio file, etc.

What Can It Do

The DFPlayer Pro can do everything you’ve become familiar with in the DFPlayer Mini with slightly different commands in Arduino. Lacking in this device is a BUSY Key, which (in the DFPlayer Mini) allowed a better flow of the code by sensing when a track was playing. With the DFPlayer Pro, a delay has to be hard coded in to keep the audio running for the desired length of the fx.

The available commands for Arduino allow you to choose a specific file by name, or select a file by it’s order in the directory. There are also previous and next commands to jump from file to file. You can fast forward, fast rewind, and start at a specific time in the audio file. Start, pause, and set volume  are more available commands.

If you are a Mission Impossible fan, the delete current track can be used to “self destruct” a file within the directory!

Connecting To An Arduino Uno

To get the most control of the DFPlayer Pro, connecting it to an Arduino Device is the best solution. You can control the flow of your desired sound fx at specific times and durations through the aid of sensors or switches of your choice such as IR Sensors, UV Sensors, Proximity Sensors, whatever your desired method of control would be. Also flow of the code with conditional statements. The possibilities are limited only by your imagination. There have been many projects created throughout the years for the DFPlayer Mini that can be found on GitHub, the Arduino Project Hub, and YouTube videos, that can easily be converted to the DFPlayer Pro with minor adjustments with the new commands with this Library.

In my example I use and Arduino Uno, but you can use a Nano or Mega if you desire, depending on your application and available space. I’ve included two sketches in this tutorial to show different ways of controlling the player. I also included the example sketch and my first attempt at trying to control the DFPlayer Pro in the early hours of learning the included Library. You can build on these examples for your own project, or start from scratch. It’s up to you!

After all, it is Open Source. What does that mean for you?

Open source is a term that originally referred to open source software (OSS). Open source software is code that is designed to be publicly accessible—anyone can see, modify, and distribute the code as they see fit.

Open source software is developed in a decentralized and collaborative way, relying on peer review and community production. Open source software is often cheaper, more flexible, and has more longevity than its proprietary peers because it is developed by communities rather than a single author or company.

Open source has become a movement and a way of working that reaches beyond software production. The open source movement uses the values and decentralized production model of open source software to find new ways to solve problems in their communities and industries.

In other words… You can copy code to your hearts content.

If you do use someone else’s code with little on no modification, it’s good practice to acknowledge the original creator!

Better yet! Drop A Donation via PayPal to show your appreciation!

Arduino Connection

Arduino Uno Pinout

Pin Identification

DFPlayer Pro Pin Out

Take At Look Behind The Scenes

See What was Involved Working With DFPlayer Pro For The First Time

Instructions for using the DFPlayer Pro

Prep
This device comes with a set of headers that can be easily soldered to the underside by mounting the headers on a breadboard to hold them steady while soldering. I used a Digital Soldering Station set at 650F. Solder is 0.033 60/40 rosin core solder, and a dab of liquid solder. I then toughly clean the area with 91% Isopropyl Alcohol when finished.
Loading Sound Files
Installing your audio files will require a USB-C cable connected to your computer. This device will show up as an external hard drive. Select the files to transfer, numbering them with a prefix 01, 02, 03 etc… (if using your own) and place them in a separate directory on your hard drive. If using the supplied files from this site, unzip them in a folder of your choice, and install them on the DFPlayer Pro one at a time. I find this to be best since Windows tends to start with the last file in the list then the remaining files from the top. Batch transfer will definitely cause problems later on.
Test
Once the files are successfully installed, hook up a speaker to either the R or L +&- pins or both if you prefer listening in stereo. Make sure your USB-C cable is connected to the PC (this is to power the device). Press the onboard push button once, you will see the blue LED flash. Press it again and the first file will play Solid Blue LED). A short press of the button will pause the file. A long press (2 seconds) will play the next file. With multiple file like the supplied music, you can continue listening as in a Playlist till the end of the files, or just pause the track then unplug the cable from the device.
Hidden Feature
This device can also be used a a sound card for your PC or Raspberry Pi. With speakers installed, connect the device to your PC or RasPi without pushing the onboard button. Select a music file or playlist on your computer or Pi and enjoy! You can also use the DACL DACR & GND with powered speakers or an amplifier to take advantage of the sound card feature!
Control By Software
Arduino Time! The easiest way to control the flow of your project is through code installed on your Arduino Uno or similar device.
If you are not familiar with the Arduino IDE:
Download the Arduino IDE HERE
You can learn how to use Arduino HERE: or refer to the DOCUMENTS on the Arduino Website before proceeding. Otherwise, follow along!
You will need an Arduino Uno with USB cable, Breadboard, a few  connectors, the DFPlayer Pro,  and two speakers.
If you would like to also  follow along with the User_Input sketch, these items will be helpful: Pushbutton Module & Screw Shield, or I/O Expansion Shield  for the grove connector on the module. These last two items are always good to have on hand!
Software Setup
Assuming that you already have the Arduino IDE, it’s time to load some files on your Arduino. You’ll need to connect your Arduino to your PC with a USB cable. There is a LIBRARY for the DFPlayer Pro that you will need to install before the commands will work. And you will need the EXAMPLE Sketch.
Instructions for installing the Library can be found in this video:
Zip Library
Instructions for installing the Sketches can be found in this video:
Installing Zip Sketches
Running The Sketch
Use the wiring diagram shown above to connect your device & speakers to our Arduino Uno. Compile & upload the example file. The file should start running on it’s own. Open the Serial Monitor to see where you are in the sketch while the files are running.
Click HERE to see an example of what you should see in the Serial Monitor:
The second sketch supplied (Player_Pro_User_Input.ino) uses a pushbutton to initiate the sequence of events. Any sensor can be used in it’s place. Once the file is loaded, open the Serial Monitor to see the sequence of events. Nothing will happen until the pushbutton is pressed. The pushbutton will be active again once the instructions in the if statement has ended.

Send me an email with Questions or Comments to: tomstrainsandthings@gmail.com

Demo Sketch 1 From Video

User Input Sketch

What The Project Looks Like

Set Up Video

YouTube player

Push Button Control Using ADKey

For More Details Visit ADKey Wiki

AD Button Control

AD Button Diagram

AD Key Board

My Thoughts on the DFPlayer Pro

Overall, this device is well made and a big improvement over the MINI & Voice Module just on features alone, because of the storage size, and ability to store files directly on the device. It comes with headers in the box, so the end user can use it as a breakout board or solder the headers like I did for mounting on a breadboard or prototyping shield. All DFRobot products are high quality devices, including this one. Easy to mount with two holes on one side. The wiki covers all it’s features and has dimensional drawings,3D model to download, data sheet, and schematic.

The Mini is better suited for sound fx with ease in the flow of commands , but on the Pro, it appears it was designed for either just playing music based on it’s ability to be used as a sound card, or using a file with multiple fx created by the user. With the commands fastForward, fastReverse & setPlayTime, it appears it was geared to jump within a file more than separate files for each fx. The commands; next, last, start, and pause controll the flow between files. I think it’s much easier to use playSpecFile, and playFileNum to control and keep track of what you are wanting to control. I’m still puzzled about delCurFile!

The price of a micro SD card pushes up the price of the Mini substantially to equal that of the Pro. It’s much easier to upload files directly to the device rather than change an SD card for your files. The use of a USB-C cable makes this easy to install your files

The quality of construction on the Pro is much better than the Mini. Many Mini knockoff’s have been reported by users to be defective upon arrival. It appears there were two batches of the Mini; one had DFPlayer Mini silkscreened on the card (DFRobot Brand), and the defective ones had mp3 player on them.

On the Pro the built in amp seems to be more powerful than on the Mini. I couldn’t use those small speakers on the highest range of the Pro, with the Mini there was still a need for more volume at the highest setting.

Hard coding a delay is the biggest drawback with the Pro. If you change the sound files, you also have to change the code to correspond with the new clips. I was hoping the Play Pin would be of use, but it just outputs a constant 3.3v. Eliminating the Busy Pin was a big mistake!

Help on the Forum and FAQ is minimal. Most responses fron Tech Support on FAQ asks the poster to send them an email, which leaves out everyone else from a solution. There were two suggestions from users about how to use the AT commands, neither one worked for me. There was a post on the Forum stating shorting the Play to Gnd would act like the onboard button to advance to the next track. I hope nobody tried that cause that just shorts out the Play pin. Maybe they meant shorting the Play Pin to Key Pin, that would make more sense. I did not try that! I’ll update this when I do!

Hopefully in the future there will be more information on the DFPlayer Pro, via YouTube Videos. This product has been available for nearly 18 months and my video is the first on YouTube other than the promo from the developer.
The Library on GitHub with the included example is just like most products that just barely scratch the surface of what it can do. Maybe more will start using this device and post their project on GitHub and YouTube!