Will I Blow this Up? - DFPlayer Mini as Micro SD Storage

I have a DFPlayer Mini. In its documentation it does not appear to have any way to write files to the micro SD card.

If there is no functionality to send a file to write via UART I was thinking I would just solder lines directly to the pins of the micro SD card holder and use the Arduino SD library to write to it.

Great idea or super awesome spectacular idea?

My concerns are:

I don't want to blow up my microcontroller, I only have a few.
I'd like to steer clear of ruining the SD card.
I am not worried about the DFPlayer Mini so much, I have 200 of them and they were inexpensive.

Is this just a dumb idea that won't even theoretically work and would be futile to even try? I have zero understanding of what components the SD card holder is already soldered to.

Is this just a dumb idea that won't even theoretically work and would be futile to even try?

Close but not quite right.
As described no it would not work. This is because it involves wiring outputs together, the output pins from the player and the output pins from the Arduino. Imagine one output is high and the other is low. You have a short circuit and things will fry.

If however you arrange some tri-state buffers to separate all the outputs from each device into the SD card, then you may be able to switch access between the two systems. However it is not a design job for a beginner.

Awesome. Thank you for your help Grumps.

In lieu of a tri-state buffer, what do you think about this...

I cut power to the DFPlayer with one transistor and disconnect ground with another transistor when I want to do SD actions from the Arduino library.

This would be super easy for me to implement.

Maybe I'd only need one transistor to cut the DFPlayer's ground?

Still an amazing idea or has it reached best idea ever status already? What could go wrong?

Thanks again for your help.

Thee_Captain:
I have 200 of them and they were inexpensive.

So you're the guy in all those elementary school math problems, lol.

In all seriousness, why do you want to write files to the SD card in the first place? Maybe an even better solution can be found if we all understand the underlying problem.

Thee_Captain:
I have a DFPlayer Mini. In its documentation it does not appear to have any way to write files to the micro SD card.

...

one would think that is because it is a player, not a recorder.

i don't know if this analogy is valid in this "new age" of one device with everything - but could you imagine picking up a hand-held FM radio receiver and then trying to use it as a phone/FM transmitter ?

The DFPlayer plays mp3's from a micro SD card in which the SD card slot is part of the DFPlayer PCB. It appears as though the DFPlayer does not have a systematic way of writing MP3 files to the SD card. The only way I have figured out how to get mp3's on the card is to remove the card, put it in my computer, and drag and drop the files on the card. Then I must physically put the SD card back into the DFPlayer.

I would like to be able to load mp3's over wifi.

Secondly, it would be nice to use all that free space on the SD card to write other data. The most important thing is that I don't have to remove the card to get new sound content on the SD card.

Thank you for your help.

BabyGeezer:
one would think that is because it is a player, not a recorder.

i don't know if this analogy is valid in this "new age" of one device with everything - but could you imagine picking up a hand-held FM radio receiver and then trying to use it as a phone/FM transmitter ?

Yes, but could you imagine picking up a hand-held FM radio receiver and then trying to change the frequency to your favorite channel and there's no knobs on the thing and you have to listen to 97.9 FM all day? If you knew what songs they played on that station, you'd solder on some pots to change the frequency!

I don't want to record sounds with the player hardware, I just want to play sounds that are not the same all the time. ; )

On a more serious note, why as the designer of the chip would you take away a massive functionality of the most expensive part of the board? Surely you can write files over serial. They've got a serial connection.

Also, they have undocumented USB connections which I think might be the real answer to my problem.

Thee_Captain:
Yes, but could you imagine picking up a hand-held FM radio receiver and then trying to change the frequency to your favorite channel and there's no knobs on the thing and you have to listen to 97.9 FM all day? If you knew what songs they played on that station, you'd solder on some pots to change the frequency!

IMO that's irrelevant to my analogy.

Thee_Captain:
I don't want to record sounds with the player hardware, I just want to play sounds that are not the same all the time. ; )

