logo elektroda
logo elektroda
X
logo elektroda

DFPlayer Mini - a short description of a cheap MP3 player

grala1 13842 24
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • Hello all.
    I would like to introduce you to a cheap Chinese MP3 player - DFPlayer Mini.
    The cost of such a player is less than $ 1.5.
    DFPlayer mini has the ability to play music in MP3 or WAV format from the built-in micro SD card reader, you can also play music by connecting a USB flash drive to the player. The storage medium should not be larger than 32GB and should be FAT16 or FAT32 format.
    This player has the ability to control both by connecting goldpins and through the UART interface with a speed of 9600 bps.
    It has dimensions of 20.5 x 20.5 x 13 mm.
    DFPlayer Mini - a short description of a cheap MP3 player
    DFPlayer Mini - a short description of a cheap MP3 player
    I became interested in the player after reading the article of one of the forum users, where he described a changer emulator he had created for cars of the VAG group.
    https://www.elektroda.pl/rtvforum/topic3380561.html
    The player was ordered directly from China, after 3 weeks it was in my hands.
    Basic "analog" control is shown in the picture below.
    DFPlayer Mini - a short description of a cheap MP3 player
    This way, you can turn on the next / previous track, turn it down / up.
    You can connect a small speaker directly to the player - I used 1.5W 8?.
    Unfortunately, the device has an output only for one loudspeaker, but you can get stereo through the DAC_R, DAC_L outputs where you should connect them through an amplifier or you can connect headphones here.
    The device can be powered from 5V, power consumption less than 15mA, increases when you connect a USB device.
    Tracks recorded on a storage medium should be properly named - e.g. 001, 002 etc. Tracks should be grouped in folders that are also numbered - 01, 02, etc.
    The maximum number of folders is 99 and the maximum number of songs in a folder is 255.
    If we do not use the control that turns on the appropriate track number, we will only use the previous / next track, then tracks and folders can be named freely.
    Below is the player pinout
    DFPlayer Mini - a short description of a cheap MP3 player
    As for communication via UART, use the settings as in the picture below.
    DFPlayer Mini - a short description of a cheap MP3 player
    It should be remembered that although the device is powered from 5V, the UART voltage level is 3.3V and for this reason, a 1k? resistor should be added between the Tx of the device sending the commands and the Rx of the player (if we use the 5v standard in the device sending the commands, at 3.3V the resistor is redundant). I used a 10k? resistor because I had one at hand.
    DFPlayer Mini - a short description of a cheap MP3 player
    The video below (sorry for not the best quality) shows sending commands using the COM Port Toolkit program and the USB-UART converter based on the FT232 chip.
    [movie: 6bf572119f] https://filmy.elektroda.pl/83_1511229427.mp4 [/ movie: 6bf572119f]
    The basic commands are:
    - next 0x7E FF 06 01 00 00 00 EF
    - previous 0x7E FF 06 02 00 00 00 EF
    - quieter 0x7E FF 06 04 00 00 00 EF
    - louder 0x7E FF 06 02 00 00 00 EF
    The above commands do not include checksums, they can be sent without sums or with a checksum.
    How to calculate the checksum?
    We count it in hexadecimal.
    The command with the checksum for switching on the next track is:
    7E FF 06 01 00 00 00 FE FA EF
    where FE FA is the checksum.
    We need to add FF + 06 + 01 + 00 + 00 + 00 = 106 together
    0-106 = FA EF which gives our checksum.
    When sending a command to the device, you can request a response and it will be clear that the command has been understood.
    In the video below, a short presentation of the player control through the AVR processor which supports the buttons (NEXT, PREV, VOL +, VOL-) here, then sends the appropriate commands, receives from the device information about the current SD card or connected USB drive and sends the command 0x7E FF 06 01 00 00 00 EF for sequential playback of tracks. There is also a remote control via IR.
    [movie: 6bf572119f] https://filmy.elektroda.pl/18_1511229716.mp4 [/ movie: 6bf572119f]
    The disadvantages that I noticed with this player are the inability to connect a second loudspeaker, no possibility of scrolling, no memory of the track being played after turning off the power and the volume set, no possibility to play songs in the order with "analog" control (feeding the mass to the appropriate goldpins) - after the end of playback track, you have to force the next track to play, this problem can be avoided when controlling via UART.

    The player can be used to build a watch where you can hire it to play the bugle call at the full hour or as a wake-up call, an MP3 doorbell, etc.
    Below is the documentation for the DFPlayer mini.

    Cool? Ranking DIY
    About Author
    grala1
    VAG group specialist
    Offline 
    grala1 wrote 9756 posts with rating 4844, helped 1476 times. Live in city Kalisz. Been with us since 2006 year.
  • ADVERTISEMENT
  • #2 16839763
    Marek_Ertew
    Level 16  
    Allow me to attach a handful of comments to expand the description.

    1. The module can act as a card reader. After connecting it to the computer, the playback is interrupted and the inserted SD card is visible in the system as a normal USB memory. I recommend connecting the uUSB socket to the module and alternately connecting a standard USB cable or a USB OTG cable to it (a USB memory stick is plugged into the socket).
    Pay attention to the supply voltage!

    2. If we are talking about voltage, the guts of the module are powered by 3v3 voltage which also powers the USB, SD and UART interfaces. The module has a built-in stabilizer and can be powered with voltage from 3v3 to 5v. Therefore, the entire module can be connected to 3v3 and 5v only to the USB socket.

    3. According to the documentation, the checksum and response request are recommended when uC is clocked with the built-in RC oscillator or ceramic resonator. When using quartz, the checksum can be omitted, not sending these two bytes.
    I fired my module using the arduino library that sends the checksum. Unfortunately, I currently have no way to check whether the module will work without checksums. I gave my art in the name of a higher idea, I am waiting for another one.

    4. There are also other addressing modes. For example, you can address 3,000 files in a single directory or suspend the current music, play a short message and go back to suspended music. Unfortunately, I will not check that either.
  • #3 16841488
    ditomek
    Level 22  
    How about the sound quality?
    Can the module be used to build a stationary mp3 (as another element of a stereo system)?
  • #4 16841508
    grala1
    VAG group specialist
    I am not an audiophile but for me the sound is ok in the loudspeaker and headphones, I tested it in the car and it sounds quite good to me.
    As I wrote earlier, one of the users made a car changer emulator on it, so let me quote his statement:
    GrzesiekN wrote:
    Just back from assembling in the car. Earlier, I wrote that the audio signal quality is very good. I made that statement by looking at the oscilloscope while playing test signals on my desk. Now I can say that I wouldn't change anything. Everything from the sub-bass to the whistle works. I do not expect a complaint.
    best regards
  • #5 16842194
    Marek_Ertew
    Level 16  
    I cannot complain about the sound quality. Only interference occurs when uC is sending data to the module. This is how I used uC powered by 5V and gave a 2k resistor on the uC-> module data line.

    However, the module lacks:
    - reading the current playback position,
    - rewinding or playing from a specific point in time,
    - access to the file system, e.g. reading the name of files / directories,
    - the simplest play queue, eg the command "when you finish the current file, open the indicated".
    I guess I'm asking too much ;) It remains to look for a better alternative at an equally attractive price.
  • #6 16842249
    grala1
    VAG group specialist
    I have 10k and I can't hear any noise.
    As for reading the current position, you can set a timer that will count from the moment of information from the player that a new track is coming and reset it when the information about playing the next track appears again.
    Queuing could also be done, you only need to hire a processor. If the songs are to be played one after the other, from what I remember it is command 11.
    There is no reading of the track names and no scrolling what I wrote about at the beginning.
  • #7 16869444
    silelis
    Level 12  
    I have two questions regarding this module:
    1) Is there a 10 ohm resistor on the USB D + and D + lines ??? Usually, I have encountered such a solution, is it here on the module?
    2) What size capacitors should I give for DAC_L and DAC_R ?? Are these also on the module ??
  • ADVERTISEMENT
  • #8 16869454
    grala1
    VAG group specialist
    I do not use any resistors at the USB connector and no capacitors at the speaker output.
  • #9 16884951
    silelis
    Level 12  
    I have a question regarding the naming of folders and files on the medium.

    The datasheet says that they must be in the form 001, 002, 003, 00N, where the name of the first directory need not be 001, but e.g. 007 and it will be the first in the command.

    And has anyone checked whether directories can be called names (without letters) and whether directory numbers are then sorted alphabetically?

    The same goes for the names of the songs. I am asking because the nomenclature by numbers is quite artificial and is average for commercial applications.
  • ADVERTISEMENT
  • #10 17036384
    wojdyl1
    Level 9  
    Hello,
    encouraged by a simple mp3 player, I bought this module.
    I connected according to the instructions (from the very beginning of the post). 3.3V battery power, 0.5W 8 ohm speaker, and unfortunately it doesn't work for me. 1 GB micro SD card with FAT32 formatted and uploaded file 001.mp3. after turning on the power, nothing happens, when I press playback, the light on the module lights up, then it goes out and a short humming sound starts from the speaker. After that, everything goes silent.
    Do you have any ideas on how to start it? I will be grateful for any idea. I only have a meter and a soldering iron :)
  • #11 17036542
    grala1
    VAG group specialist
    Try to supply 5V.
    If this does not help, disconnect the speaker and then check if the diode goes out.
    I had the same and it looked like the speaker was overloading the module.
  • #12 17036676
    Marek_Ertew
    Level 16  
    @ wojdyl1 , I bet that the amplifier and speaker overload the 3.3V stabilizer, the voltage drops out and therefore everything turns off. Try to connect speakers with an amplifier to the line output, or as a last resort headphones through a serial capacitor between the stereo output (one channel is enough) and ground.

    The second option is as advised @ grala1 , increasing the supply voltage. In my opinion the 3.3V supply voltage is too low for this module. The "guts" of the module and the SD card require a voltage of 3.3V, but the player has a built-in stabilizer. In my opinion, the supply voltage should be at least 3.6V (discharged li-ion battery) and max 5V.
    The only thing you need to be careful about is the controls. If you connect the player to a 5V microprocessor, you need to add a serial 1k resistor on the uC (TX) -> player (RX) line.
  • #13 17036737
    wojdyl1
    Level 9  
    Thank you very much for the hint, I checked and everything is correct, the loudspeaker was too heavy on the module.
    Now I plugged in the earpiece and everything started to work.
    Thank you again.

    Added after 40 [minutes]:

    I have one more question, what external speaker can I use for the module so that it works well reproducing the speech, only 3.3V power supply without amplifier.
    Headphones are not an option. What were you using?
  • #14 17038014
    Marek_Ertew
    Level 16  
    The player has two audio outputs that work simultaneously. One is a stereo line output (poor performance), the other is a mono output through the built-in amplifier (separate circuit on the PCB).

    Your speaker problem may lie in:
    1.too weak 3.3V power supply (the voltage drops under load),
    2. damaged amplifier or loudspeaker (I doubt it),
    3. the amplifier is just so designed that it does not want to work with a low supply voltage.
    Please write where did you get 3.3V voltage and why can't you use higher voltage? A lithium battery usually has a higher voltage and in most stationary devices you can find a voltage of 5V or higher (a stabilizer is included).
    If you can't win with the supply voltage, replace the speaker with any other one (maybe the one has a short circuit) and put voltage filtering capacitors near the player.
    If both of the above methods fail, then playing with a special loudspeaker will not be of much use. The final solution is to add an additional amplifier. For example, PAM8302 available e.g. here: https://www.adafruit.com/product/2130 will work at 3.3V and in combination with a 4? speaker you have a chance to get almost 1W power.
  • ADVERTISEMENT
  • #15 17048303
    wojdyl1
    Level 9  
    it turned out that the power supply did not give the correct current and therefore the module could not cope, and only with a low load you could listen to something. I installed the batteries on the phone and everything started working. Thank you for your help.
  • #16 17101155
    umbrella2
    Level 9  
    Hi.
    I wanted to assemble a toy for my little ones on this particular layout, but I have a problem.
    I wish I could run 36 songs with 36 buttons.
    I can see that direct control can be done via ADKEY1 and 2 ports but unfortunately selecting tracks with this method ends up at position 14.
    So the control had to be done through the arduino and the RX and TX ports. I just don't know how to do it. I found the KEYPAD library here:

    Link

    but how to assign path names there.

    Please help. The little ones will probably be delighted if Dad succeeds.
  • #17 17544241
    Tomek515
    Level 23  
    Could this module be used in such a way that after applying voltage it would automatically play the path?

    Maybe you can recommend something else ready that could perform such functions
  • #18 17667391
    Bogdan 6
    Level 15  
    And here you have my program for operating this MP3 with a selection of folders for the remote control, you have to read the remote control codes yourself using arduino
    Code: C / C++
    Log in, to see the code
  • #19 20154658
    jankus
    Level 2  
    Hello!
    I have a different kind of problem.
    I did so that it uses resistors to recreate certain folders / files in a folder.
    It works fine, but ... the problem is that if you hold a certain button longer, it plays in a loop indefinitely until the power goes out or another button / track is pressed.
    Does anyone have an idea how to disable / work around this problem?
    I was figuring out how to cut off the mass here for some time after pressing the button ... but unfortunately I did not come up with anything.
    The button is monostable and has only one make contact.
    Maybe some relay with a capacitor backup ... I didn't think of anything clever.
    Any simplest solution to this problem?
    Kind regards
    ps As a last resort I will add some Tiny or Nano but I'd rather avoid it because it's about a few pieces that I have already made.
  • #20 21408675
    Justyniunia
    Level 36  
    Hi.

    Since the module is described here - I am not creating a new topic.
    I have 3 questions.

    If I only have one short sound on the memory card, is it:

    1. when the module is powered up, will it play it immediately?
    2. will this one sound fly in a loop or only once?
    If any of the above are NO, then will:
    3. feeding ground pulses to ADKEY1 will cause this one sound to repeat, or is it enough to connect ADKEY1 permanently to ground to make the sound fly in a loop?

    We operate the module without using the uC!

    Please owners to check if possible.
    Thank you in advance.
  • #21 21408798
    Bogdan 6
    Level 15  
    Hi Justyna.

    In answer to your question:
    1. yes it will play straight away
    2. in a loop
  • #22 21408824
    Justyniunia
    Level 36  
    Thank you very much
    One more question, as I see on the DS that many more buttons can be connected to it.

    When you set the mode e.g. loop play and volume, does the module remember the settings when the power is switched off?
  • #23 21409452
    Bogdan 6
    Level 15  
    Rather not. These and other settings are pre-stored in the DF memory as defaults triggered when the DF starts or received from an external controller.
    An additional microcontroller with an interrupt handler programme is used to control the levels and mode.

    const int receive = A0;
    IRrecv irrecv(receive);
    decode_results dec;
    int volume = 15; // default 15
    int eqset = 0;
    boolean playing = false;
    void setup ()


    void playFirst()
    {
    exe_cmd(0x3F, 0, 0);
    delay(100);
    exe_cmd(0x06, 0, volume);
    delay(100);
    exe_cmd(0x11, 0, 1);
    delay(100);

    Details of how to control are included in the manual. DF

    Added after 7 [minutes]:

    You should also use original DF, because there are 3 types of fakes for pennies from 5-20zł
    In the case of fakes, not all functions work properly due to the software of the first beta series.
    As proven ones I recommend DFR0299DFROBOT https://www.tme.eu/pl/details/df-dfr0299/moduly-audio/dfrobot/dfr0299/.
    This is what I used for my MP3 player project

    Added after 10 [minutes]:

    https://wiki.dfrobot.com/search/DFR0299
  • #24 21409526
    Justyniunia
    Level 36  
    I am keen to play one sound in a loop when the power is switched on (if this works), alternatively the power will be on permanently and I will feed pulses to trigger this sound cyclically.
    The uC will be on board the device, but will take care of something else.

    There are slightly larger players on the market for £10 and they meet my needs, but I'm looking for something smaller.

    Well I have just ordered 10pcs of these at 3.5zl each, hopefully they will be able to run in my unusual application....

    I don't have big requirements.
  • #25 21489206
    Justyniunia
    Level 36  
    The situation is as follows:
    Out of 10pc came 5 players older (red led) and 5 new V. 3 (Led blue, of course)
    The new ones, once they play quieter, cannot play wave files.
    The old ones have no problem with this and play much louder.

    The ADD2 line doesn't work in both of them, or I'm doing something wrong, but overall I don't need it, so ok.

    It's just a shame that they don't remember settings such as volume.
    For the older players I have to process the sound files (turn them down) to make both versions play at a similar level.

Topic summary

The DFPlayer Mini is an inexpensive MP3 player module capable of playing MP3 and WAV files from a micro SD card or USB flash drive, supporting up to 32GB in FAT16 or FAT32 format. It operates on a supply voltage of 3.3V to 5V and features UART control at 9600 bps. Users have reported satisfactory sound quality for both speakers and headphones, although some noted issues with interference when using a microcontroller (uC) for data transmission. The module lacks advanced features such as current playback position tracking, rewinding, and file system access. Users have shared experiences with power supply issues, suggesting that a higher voltage may be necessary for optimal performance. The module can be integrated into various projects, including car changer emulators and remote-controlled audio systems. Discussions also included technical queries about component connections and file naming conventions for playback.
Summary generated by the language model.
ADVERTISEMENT