DIY Analysis: Arduino Audio Music Player
In this post, we will be analyzing a completed DIY (Do it Yourself) made with an Arduino board. The project will be looking at is an audio music player with an LM385 audio amplifier. When it comes to reviewing DIY projects, we are simply looking at the functionality aspect of the device, and for the most part ignoring the design aspect of it, as you can see in the image below this music player is not as nice or as compact as a store-bought version but it does the job, which is to play music!
Parts Required
They give a helpful step by step process on how to use the conversion site.
Circuit Hardware
The creators do a great job of breaking down the setup and in directing and explaining the connection of the circuit. They also provide a detailed schematic which is shown below.
The converted waveform sound files are saved on the SD card which is put into the SD card module, which is connected to the Arduino - which is also connected to the speaker on Pin 9. All these connections are made using the breadboard as the platform. The creators added an additional table for clarity explaining the connection of the SD card module to the Arduino, see the table below.
The LM386 audio amplifier is connected on Pin 6 and is powered by 5V using the Arduino, the reason for the inclusion of the audio amplifier is because the audio produced by the speaker on Pin 9, is not very audible and so for full music player experience they added to amplify to boost the volume of the speakers. To increase or decrease the volume of the amplifier, you can simply increase or decrease the amount of voltage supplied to it; the audio amplifier used here is designed to provide a gain of 200, it can withstand as much as 15V.
There is also the inclusion of two push buttons connected to Pin 2 and 3 on the Arduino board that are used to play/pause and switch tracks of the music player. Pin 2 is used to start the music playing (the first song) and is used to switch tracks, while Pin 3 is used pause and resume play of the music.
Please note that the connecting pins for the SD card to the Arduino vary depending on the Arduino model you are using, more specifically the Slave Select (SS) aka Chip Select (CS). See the table below for the connections for different models retrieved from the Arduino site:
Programming the Arduino
They made use of the TMRpcm library, which can be downloaded by clicking on the preceding highlighted text as a zip file. which should be added to your Arduino library and selected under the "Sketch>Include library" tab in order for the Arduino to be able to play the music.
The creators also provide little snippets of the essential code that directs the functions of the music player and break it down to explain and pinpoint to its audience what code runs which functions.
An example of this is this line of code below used to play the music
The creators do a great job in breaking down the process of setting up the hardware and also explain the programming in the code.
You can see the mp3 player in action in the video retrieved from the YouTube below
You can find the full set of the code by clicking the project link below to the creator's article.
Project Link: https://circuitdigest.com/microcontroller-projects/arduino-audio-music-player
Sources: https://www.arduino.cc/en/Reference/SPI
Parts Required
- An Arduino Board
- An SD Card Reader Module
- An SD card
- 10uf Capacitor (2 of them)
- 1k, 10k Resistors
- Push buttons (2 of them)
- Breadboard
- Jumper Wires
- And lastly, A Low Voltage LM386 Audio Amplifier - used to boost the volume of the music
The first thing to make sure of is the format of the audio files you will be playing. The Arduino system is only able to recognize sounds in wave sound format (.wav), so the music files you intend to play have to be converted to .wav format. There are many websites that convert files that can do this easily. The creators of this project made use of audio.online. They also recommend some settings to get the best sound quality for your conversion, see the table below.
They give a helpful step by step process on how to use the conversion site.
Circuit Hardware
The creators do a great job of breaking down the setup and in directing and explaining the connection of the circuit. They also provide a detailed schematic which is shown below.
The converted waveform sound files are saved on the SD card which is put into the SD card module, which is connected to the Arduino - which is also connected to the speaker on Pin 9. All these connections are made using the breadboard as the platform. The creators added an additional table for clarity explaining the connection of the SD card module to the Arduino, see the table below.
The LM386 audio amplifier is connected on Pin 6 and is powered by 5V using the Arduino, the reason for the inclusion of the audio amplifier is because the audio produced by the speaker on Pin 9, is not very audible and so for full music player experience they added to amplify to boost the volume of the speakers. To increase or decrease the volume of the amplifier, you can simply increase or decrease the amount of voltage supplied to it; the audio amplifier used here is designed to provide a gain of 200, it can withstand as much as 15V.
There is also the inclusion of two push buttons connected to Pin 2 and 3 on the Arduino board that are used to play/pause and switch tracks of the music player. Pin 2 is used to start the music playing (the first song) and is used to switch tracks, while Pin 3 is used pause and resume play of the music.
Please note that the connecting pins for the SD card to the Arduino vary depending on the Arduino model you are using, more specifically the Slave Select (SS) aka Chip Select (CS). See the table below for the connections for different models retrieved from the Arduino site:
Programming the Arduino
The creators also provide little snippets of the essential code that directs the functions of the music player and break it down to explain and pinpoint to its audience what code runs which functions.
An example of this is this line of code below used to play the music
The creators do a great job in breaking down the process of setting up the hardware and also explain the programming in the code.
You can see the mp3 player in action in the video retrieved from the YouTube below
You can find the full set of the code by clicking the project link below to the creator's article.
Project Link: https://circuitdigest.com/microcontroller-projects/arduino-audio-music-player
Sources: https://www.arduino.cc/en/Reference/SPI
Comments
Post a Comment