Hi All,
I've recently started working on a project I saw online for a Helldivers Stratagem orb with lights and sound. I've managed to get it working but with a small snag. When I power up the arduino nano via usb the DFPlayer isn't playing sounds (through the speaker obviously).
I thought this might be a wiring issue or an issue with format of the SD card but after investigating further I've determined that doesn't seem to be the issue in this case. After powering up, if I remove the SD card and re-insert it, the light on the DFPlayer flashes, the speaker makes a pop sound, and then the files on the SD card work as intended and sound is played whenever the button is triggered.
However, after powering it off, and then powering on again, I once again have to remove and reinsert the SD card before it starts playing sound again.
I'm stumped by this and would really appreciate if anyone has any suggestions. I've tried 2 different SD cards with the same result. Is it possible I just got a bad DFPlayer? Could it be the SD card? Or could it be something software side.
Using an Arduino Nano clone, with DFPlayer Mini MP3-TF-6p V3.0. Currently powered by usb and there is a 1k Ohm resistor on the RX pin of the Player from pin 11 on the arduino nano.
Code can be found on PlentifulProps youtube/github.
So, I believe this was a problem initially as I had originally dumped the mp3 file straight into the root and named it 0001.mp3. After some research online it appeared that the correct structure was inside a folder called MP3. This resolved the issue with it not playing at all.
However, that was when I discovered the issue of having to remove and reinsert the SD card after powering the circuit on.
I have mine in the root and while every other track is an audio track (because the other "tracks" are information), I haven't had any other issues. I just increment by 2.
I'll try your same structure and see if I can replicate it.
Parallel to your "filename" issue, have you tried I/O Mode? That requires VCC, GND, SPK_1, SPK_2 and grounding IO_1 or IO_2 to play NEXT/PREV file. This might help you validate the files.
That library never seemed to work for me. The module would only work some of the time, probably similar to what you are seeing on your end, though I don't recall needing to remove and reinsert the card to get it to work.
Firstly, I don't see how that code can reliably play tracks. Please provide a link to the original source of the project you are using. How will the bool _isAvailable ever become true as the code stands?
Secondly, let's clear up the card format issue. Misinformation seems widespread. The player module cares nothing for the format of MP3 files in the root. You could have the files named anything (within the OS specification). All that matters (to the module) is the order in which you copied the files to the card. Of course, it does matter to you, to manage the structure!
Thirdly, try fixing the 'popping' sound by changing
if (!dfPlayer.begin(mySoftwareSerial))
to
if (!dfPlayer.begin(mySoftwareSerial), true, false)
Finally, can you describe exactly what you want your nano to do.
I don't have a neopixel strip at hand but could substitute say a simple blinking led to focus on the player issue.