Introduction
The DFPlayer Mini MP3 Player For Arduino is a small and low cost MP3 module with an simplified output directly to the speaker. The module can be used as a stand alone module with attached battery, speaker and push buttons or used in combination with microcontrollers such as Arduino, ESP32, Raspberry Pi and any microcontrollers with Uart.
Specification
- Sampling rates (kHz): 8/11.025/12/16/22.05/24/32/44.1/48
- 24 -bit DAC output, support for dynamic range 90dB , SNR support 85dB
- Fully supports FAT16 , FAT32 file system, maximum support 32G of the TF card, support 32G of U disk, 64M bytes NORFLASH
- A variety of control modes, I/O control mode, serial mode, AD button control mode
- advertising sound waiting function, the music can be suspended. when advertising is over in the music continue to play
- audio data sorted by folder, supports up to 100 folders, every folder can hold up to 255 songs
- 30 level adjustable volume, 6 -level EQ adjustable
Application
- Car navigation voice broadcast;
- Road transport inspectors, toll stations voice prompts;
- Railway station, bus safety inspection voice prompts;
- Electricity, communications, financial business hall voice prompts;
- Vehicle into and out of the channel verify that the voice prompts;
- The public security border control channel voice prompts;
- Multi-channel voice alarm or equipment operating guide voice;
- The electric tourist car safe driving voice notices;
- Electromechanical equipment failure alarm;
- Fire alarm voice prompts;
- The automatic broadcast equipment, regular broadcast.
Pin Map
Work Mode
1. Serial Mode
Support for asynchronous serial communication mode via PC serial sending commands Communication Standard:9600 bps Data bits :1 Checkout :none Flow Control :none
- Instruction Description
- Serial Control Cmd
- Serial Query Cmd
2. AD KEY Mode
We use the AD module keys, instead of the traditional method of matrix keyboard connection, it is to take advantage of increasingly powerful MCU AD functionality, Our module default configuration 2 AD port, 20 key resistance distribution.
Get AD Button from DFRobot Store or DFRobot Distributor.
- Refer diagram

3. I/O Mode
Here comes the most simple way to use this module.
- Refer diagram

note: short time press means pre/next,and long time press means vol- ,vol +
Connection Diagram
Note: The operating voltage of DFPlayer mini is 3.3 V, while most of the Arduino's operating voltage is 5 V. After our test, although it is possible to play music normally by directly connecting the Arduino directly to DFPlayer mini, there may be abnormal noises appearing. We recommend you to connect a 1k resistor in series with the RX pin of DFPlayer for voltage divider.
Copy your mp3 into you micro SD card
NOTE: The order you copy the mp3 into micro SD card will affect the order mp3 played , which means play(1) function will play the first mp3 copied into micro SD card.
For Mac User
NOTE: If you are using Mac OS X to copy the mp3, the file system will automatically add hidden files like: "._0001.mp3" for index, which this module will handle as valid mp3 files. It is really annoying. So you can run following command in terminal to eliminate those files. Please replace the |
Sample Code
We've created an Arduino library for DFPlayer Mini to simplify the method for you to make it work. Connect the hardware as the picture above shown and play with the sample code. You can download the latest library here: DFRobotDFPlayerMini.
Sample code "GetStarted", switching to next song every 3 seconds
Sample code "FullFunction", including all the functions. Please read the comments and documents in detail
NOTE: The folder name needs to be mp3, placed under the SD card root directory, and the mp3 file name needs to be 4 digits, for example, "0001.mp3", placed under the mp3 folder. If you want to name it in Both English and Chinese, you can add it after the number, for example, "0001hello.mp3" or "0001后来.mp3".