i believe you can write a program to select the tracks to be played.

Thee_Captain:
On a more serious note, why as the designer of the chip would you take away a massive functionality of the most expensive part of the board? Surely you can write files over serial. They've got a serial connection.
...

i don't know enough about serial communication to assume that as a given.

perhaps there is additional cost in making the hardware capable of two-way rather than just reading ?

cut power to the DFPlayer with one transistor and disconnect ground with another transistor when I want to do SD actions from the Arduino library.

No that would not work either.
What would happen is that the signals into the SD card would back power the audio player’s circuits and power it up, giving you exactly the same problem.

Hi,
I think you need to read the DFRobot documentation, the Player is just that, A PLAYER.
It has no hardware or firmware to record files to the SD Card.
The documentation informs you that you need a PC to load files onto the card.

The Player pins do not even allow you access to the SD Card directly, and where would you get the software to write to it if you could.

It is not designed for that job, especially at the low prices you can get them these days.

Tom... :slight_smile:

Just get a separate SD card board. Even cheaper than the DF player and you can use it to read and write files.

Get the proper tool (part) for the job, leave the DF players for playing audio files.

Grumpy_Mike:
No that would not work either.
What would happen is that the signals into the SD card would back power the audio player’s circuits and power it up, giving you exactly the same problem.

I figured something along these lines.

So even if I cut ground from the DFPlayer, the circuitry on the player could snake around somehow and get back to ground maybe on the ground pin of the SD card because I can't cut that if I want to use the Arduino SD library? Or possibly double up a voltage somewhere? Does this sound like I understand-ish?

TomGeorge:
I think you need to read the DFRobot documentation, the Player is just that, A PLAYER.
It has no hardware or firmware to record files to the SD Card.
The documentation informs you that you need a PC to load files onto the card.

Oh come on, it's not that I didn't read the documentation before I bought 200 of them, it's that my brain didn't tell me I couldn't access the SD card for writing. ; )

TomGeorge:
The Player pins do not even allow you access to the SD Card directly, and where would you get the software to write to it if you could.

Yes, I had come to the realization that the DFPlayer's pins don't give me access to the SD card . I was hoping Grumps was going to okay me bypassing the player pins and hooking straight up to the pins on the SD card. Turns out my incredible idea needs a tri-state buffer. Which I think would also need to be connected not where I can easily connect it? I'd need to buffer both when the player accesses the SD card and when the Arduino does as well? Which I'm thinking maybe I need to design my own sound decoder buffer type thing?

TomGeorge:
It is not designed for that job, especially at the low prices you can get them these days.

wvmarle:
Just get a separate SD card board. Even cheaper than the DF player and you can use it to read and write files.

Get the proper tool (part) for the job, leave the DF players for playing audio files.

I've bolded the following because this is the crux of my ten page essay I have concocted.

Right so I'm on board with getting the right parts for the job, but what does the job of playing music/sound from a micro SD card that I have interfaced to my ESP32 so that I can manage the files from a remote server?

Can I stream the songs through DFRobot's USB pins? I can't seem to find documentation for the USB pins on the DFPlayer.

BabyGeezer:
IMO that's irrelevant to my analogy.
i believe you can write a program to select the tracks to be played.

It wasn't supposed to be relevant to your analogy, it was supposed to be a different analogy that is relevant to the IC components. ; )

