Module – DFPlayer Mini – MP3 Speler
Hardware
Informatie (ENG):
The DFPlayer Mini MP3 Player For Arduino 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 Arduino UNO 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
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.
Seriele Communicatie
De module werkt via asynchrone seriële communicatie
- Standaard: 9600 bps
- Data bits: 1
- Checkout: none
- Flow Control: none
Instructie opbouw:
Seriële commando’s:
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.
I/O Mode
Here comes the most simple way to use this module.
Versie 1 (DFPlayer mini)
YX5200-24SS chip: MP3 decoding serial chip
The YX5200 is an MP3 chip that provides a serial port, which is a perfect integrated hard decoding of MP3 and WMV. Simultaneously The software supports TF card driver and supports FAT16 and FAT32 file systems. Complete the broadcast with a simple serial command Put the specified music, and how to play music, etc., without the cumbersome underlying operation, easy to use, stable and reliable It is the biggest feature of this product. In addition, the chip is also a deeply customized product, designed for USB card readers, USB sound A low-cost solution developed in the field of cards and fixed voice playback
8002 chip: Versterker
The 8002 is an audio power amplifier primarily designed for demanding applications in low-power portable systems. It is capable of delivering 3 watts of continuous average power to an 3Ω BTL load with less than 10% distortion (THD) from a 5VDC power supply. the 8002 does not require output coupling capacitors or bootstrap capacitors, and therefore is ideally suited for mobile phone and other low voltage applications where minimal power consumption is a primary requirement.the 8002 features a low-power consumption shutdown mode.the 8002 contains advanced pop & click circuitry which eliminates noise which would otherwise occur during turn-on and turn-off transitions. The 8002 is unity-gain stable and can be configured by external gain-setting resistors.
Versie 2 (MP3-TF-16P)
FN5201-24SS chip: MP3 decoding serial chip (kloon?)
8002 chip: Versterker
Andere Versies (DFPlayer mini kloon)
AA1828CJ5M2U chip: MP3 decoding
AA1752CJ2R3R chip: MP3 decoding
onbekende chip: Versterker
Pinout
SD Kaart
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 <SDVolumeName> to the volume name of your SD card. |
Arduino
Sluit de module aan volgens onderstaand overzicht:
Script
Wat heb je nodig?
Chip:
AA1828CJ5M2U
YX5200-24SS
FN5201-24SS
werkt met DFRobotDFPlayerMini bibliotheek.
AA1752CJ2R3R
werkt met DFPlayer_Mini_Mp3 bibliotheek.
DFRobotDFPlayerMini bibliotheek
Deze code laat om de 3 seconden een nummer spelen.
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 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
/*************************************************** DFPlayer - A Mini MP3 Player For Arduino <https://www.dfrobot.com/index.php?route=product/product&product_id=1121> *************************************************** This example shows the basic function of library for DFPlayer. Created 2016-12-07 By [Angelo qiao](Angelo.qiao@dfrobot.com) GNU Lesser General Public License. See <http://www.gnu.org/licenses/> for details. All above must be included in any redistribution ****************************************************/ /***********Notice and Trouble shooting*************** 1.Connection and Diagram can be found here <https://www.dfrobot.com/wiki/index.php/DFPlayer_Mini_SKU:DFR0299#Connection_Diagram> 2.This code is tested on Arduino Uno, Leonardo, Mega boards. ****************************************************/ #include "Arduino.h" #include "SoftwareSerial.h" #include "DFRobotDFPlayerMini.h" SoftwareSerial mySoftwareSerial(10, 11); // RX, TX DFRobotDFPlayerMini myDFPlayer; void printDetail(uint8_t type, int value); void setup() { mySoftwareSerial.begin(9600); Serial.begin(115200); Serial.println(); Serial.println(F("DFRobot DFPlayer Mini Demo")); Serial.println(F("Initializing DFPlayer ... (May take 3~5 seconds)")); if (!myDFPlayer.begin(mySoftwareSerial)) { //Use softwareSerial to communicate with mp3. Serial.println(F("Unable to begin:")); Serial.println(F("1.Please recheck the connection!")); Serial.println(F("2.Please insert the SD card!")); while(true); } Serial.println(F("DFPlayer Mini online.")); myDFPlayer.volume(10); //Set volume value. From 0 to 30 myDFPlayer.play(1); //Play the first mp3 } void loop() { static unsigned long timer = millis(); if (millis() - timer > 3000) { timer = millis(); myDFPlayer.next(); //Play next mp3 every 3 second. } if (myDFPlayer.available()) { printDetail(myDFPlayer.readType(), myDFPlayer.read()); //Print the detail message from DFPlayer to handle different errors and states. } } void printDetail(uint8_t type, int value){ switch (type) { case TimeOut: Serial.println(F("Time Out!")); break; case WrongStack: Serial.println(F("Stack Wrong!")); break; case DFPlayerCardInserted: Serial.println(F("Card Inserted!")); break; case DFPlayerCardRemoved: Serial.println(F("Card Removed!")); break; case DFPlayerCardOnline: Serial.println(F("Card Online!")); break; case DFPlayerPlayFinished: Serial.print(F("Number:")); Serial.print(value); Serial.println(F(" Play Finished!")); break; case DFPlayerError: Serial.print(F("DFPlayerError:")); switch (value) { case Busy: Serial.println(F("Card not found")); break; case Sleeping: Serial.println(F("Sleeping")); break; case SerialWrongStack: Serial.println(F("Get Wrong Stack")); break; case CheckSumNotMatch: Serial.println(F("Check Sum Not Match")); break; case FileIndexOut: Serial.println(F("File Index Out of Bound")); break; case FileMismatch: Serial.println(F("Cannot Find File")); break; case Advertise: Serial.println(F("In Advertise")); break; default: break; } break; default: break; } } |
DFPlayer_Mini_Mp3 bibliotheek
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 |
/******************************************************************************* * 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: DFRobot * name: DFPlayer_Mini_Mp3 sample code * Author: lisper <lisper.li@dfrobot.com> * Date: 2014-05-30 * Description: connect DFPlayer Mini by SoftwareSerial, this code is test on Uno * Note: the mp3 files must put into mp3 folder in your tf card */ /* 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 (); */ #include <SoftwareSerial.h> #include <DFPlayer_Mini_Mp3.h> SoftwareSerial mySerial(10, 11); // RX, TX void setup () { Serial.begin (9600); mySerial.begin (9600); mp3_set_serial (mySerial); //set softwareSerial for DFPlayer-mini mp3 module delay(10); mp3_set_volume (25); mp3_play (1); mp3_next (); } void loop () { // Geen delays plaatsen (stopt audio) } |
Uitgang voor versterker
Het is ook mogelijk de “versterker” uitgangen te gebruiken, het schema:
Storingen en brommen voorkomen
Het kan veel voorkomen dat er ongewenste storingen of brommen te horen zijn, mogelijke oplossingen:
- Gebruik voor zowel RX en TX een 10K weerstand (seriële communicatie is 3.3V)
- Ontkoppel USB aansluiting (met een computer (via arduino))
- Voed de module extern met tenminste 5v 100mA
- Zorg voor een goede aarding (GND)
Bron(nen):
Arduino Library
Installatie van Arduino IDE libraries: Arduino info
DFRobotDFPlayerMini bibliotheek
This example shows the all the function of library for DFPlayer.
Created 2016-12-07 By Angelo qiao
GNU Lesser General Public License. See http://www.gnu.org/licenses/ for details. All above must be included in any redistribution
Notice and Trouble shooting
This code is tested on Arduino Uno, Leonardo, Mega boards.
DFPlayer-Mini-mp3 bibliotheek
DFPlayer_Mini_Mp3, This library provides a quite complete function for DFPlayer mini mp3 module.
- DFRobotDFPlayerMini-1.0.5.7z 5,70 kb
- DFRobotDFPlayerMini-1.0.4.7z 5,70 kb
- DFRobotDFPlayerMini-1.0.3.7z 5,70 kb
- DFRobotDFPlayerMini-1.0.2.7z 5,10 kb
- DFRobotDFPlayerMini-1.0.1.7z 4,76 kb
- DFRobotDFPlayerMini-1.0.0.7z 4,79 kb
- DFPlayer-Mini-mp3 v1.0.7z 6,68 kb
Afmetingen
Schema
Teardown
GEEN GEGEVENS
Datasheet
Fritzing
Downloads
GEEN GEGEVENS