How to use the Sparkfun MP3 Player Shield
The Sparkfun MP3 Player Shield is a wonderful shield but the instructions for installing the libraries are a little out of date. My student Asa Hillis wrote the following instructions while setting his up, and he offers them here to the public in the hopes that this is useful to other:
These instructions assume you are using Arduino version 1.0 or later, which accepts libraries in your sketchbook folder.
- Download this zip file containing the Sparkfun MP3 Player Shield library written by Bill Porter. If you want to learn more about the library read here.
- Unzip the file, which will give you a folder called madsci1016-Sparkfun-MP3-Player-Shield-Arduino-Library-2b83891/
- In that folder you will find some documentation as well as two folders: SFEMP3Shield and SdFat. These are libraries and you will need both of them.
- Find your sketchbook folder. You can check by opening Arduino -> File -> Preferences and see what it says at “Sketchbook location”.
- Open your sketchbook folder and look for a folder named “libraries”. If you don’t have a libraries folder in your sketchbook folder, create one.
- Copy (or move) both the SFEMP3Shield and SdFat folders from the madsci1016-Sparkfun-MP3-Player-Shield-Arduino-Library-2b83891/ into your libraries folder.
- If you had Arduino running, close and reopen so that it finds the new libraries.
Changes to the Examples
You may use the examples in File -> Examples -> SFEMP3Shield -> Examples or from Bill’s website, but you must make the following change:
- Find the line that initializes the SD card and change SD_SEL to 9:
Preparing music files
- MP3 files must be compressed at 192kbps. You can find converters on the internet for your operating system.
- The names of all MP3 files must end with the extension “.mp3”. Rename them if they are something different.
- The names of all MP3 files must be in DOS 8.3 format meaning:
- At most 8 characters, starting with a letter and not a number
- All characters should be lower case (verify)
- The last 4 characters must be “.mp3
- Rename them if they are something different.
- The most common problem is an inability to read the SD card. Verify correct file name formats, and verify that you can play your MP3 file from your SD card on your computer.
- The second most common problem is that your MP3 file is not compressed at the correct bitrate of 192kbps. Your music player may be able to report the file bitrate so you can verify.
- Bill has some excellent troubleshoting hints on his webpage
If you have any problems or updates to these instructions please leave a comment below
Thanks to Asa Hillis for writing the original instructions
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.