Love music ? Want to RGB everything ? Then you are at the right page .Today we'll see how to visualize our music on any RGB LED strip
or infact any LED Strip (RGB would be more fun).
Hardware required :
1: RGB strip with the 12v adaptor (without the controller, we'll use arduino and preferably common anode type).
3: 3 N-channel mosfets or NPN transistors.
4: 3 1k resistors
1: Arduino IDE (Arduino)
2: Processing IDE (Processing)
Step 1: Preparing the RGB Controller.
We'll keep this step as simple as possible because the LEDs used are small and doesn't dissipate much heat so no fancy contant current LED drivers or low pass filters required.
- I will use 3 NPN transistors (S8050) as a switch to control the individual LEDs. It is recommended to use logic level mosfets or transistors in applications like these, but a simple NPN transistor is enough given that current and voltage values remain within the maximum limit mentioned in the datasheet of the transistor.
- Solder the transistors as shown in the diagram or use a breadboard.
- Solder 1k resistor in series with the data pins of each transistor .
- Find a case or container and shove everything inside it using proper insulation between connections as the 12v line may short with the data pins and fry our beloved arduino.
Step 2: Preparing the Sketch
- Install Arduino IDE and connect your board to your PC
- Open Arduino/iDE and go to File > Example > Firmata and open StandardFirmata ,and without making any changes upload this code to your arduino.
- Now before closing Arduino IDE note down the port number of the arduino board under Tools > Port as we'll need it later. (Ex. COM8).
- Open Processing IDE.
- Go to Sketch > Import Library > Add Library.
- Search "Arduino (Firmata)" and download the library.
Search "minim" and download that library as well.
6. After the libraries have been added open the "RGB_music" sketch attached below.
7. Processing will make a folder with same name and open the file inside it. Now add any mp3 song to this folder and rename it to "song.mp3" or change the name of the song in the code(line 37).
8. Go to line 32 and change the com port to the port number you noted in Arduino ide.
9. Connect the data pins according to the sketch.
10. Now connect the LED strip ,controller and Arduino and run the sketch in Processing.
11. Make changes in the code as per your taste.
12. Sit back and enjoy .!
Participated in the
Make it Glow Contest 2018