VU Meter
This project shows you how to take inputs from a computer, MP3 player, or stereo via a headphone jack and get LEDs to respond and visually display the peaks and troughs of the music.
For this project you will need:
-One (1) ArduinoMega w/ USB upload cable
-Two (2) 10-Segment LED Bar Graphs
-One (1) breadboard
-A few feet of 22 gauge solid wire
-One (1) 3.5mm Male to Spade-Tongue Speaker Cable
Attached is a video of the finished project.
Setting Up the Breadboard
For this step you will need:
-Two (2) 10-Segment LED Bar Graphs
-One (1) breadboard
-A few feet of 22 gauge solid wire
NOTE: For this project we used two 10-Segment LED Bar Graphs for a total of twenty individual LEDs. However, using just regular LEDs, either less or more, will work perfectly fine. The Bar Graphs create a cleaner look. Though we do recommend using at least five LEDs for the desiref effect to be achieved.
With the breadboard positioned vertically, insert the LED bar graphs vertically with each line of pins straddling the void traveling vertically up the breadboard so that the positive and negative pins of the bar graphs are on opposite sides of this void.
Next, since wires are connected horizontally in breadboards, insert twenty (20) jumper wires into the plugs of the breadboard that are horizontal to where the negative (for the bar graphs there is no predesignated positive or negative side, you get to choose) pins of the bar graphs plug into the breadboard. Then take each of those jumper wires and connect them to the negative bus of the breadboard on that same side.
Now, insert twenty (20) jumper wires into the plug of the breadboard just like you did in the previous step except this time insert them on the positive side of the bar graphs. DO NOT connect these jumper wires to the positive bus of the breadboard.
-Two (2) 10-Segment LED Bar Graphs
-One (1) breadboard
-A few feet of 22 gauge solid wire
NOTE: For this project we used two 10-Segment LED Bar Graphs for a total of twenty individual LEDs. However, using just regular LEDs, either less or more, will work perfectly fine. The Bar Graphs create a cleaner look. Though we do recommend using at least five LEDs for the desiref effect to be achieved.
With the breadboard positioned vertically, insert the LED bar graphs vertically with each line of pins straddling the void traveling vertically up the breadboard so that the positive and negative pins of the bar graphs are on opposite sides of this void.
Next, since wires are connected horizontally in breadboards, insert twenty (20) jumper wires into the plugs of the breadboard that are horizontal to where the negative (for the bar graphs there is no predesignated positive or negative side, you get to choose) pins of the bar graphs plug into the breadboard. Then take each of those jumper wires and connect them to the negative bus of the breadboard on that same side.
Now, insert twenty (20) jumper wires into the plug of the breadboard just like you did in the previous step except this time insert them on the positive side of the bar graphs. DO NOT connect these jumper wires to the positive bus of the breadboard.
Connecting to the Arduino Mega
For this step you will need:
-One (1) Arduino Mega
-One (1) longish jumper wire
Take each of those positive jumper wires and insert the free ends into the pins numbered from 34 to 53. IMPORTANT: Insert the bottom-most jumper wire into pin 34 on the Arduino, then the jumper wire DIRECTLY above that into pin 35, the pin DIRECTLY above that one into pin 36, and so on and so forth until you put the last jumper wire into pin 53. The reason for being so meticulous in inserting the jumper wires into the Arduino is because if the LEDs in the bar graphs are not connected to the )Arduino sequentially they either not light up in the correct order (if you use our code) or (if you program this yourself) it will make coding for this project more frustrating.
Next, insert the longish jumper wire into THE SAME negative bus on the breadboard as that you plugged the negative jumper wires from the bar graphs into. Then take the free end of this jumper wire and plug it into one of the two (does not matter which) ground (GND) plugs on the Arduino.
-One (1) Arduino Mega
-One (1) longish jumper wire
Take each of those positive jumper wires and insert the free ends into the pins numbered from 34 to 53. IMPORTANT: Insert the bottom-most jumper wire into pin 34 on the Arduino, then the jumper wire DIRECTLY above that into pin 35, the pin DIRECTLY above that one into pin 36, and so on and so forth until you put the last jumper wire into pin 53. The reason for being so meticulous in inserting the jumper wires into the Arduino is because if the LEDs in the bar graphs are not connected to the )Arduino sequentially they either not light up in the correct order (if you use our code) or (if you program this yourself) it will make coding for this project more frustrating.
Next, insert the longish jumper wire into THE SAME negative bus on the breadboard as that you plugged the negative jumper wires from the bar graphs into. Then take the free end of this jumper wire and plug it into one of the two (does not matter which) ground (GND) plugs on the Arduino.
Setting Up the Arduino to Take Inputs
For this step you will need:
-One (1) 3.5mm Male to Spade-Tongue Speaker Cable
NOTE: You can use any cable that will fit into a 3.5mm headphone jack. The reason for us using the specific cable we did was purely cost based. Using another cable will not affect the functionality of this project.
First, cut off the both of the spade-tongues on the speaker cable. Next, separate the two wires from each other and strip of approximately 1/3 of an inch of the insulation.
NOTE: Since the speaker cable is not made out of solid wire we suggest that you spin the threaded wire together so that it is easier to stick into the plugs on the Arduino which you will do next.
Now take one of the exposed ends of the speaker cable (does not matter which one) and insert it into the other ground plug on the Arduino. Then take the other exposed end of the speaker cable and insert it into ANALOG plug 8 on the Arduino.
NOTE: If you are using our code (attached in the next step) for this project you must use Analog plug 8 on the Arduino because it corresponds to our code. If you are writing your own code for this project feel free to use any plug AS LONG AS it is still an Analog plug.
,
-One (1) 3.5mm Male to Spade-Tongue Speaker Cable
NOTE: You can use any cable that will fit into a 3.5mm headphone jack. The reason for us using the specific cable we did was purely cost based. Using another cable will not affect the functionality of this project.
First, cut off the both of the spade-tongues on the speaker cable. Next, separate the two wires from each other and strip of approximately 1/3 of an inch of the insulation.
NOTE: Since the speaker cable is not made out of solid wire we suggest that you spin the threaded wire together so that it is easier to stick into the plugs on the Arduino which you will do next.
Now take one of the exposed ends of the speaker cable (does not matter which one) and insert it into the other ground plug on the Arduino. Then take the other exposed end of the speaker cable and insert it into ANALOG plug 8 on the Arduino.
NOTE: If you are using our code (attached in the next step) for this project you must use Analog plug 8 on the Arduino because it corresponds to our code. If you are writing your own code for this project feel free to use any plug AS LONG AS it is still an Analog plug.
,
Upload Code to Arduino
If you have never used or programmed an Arduino, the required software can be found at:
http://www.arduino.cc/en/Main/Software
This website is also a great resource for learning how to write and troubleshoot your code.
Connect your Arduino to your computer with the USB cable. Upload the code to the Arduino.
Leaving the USB cable plugged into BOTH your computer and the Arduino (your computer acts as the power supply for this project) plug the Speaker Cable into your computer or whatever device you are using to play music with and turn on some sort of music.
Open the serial monitor from the Arduino window on your computer and you should see values displayed. If for some reason you are getting zeros, or very low values try changing to a different song with a heavier beat and if that does not change the values you are seeing check all of your connections.
http://www.arduino.cc/en/Main/Software
This website is also a great resource for learning how to write and troubleshoot your code.
Connect your Arduino to your computer with the USB cable. Upload the code to the Arduino.
Leaving the USB cable plugged into BOTH your computer and the Arduino (your computer acts as the power supply for this project) plug the Speaker Cable into your computer or whatever device you are using to play music with and turn on some sort of music.
Open the serial monitor from the Arduino window on your computer and you should see values displayed. If for some reason you are getting zeros, or very low values try changing to a different song with a heavier beat and if that does not change the values you are seeing check all of your connections.