Yes, my microcontroller (DJ ESP) can definitely select mp3's from the prepared library like a DJ can put on whichever record he has at the station's library onto the turntable (DFPlayer's MP3 Decoder).

I love how the DJ is able to change the songs on the turntable, that's great. I just don't like the way the player is asking me to change stations, by removing the SD card and putting a different one in there. I would prefer that the player allow me to electronically hand it a new library.

I do also understand no matter how much I'd prefer to make a telephone call on an FM receiver, it won't change the fact that I'd need a whole bunch of new parts and there probably is no easy interface to hook it into the receiver.

BabyGeezer:
i don't know enough about serial communication to assume that as a given.

perhaps there is additional cost in making the hardware capable of two-way rather than just reading?

Yes, I think it is definitely that there would be more hardware needed at a minimum to share the SD card as Grumpy_Mike was saying. I'm sure other stuff as well.

Thank you everybody for your help and discussion.

Thee_Captain:
connected not where I can easily connect it? I'd need to buffer both when the player accesses the SD card and when the Arduino does as well? Which I'm thinking maybe I need to design my own sound decoder buffer type thing?

You have to connect it to the pins of the SD card adapter. So you need some mad soldering skills. Not recommended for 200 pcs (I do assume this is not meant as a one-off).

Right so I'm on board with getting the right parts for the job, but what does the job of playing music/sound from a micro SD card that I have interfaced to my ESP32 so that I can manage the files from a remote server?

I happen to have looked into this a few weeks ago, and failed to find anything.

The schematics of the DF Player Mini should be available; that you may use as a starting point to design your own board. The key of the problem is indeed to share the SD card (an SPI slave device) between two masters.

wvmarle:
You have to connect it to the pins of the SD card adapter. So you need some mad soldering skills. Not recommended for 200 pcs (I do assume this is not meant as a one-off).

Yes, but I would be willing to try soldering 50 to get ten for a prototype? After my design is done, I'd like 100. So you can see my mindset with ordering 100 extra. I've melted a bunch of IC's.

wvmarle:
The schematics of the DF Player Mini should be available; that you may use as a starting point to design your own board. The key of the problem is indeed to share the SD card (an SPI slave device) between two masters.

Sharing an SPI slave device sounds like cake. Which is what I thought I was getting into. It's the non-sharing, selfish DFPlayer I'm shaking my fists at.

Do you happen to know what the USB pins are for on the DFPlayer? I've read around the internet (nothing documented) that it's for plugging in a USB flash drive instead of SD. That sounds to me like it could be possible to wire up an SD card to that and somehow make the DFPlayer think it's a USB flash drive. That way my player can still be a player, but I'm not limited to pulling the SD card to write to it.

Anyway, I do have a few micro SD card slots coming in the next couple of weeks. Those I at least know will be useful for any project.

Thanks for the help.

USB is very different from the SPI serial used by an SD card, you can't just connect the two.

That's why I said, take the schematics of the DF player and roll your own board. With all the extra connections you want, allowing you to share the SD card for writing.

wvmarle:
USB is very different from the SPI serial used by an SD card, you can't just connect the two.

That's why I said, take the schematics of the DF player and roll your own board. With all the extra connections you want, allowing you to share the SD card for writing.

Cool. I'll see what I can get out of the schematics. Thanks.

Yes, I am also at the stage of getting stuck with limitations of the DFPlayer Mini, although I have less ambitious requirements than you.
Many of the DFPlayers information instructions return -1 and not the information in the ones I have (cheapo copies)
The DFPlayer Mini is great for the price if workarounds can be found.

I have also searched for alternatives and have just come across the following.

The ESP32-LyraT is more expensive but it does include the ESP32, SD card slot and Audio decoder and other functionality, and if it doesn't suit, schematics and information and clues that may help to design your own board.

I'll buy one when you've made them :wink:

https://docs.espressif.com/projects/esp-adf/en/latest/get-started/get-started-esp32-lyrat.html#get-started-esp32-lyrat-v4-3-board

https://docs.espressif.com/projects/esp-adf/en/latest/design-guide/project-design.html?highlight=LyraT

8 mins Feb 2019
ESP32 #88: esp-adf on ESP32-LyraT

3 mins Sep 2017
Audio developing board using ESP32-PICO-D4

ESP32 has an I2S interface, and some ESP32 boards have quite a lot of flash memory, or you could attach an SD card adaptor. So maybe you could do what you want with an I2S decoder module?