Arduino Forum

Using Arduino => Audio => Topic started by: Warco07 on Jun 30, 2019, 04:17 pm

Title: MP3 on next and previous/ Arduino maximum load
Post by: Warco07 on Jun 30, 2019, 04:17 pm
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?
Title: Re: MP3 on next and previous/ Arduino maximum load
Post by: DVDdoug on Jun 30, 2019, 04:55 pm
The amplifier should have it's own voltage regulator.
Title: Re: MP3 on next and previous/ Arduino maximum load
Post by: Warco07 on Jun 30, 2019, 05:07 pm
thanks, that solved one of my concerns.
Title: Re: MP3 on next and previous/ Arduino maximum load
Post by: Hachey on Jun 30, 2019, 05:59 pm
Yes you can do that next previous.

https://github.com/DFRobot/DFRobotDFPlayerMini

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


https://www.amazon.co.uk/Ranking-MB102-Breadboard-Supply-Arduino/dp/B06XZ3RJ9T/ref=asc_df_B06XZ3RJ9T/?tag=googshopuk-21&linkCode=df0&hvadid=205202982150&hvpos=1o1&hvnetw=g&hvrand=2154941794007315299&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9046318&hvtargid=aud-548500765412:pla-404919923962&psc=1

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.
Title: Re: MP3 on next and previous/ Arduino maximum load
Post by: Warco07 on Jun 30, 2019, 06:15 pm
Thank you so much for sharing the lib. It would be so useful for my project.
Title: Re: MP3 on next and previous/ Arduino maximum load
Post by: Warco07 on Jun 30, 2019, 06:49 pm
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?
Title: Re: MP3 on next and previous/ Arduino maximum load
Post by: Hachey on Jun 30, 2019, 08:43 pm
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.
Title: Re: MP3 on next and previous/ Arduino maximum load
Post by: Power_Broker on Jun 30, 2019, 10:12 pm
Also, see this DFPlayerMini library (https://github.com/PowerBroker2/DFPlayerMini_Fast) that will allow you to interface your Arduino and MP3 player.