In this Project I want to show you how we can play music from a micro SD card and How can we combine a micro SD card adapter and an Arduino pro mini to make a music player that can play wav files stored in the micro SD card. I will also show you how you can convert mp3 files into wav files using an online mp3 to wav converter. So let’s get started!
HARDWARE(ELECTRONIC PARTS):We need following electronic devices or components in order to create this project-
- Arduino Pro Mini
- Micro SD card
- Micro SD card adapter
- Speaker (4ohm/1W)
- Mini-B USB cable
- EFTDI programmer
- Bread Board
- Jumper Wires
- Push Button
- 10K potentiometer
- 1UF capacitor
First of all, to make this project we are to install the TMRpcm library in our Arduino IDE from the Library Manager. You can do this by connecting your computer or laptop to the Internet. After connecting to internet open Arduino IDE software and open library manager and search for TMRpcm library and Install the Latest version of it. After successfully installation of the library, now click on examples to make sure that the library has successfully installed or not. If the library has installed successfully, you will be able to see TMRpcm option in the examples.
The TMRpcm library allows you to play wav files stored in your micro SD card.
CONVERTING MP3 FILES INTO WAV FILES:Arduino can play only wav files not Mp3 files so you need to convert the mp3 files into wav files. You can convert the Mp3files into wav files using either Audacity software or online mp3 to wav converter. Here I have given a link below to convert you mp3 audio into wav audio. During converting the Mp3 files into wav files you need to set the following options
- 1. Change Sampling Rate – 16000Hz or (16KHz)
- 2. Change audio Channel _ MONO
- 3. Change bit resolution - 8 Bit
- 4. Show advanced options - PCM Format- PCM Unsigned 8-bit
https://audio.online-convert.com/convert-to-wav
RENAME THE WAV FILES:After converting your Mp3 files into wav files you need to rename each wave file. For example I am using 1, 2, 3, 4…………10 numbers for 10 individual wav files. This is necessary because during writing the codes, we have to define the name of the wav file that we want to play so please remember it.
If you did not follow the above instruction, Arduino can’t play music from your SD card.
AMPLIFY THE AUDIO OUTPUT OF ARDUINO:Audio output of the Arduino nano is too low to drive a 4 ohm loud speaker so we needed an audio power amplifier to amplify the low power or Arduino so than it can be able to drive the loudspeaker. I am using PAM8403 Class-D amplifier module here because it requires 5V DC supply and It is a stereo amplifier but here in this project we are going to use only one channel of the two.
PUSHBUTTONS:Here I have used three pushbuttons to play/pause audio, select the next track and select the previous track.
PLAY/PAUSEBUTTON
This button is use to play or pause audio track.
NEXT BUTTON:
This button is used to play the next audio track.
PREVIOUS BUTTON:
This button is used to play previous audio track.
CONNECTIONGALL THE PARTS TOGETHER:
You can connect all the electronic components to one another with the help of given schematic. After completing the wire please recheck all the connections that you made to reduce the wire connection errors.
UPLOADINGTHE SKETCH:You can download my sketch or you can also create your own sketch.
SUCCESS!
PICTURES OFMY WORK:LINK TOPURCHASE ELECTRONIC COMPONENTS
Comments