#40 Let the music play! Arduino based MP3 Player for music (or announcements)
Let the music play! This module can most certainly be used as a custom, Arduino-controlled player of music, in a pub or restaurant, for example, but it could equally be used to give out warning messages or instructions “3D printer has run out of material!” in a factory or workshop. The possibilities are endless. All you have to do is record your .mp3 or .wav files, put them onto a micro SD card, referred to as a TF TransFlash card in the documentation and you’re good to go.
We’re not using any libraries in this demo, so that you can see exactly how the commands are sent to the MP3 player and how the optional responses are returned too. It also demonstrates how easy it is to send out those commands via the SoftwareSerial library; why not the standard Serial port? Watch the video to find out!
However, you may feel more comfortable using the DFRobot MP3 Player library so I’ve included that in the links below. Just be aware that we have not experimented with that library in the video, but it looks very easy to use and takes away all the work, aka pain, in creating the command strings.
The library contains some examples that should get you going nicely too.
UPDATE UPDATE UPDATE
Just to clarify some queries some viewers had: YES you can play SPECIFIC tracks (that is, you can, if you want, play track 6 then track 1, then track 123). However, I haven’t demonstrated that here (we just play them sequentially) but if you look at the code for the Wireless Rain Receiver (video #48) you’ll see an example where I play different tracks depending on the level of rain detected.
Many thanks to Purple Planet for their music – link below
STOP! READ THIS IF YOU VALUE YOUR MP3 PLAYER MODULE
The RX and TX from the Arduino Uno or Nano will be 5V and will damage the MP3 player which requires 3.3V on these pins. All explained in the video!
I’ve included as many links below as I could find and I *strongly* recommend you print out the ones I’ve marked as you’ll be referring to them often!