DFPlayer - A Mini MP3 Player (DFR0299)

This is a placeholder topic for “DFPlayer - A Mini MP3 Player” comments.



Sing for the moment! The DFPlayer Mini 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 an Arduino UNO or any other with RX/TX capabilities.


Read more

3 Likes

Clearly this Mini MP3 Player supports many applications and configurations. Would oner of these applications be a simple player that commences playing whatever is stored on the SD card as soon as +5VDC power is applied to the module?



Regards,



Ross

3 Likes

Bought 2 of these some time ago, very happy with them. One for project, one as spare.
Will do a test later and let you know. It will be today.
Cheers
Jim

3 Likes

Jim,

Thanks for your help. Looking forward to your test result.

Ross

2 Likes

Hi Ross,

Reading over the information from DFRobot, they will start playing when an SD card is inserted, but I couldn’t see anywhere mentioning if you can configure it to start playing on power-up without an external microcontroller to do that for you.

Will have to wait and see what Jim discovers! :slight_smile:

4 Likes

The answer is YES !!!

Connected a speaker from an old PC stereo system. (audio is quite loud and not high fidelity)
Connected ADKEY1 to GND.
Connected 5V and it played first audio track to last audio track.

Keeping ADKEY1 to GND did not stop it playing the next track.
Once the last track was played it looped back to the start again.
The only thing I did was to turn on the 5V supply at the start.

Didn’t try anything with IO1 & IO2 which are supposed to change the volume level.

Cheers
Jim

5 Likes

Awesome work Jim! Thanks for your help! :smiley:

2 Likes

James,

Great effort and result. I’ll now buy one. I will use it to replace the music circuit of a Christmas ornament that died.

Thanks a lot for your support.

Regards,

Ross

6 Likes

You may need to drop the Audio level to suit your speaker.
For such a small device the output level is quite high. (3W)
The Audio fidelity is pretty poor too.

Hope it suits what you intend to do with it.
Cheers
Jim

5 Likes

Jim,

Thanks for the extra advice.

Regards,

Ross

3 Likes

Hi there!
I’ve just bought a DFPlayer and am having some issues with it.
I want to use it as a music player connected to a RPi Pico (non-wireless).

I have interfaced it to the Pi by using the instructions and serial commands on the wiki.
I have it connected to a 0.25W speaker directly via the “SPK_1” and “SPK_2” pins and have followed the instructions on the wiki on how to put the mp3 files on the SD card.
I have uploaded the code from the wiki and it says when run:

DFRobot DFPlayer Mini Demo
Initializing DFPlayer … (May take 3-5 seconds)
Unable to begin:
1.Please recheck the connection!
2.Please insert the SD card!

I have done both of these things and it still returns the same error.
Does anybody have an explanation for this?

Thanks,
Amanda

1 Like

Hi Amanda,

Welcome to the forum!!

How did you format the SD card? It mentions that FAT filesystems are the only ones supported (hence 32GB maximum).

Awesome job porting the code! Fingers crossed it gets running :slight_smile:

Hey Liam,

I used a 16GB SD card, and formatted it with FAT32 using Disk Utility.

I uploaded a song after I formatted the SD card and titled it 0001.mp3. I have tried placing the song in both the root directory and a folder called mp3, as the note at the borrow of the wiki made this unclear. Neither one works, and they both output the text I posted earlier.

Thanks,
Amanda

1 Like

Hi Amanda,

That setup looks exactly as the instructions mention.
Other than maybe using a Windows PC (if available)

This topic has a couple of other methods that other Makers used to get it working https://www.reddit.com/r/raspberrypipico/comments/q19v0n/dfplayer_with_pico/

I’d love to hear that something on the above topic works,

It might also simply be faulty!

If you are using a Mac note the following from the Wiki page.

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.

dot_clean /Volumes/<SDVolumeName>

Please replace the to the volume name of your SD card.

Regards
Jim

3 Likes

Hey, Liam and James,

I checked all the posts in that reddit forum and found nothing that would get it working.
The closest I could get was somebody posted a link to this GitHub repo, but that was TX-only. The README says that if you want RX as well, then you should use this file. I tried that on my MicroPython Pico, but it keeps returning a similar error to the Arduino program from the wiki:

KT403A could not be initialized.

As for the hidden files, I have already run that command. It throws no error, but I check both beforehand and after running the command and there were no hidden files except the usual folders that MacOS creates on external volumes.

Thanks,
Amanda

3 Likes

Hi Amanda
I too use a Mac but also have a Windows laptop. I think I have had a bit of a problem in the past with flash drives formatted in the Mac and play on say a TV set. You might do better if you formatted in the device you are going to play it in. That is format the card in the RPi. Then write from the Mac.
The Mac will read and write to Fat32 devices but will only read NTFS. Will not write to that.
Cheers Bob

4 Likes

Hi all,
I have the DFPlayer with a MicroSD card & 3w speaker and have managed to get the single MP3 file to play when powered on thanks to jumping ADKEY1 & GND.
However it plays the short audio file on loop whereas I only want it to play once then stop. How should I go about doing this?
Bonus points if there’s a way to play a short 1-2 second audio file on power down too.
I only want to use the MicroSD card and not mess around with an Arduino or Raspberry Pi…
Cheers,
Nathan

Bump!

This is causing the loop.
ADKEY1 & ADKEY2 are analog inputs, changing resistor changes function. See Wiki Doc.
Changing the jumper to a momentary switch will stop it looping.
You could try the pause/play (33k) as per diagram below and see it that causes a loop.

Playing a file on power down depends on how you power it down.
Simply switching off power will not allow time for a file to play, you would need to delay the power off. This could be done by the way you connect the switch and other components.
You could use a mosfet to provide power and a capacitor to hold it on long enough for the file to play when activating the power off switch.

Regards
Jim