Arduino Color Organ
For a long time now I have been searching for a way to make a simple, relatively cheap color organ. For those of you who are not familiar with the term, a color organ displays lights in sync with the music. After lots of testing, researching and creating circuits, I have come across what I have found to be a fantastic way to achieve this goal. In addition to lighting with the music, I added a second mode for the lights to fade in and out of all the colors to add a second use for it.
Required Parts and Tools
Parts:
- Arduino Nano
- TIP120
- DC Female power jack
- 3.5mm Audio Jack (Female)
- 1x 10uF Capacitor
- 1x 4.7nF Capacitor
- 1x 10kOhm potentiometer
- 2x 100k Ohm Resistors
- 1k Ohm Resistors
- Female Arduino Header
- USB Car Charger
- Wire
- Perfboard
- RGB LED strip
- 12v 3 Amp Power Supply
Optional:
- 10k Ohm Resistor
- Push Button
Tools:
- Soldering Iron
- Solder
- Plyers
- Wire Stripers
I found most of these parts around the house but did purchase the TIP120s, Nano, and 12v power supply on Amazon. If you don't have some of these parts laying around, try going through some old circuit board and see if you can find any parts to reuse.
Schematic
While reading articles online I came across a post that was doing something very similar to what I was trying to do.
https://dqydj.com/build-your-own-real-time-frequen...
Here, the author was controlling 8 relays with a FHT on an arduino. I decided that I could modify this to control a 3 color RGB LED strip fairly easily. The general concept is that the circuit enables the arduino to receive and read the music coming in through an analog port and run the FHT (Fast Hartley Transform, similar to an FFT) to separate the music into different frequencies. The arduino then tells the TIP120 to turn on the specific color that represents the frequency. The potentiometer controls how much of the audio signal goes into the pin. Personally, I leave it dialed all the way to the audio input side.
Breadboard and Code
The first step to any circuity-- the breadboard. I built the circuit above as a proof of concept before soldering it all together. I used one RGB LED to look at the output from the arduino. The code I used is modified version of the Christmas light control. I didn't mess with the FHT algorithm but did change the LED function. Since the algorithm separates music into 8 frequencies and I only need 3, I decided to simply ignore the ones that were not necessary. I found that using the 2nd, 5th and 7th sections gave the look I wanted. If you find the LED is flashing randomly, there is probably a small amount of noise on the line. You can increase and decrease the 'zero' value of each channel to get the look you want. If you're still having issues, you can check what is happening through the serial port on the computer.
I also tested controlling the RGB LED strip with an arduino using the TIP120s. I ran some code that I found a long time ago that cycles through all the colors of the LED. Each channel of the LED strip is connected to a PWM digital pin on the arduino so that each color can be precisely controlled.
Modifying the Car Charger
The LED strip is powered by 12v. The arduino is powered by 5v. In order to have them both use the same power supply (and use less wires and adapters) a 12v to 5v step down converter is required. I found that a car USB charger is perfect for this job. It takes 12v in one end and outputs USB level power out the other. I took apart the charger and soldered wires onto it so I can use it in my circuit. Use a multi meter to find the 5v pin on the bottom and solder a wire from it to the 5v pin on the arduino.
Putting It All Together
Once I determined everything was working as expected, I started soldering up everything. I started with the Arduino Nano and then lined up the TIP120s in a row and wired the resistors to the PMW pins (9,10,11).
For the power supply, I drilled a hole in a small piece of plastic and bent it into a 90 degree angle and glued it to the bottom of the board. I wanted the music input next to it so that was also glued onto the board. In order to connect the LED strip to the board, I used an arduino header strip and bent the pins 90 degrees so that they fit in the holes on the board.
I also added the push button circuit and connected it to pin 13 since it was close and available. This allows me to change modes between music lights and the color cycle. If you do not want to add this feature then just ignore this part.
The rest of the work is just wiring everything to the proper pins. I fastened the board and the car charger to a piece of cardboard just to hold it all together. If you wanted to put this in a box, then you might mount the DC power jack, audio jack and header to holes in the box. Leave the USB port of the Arduino accessible so that you can modify and change the code to do what you like. For the final version of the code, I removed the serial stuff so that its not writing pointlessly to the serial lines.
Conclusion
Hopefully this has been helpful enough for those of you who want to build your own. I would like to thank the author of the Christmas Light Controller for giving such detailed steps on how to make some of this stuff. It really inspired me to make my own version of it.
If you have any questions leave a comment below!