In this project, I will show you how to make a simple Music Player using Arduino and a Micro SD Card Reader / Module. Using this project, you can play audio files (of specific format) that are stored on a microSD Card using Arduino Uno or Mega.
Introduction
Making your own Music Player using Arduino Uno is an exciting little project. This project doesn’t necessarily need to be a powerful music player but rather to check the ability of the Arduino Uno or any other Arduino boards to play audio files with the help of supporting library files, thanks to the outstanding work of Arduino Community.
It is sound sensitive and reacts to what your currently listening to, be it from spotify, iTunes or any another sound source, it can even react to what you record from a microphone or other input. If you feel stressed out over how all this content can fit in such a neat little package then you can always view the relaxing music video to find.
Once you have a circuit using Arduino Uno, a microSD Card Module (Adapter), a microSD Card and speakers or headphones, you can implement several sound effects in your projects, which are not possible under normal circumstances.
Guide to Interface SD Card Module with Arduino
As mentioned earlier, the main components of the Arduino based Music Player project are Arduino board and SD Card Module / Adapter. The audio files stored in a microSD card (more about audio files later) are read by Arduino with the help of SD Card Module and played through a speaker.
So, it is very important that you understand how to interface an SD Card Module with Arduino and read / write data from / to a microSD Card.
I have already implemented a tutorial on how to interface an SD Card Module with Arduino Uno. Check out that project first and if possible, try to implement it before proceeding with this project.
Circuit Diagram
The following image shows the circuit diagram of the project. Note that the circuit diagram shows only the connections between Arduino Uno and SD Card Adapter and three buttons connected to Arduino, which control the playback functions like Play / Pause, previous track and next track.
Additionally, a speaker is connected to Arduino, but it is not shown in the circuit diagram. The connections between Arduino and the speaker (or headphones) are the positive connection of the speaker / headphone is connected to Pin 9 of Arduino and the negative pin is connected to GND.
Components Required
Circuit Design of Music Player using Arduino![]()
As mentioned earlier, the speaker is connected to Pins 9 and GND (not shown in the circuit diagram). Additionally, we need to connect SD Card Module and 3 Push Buttons.
Since the interface between Arduino UNO and SD Card Module is through SPI Communication, the connections the connections are as follows.
The CS Pin of SD Card Module is connected to Pin 4. Chip Select (CS) pin can be connected to any Digital I/O Pin but the rest of the SPI Pins of SD Card Module must be connected to corresponding SPI Pins of Arduino.
SCK or SPI Clock Pin of SD Card is connected to Pin 13 of Arduino. The MOSI and MISO pins of SD Card Module are connected to Pins 11 and 12 of Arduino UNO respectively.
The power pins i.e. VCC and GND are connected to +5V and GND of Arduino.
Additionally, I have used 3 push buttons to control the music playback. Play / Pause Button is connected to Pin 5, Next Track Button is connected to Pin 6 and Previous Track Button is connected to Pin 7 of Arduino. All these buttons are configured with internal pullups in the program.
Preparing Audio Files and PCM LibraryWAV Files
Before proceeding further, there are a couple of things you need to take care of. The first one is to convert your audio / music files to WAV format i.e. they should be .wav files. This is because, the supporting libraries, which I will mention next, support only PCM Audio in WAVE File Format (.wav).
So, your first step is to convert your mp3 files to .wav files. For this you can use any audio converter software, the convert option in VLC Media Player or any online tools. I will be using an online tool called ONLINE-CONVERT.com. It supports multiple files like archives, audio, documents etc.
Go to the Audio converter option in the website and select “Convert to WAV” option or simple use this URL: Online Music Converter.
Upload the mp3 file and in the optional settings, set the following:
After making the above-mentioned changes, click on start conversion and the converted file will be downloaded automatically.
PCM Library
The second important thing is to add a special library called TMRpcm developed by TMRh20. You can download it directly from the official GitHub page or you can add it directly in the Arduino IDE.
In Arduino IDE, go to Tools Manage Libraries… and search for “TMRpcm” and click on install.
NOTE: This project also requires SPI and SD libraries. Spotify premium hacked free download. These are built-in libraries. Download spotify free windows 10.
CodeWorking of Arduino based Music Player
After making the hardware connections as mentioned earlier, getting audio files ready, setting up the Arduino IDE (install libraries), you are ready to implement you own music player using Arduino.
First, format the microSD Card as FAT using any formatting software like SD Memory Card Formatter and copy all the WAV audio files to the card. Insert the card into the slot on the SD Card Module and make all the necessary connections (if not made already).
Connect Arduino UNO to computer and in the Arduino IDE, use the above given code. In the code, make necessary changes i.e. in the void song () function, replace the file names with the song names in your SD card.
I have named all my audio files as song1.wav, song2.wav, etc. and used the same names in the function. After making necessary changes, upload the code.
By default, the first song (i.e. song1.wav for me) will play automatically once the Arduino is reset. You can use the Play / Pause Button to well, play or pause the current track. Use Next Button to play the next track and Prev Button to play the previous track.
Conclusion
Related Posts:Diy Rfid Music Player Spotify Free MusicThis spotify music glass art is trending on tiktok! And I HAD to get in on the trend! frame from the dollar store, scrap vinyl and a photo! Easiest but sweetest gift idea! PLUS FREE CUT FILE to make your life easier! You are welcome!
I’m not sure if you have seen these super fun spotify music art out there in social media! I saw some on tik tok and thought it was the cutest idea! My niece just had knee surgery so My daughter and I thought it would be a perfect gift for her to boost her spirits! This art is what your phone screen looks like when you are listening to music in the spotify app! We are HUGE spotify fans and have lots of awesome playlists that we jam out to on the daily! Make sure to head to your app store and try spotify out if you haven’t yet!
Supplies to make Music art
How to make spotify sign
You are going to take the glass out of the frame- we didn’t toss the frame though! We didn’t want to wrap up a piece of glass so we used the frame to prevent anything from breaking! This glass wasn’t rough or anything- but double check! I don’t want anyone getting cut!
I did create a generic cut file- You will have to add in your song and artist.
I actually think the font that works the best is just a basic Arial that- I think- comes standard with most computers! I chucnked everything up a bit to make it cut a little better than the teeny tiny icons! My cut file has the numbers in it- but you can release compound path (silhouette studio) or dis select it (cricut) and add in the exact time of the song. You can even put the exact time to your favorite part of lyric of the song!
![]()
Applied to glass with transfer tape! The best BEST transfter tape you will find is at Expressions Vinyl! The vinyl adheres so well to glass!
Adding a picture
You can print out a picture- but our fujifilm printer is awesome! It syncs with your phone and you can print any picture you have! Daughter chose this photo and air dropped it to me and I printed it right out!
You can glue these or tape these right on the glass- you can add it to the top (that’s what we did) but you can also attach them to the back!
Diy Rfid Music Player Spotify Free Version
Here is all finished! The song is I Love You So Bad by Lany. The two girls actually went to the concert together so we could have used a photo from that one but we thought them spelling love was a good one too!
It’s such a cute way to commemorate any moment. You and your husband’s favorite song. A song that brings back an inside joke. The number one song on the day you were born, The song that was playing when you had your first kiss! Or shoot- just some music you love!
Here is the free cut file! It comes in svg, png, jpeg and dxf!
Just wanted to pop in and remind you- I’m sure that spotify has this all copyrighted! So please keep that in mind when making these!
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |