Hello everyone. I am just learning arduino less than 24 hours. I am really excited to do my first project. However, before I purchase stuffs, I would like to ask two questions any expert mind can kindly answer.
1.) I would like to build an mp3 player with arduino uno, dfplayer, amplifier pam8403 soon.
The situation is this: In my SD card, I would like to upload atmost 5 mp3 files. Then, instead of play/pause button, I only need to program my player with next and previous buttons. So, if I trigger the next button, it would play track 1 only, for example, then hitting it again, would play track 2 and so on. and by clicking the previous button, it would play, of course, the previous one.
Then this would go on a loop. like if I just played track 5, the next trigger button would play track 1. or if I am on track 1, if I hit the previous, it would play track 5. Just like most talking toys do.
Is it possible or any existing commands you know and would like to share? Thanks in advance
2.) I don't want to burn out my arduino. I am planning to power my arduino with batteries, about 9v in total. or 9v battery to keep it simple through the DC input.
In my arduino uno 5v pin, it is ok to connect and power dfplayer, amplifier pam8403 and two speakers of 3w 4ohms or these connections would burn out my arduino?
if not, what do i need to power my amplifier and two speakers without taking power from arduino but just from a the same battery source?
The amplifier should have it's own voltage regulator.
thanks, that solved one of my concerns.
Yes you can do that next previous.
Yes you need to power DFPlayer and AMP not through the Arduino.
The DFPlayer mini voltage is recommended to be 4.2V which can be done by passing the 5V through a diode.
I got these for < £2
100pcs IN4007 1N4007 DIP Rectifier Diode Component Kit For DIY...
These type of breadboard power supplies are good
They have jumpers for 5V and 3.3V and you can run all three of your bits of kit through them.
You can desolder the bottom pins off and hot glue then into project box.
And you can plug in a USB power pack like for mobile phone charging.
Thank you so much for sharing the lib. It would be so useful for my project.
Last question please:
Can I have multiple folders inside an SD card and several buttons as well to send command to access a specific folder.
For instance, When I trigger button A, i get to play the next and previous button on all mp3s from folder one while button B shifts to folder two and so on and so forth?
Yes you can.
There are specific rules about the naming of files and folders though. See the documentation.
I have my folders in 01, 02, 03 etc but with the tracks inside with their natural names.
The player can tell you how many tracks there are on the SDCard.
It can also give you a folder count, but I found issues with getting an accurate folder count.
Also the player goes by an internal index of when the file was added to the SDCard, which can give unexpected play sequence.
I have written a C# for my PC to load up the folders and tracks one by one in sequence in order to keep mine tidy.
If you delete and add files afterwards it can affect how it finds them.
Also, see this DFPlayerMini library (https://github.com/PowerBroker2/DFPlayerMini_Fast) that will allow you to interface your Arduino and MP3 player.