Mini MP3 Player Interfaced with Arduino
The DFPlayer Mini MP3 Player is a small and low price 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 an Adruino or any other with RX/TX capabilities.
Specification
- Supported 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
Pinout
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 Command
- Serial Query Command
- Serial Command using Docklight Software
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.
Here comes the most simple way to use this module.
Diagram
Note:Short time press means pre/next,and long time press means vol- ,vol + .
Connection Diagram
Note: For simple use ,the upper diagram is ready,But if you find the noise is quite loud, then you could attach an 1K resistor to the TX pin.
Select Example code for UART and SOFT_UART.
Sample Code
We’ve created an Arduino library for DF Player 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.
Download the zip file given below and install it in the arduino platform. The suitable header files and sample codes are there in the file itself.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
/******************************************************************************* * DFPlayer_Mini_Mp3, This library provides a quite complete function for * * DFPlayer mini mp3 module. * * www.github.com/dfrobot/DFPlayer_Mini_Mp3 (github as default source provider)* * DFRobot-A great source for opensource hardware and robot. * * * * This file is part of the DFplayer_Mini_Mp3 library. * * * * DFPlayer_Mini_Mp3 is free software: you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation, either version 3 of * * the License, or any later version. * * * * DFPlayer_Mini_Mp3 is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * * DFPlayer_Mini_Mp3 is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with DFPlayer_Mini_Mp3. If not, see * * <http://www.gnu.org/licenses/>. * * * ******************************************************************************/ /* * Copyright: Rhydo labz * name: DFPlayer_Mini_Mp3 sample code * Author: --- * Date: 2014-05-30 * Description: sample code for DFPlayer Mini, this code is test on Uno * note: mp3 file must put into mp3 folder in your tf card */ //#include <SoftwareSerial.h> #include <DFPlayer_Mini_Mp3.h> // void setup () { Serial.begin (9600); mp3_set_serial (Serial); //set Serial for DFPlayer-mini mp3 module delay(1); //wait 1ms for mp3 module to set volume mp3_set_volume (15); } // void loop () { mp3_play (1); delay (6000); mp3_next (); delay (6000); mp3_prev (); delay (6000); mp3_play (4); delay (6000); } /* mp3_play (); //start play mp3_play (5); //play "mp3/0005.mp3" mp3_next (); //play next mp3_prev (); //play previous mp3_set_volume (uint16_t volume); //0~30 mp3_set_EQ (); //0~5 mp3_pause (); mp3_stop (); void mp3_get_state (); //send get state command void mp3_get_volume (); void mp3_get_u_sum (); void mp3_get_tf_sum (); void mp3_get_flash_sum (); void mp3_get_tf_current (); void mp3_get_u_current (); void mp3_get_flash_current (); void mp3_single_loop (boolean state); //set single loop void mp3_DAC (boolean state); void mp3_random_play (); */ |
Applications
- GPS based navigation voice broadcast;
- For producing Warning alarm as voice;
- Voice prompts in railway stations, bus stations, airports etc.;
- Voice prompts for Security alerts
Shop With Us
- Click here to buy a Mini MP3 Player Module
- Click here to buy Arduino Boards
Leave a Reply
You must be logged in to post a comment.