Controlling Color Fading LEDs?

K-Mac

Weaksauce
Joined
Aug 5, 2009
Messages
101
So, I have seen several mods on computers, as well as on cars/motorcycles, that use color fading LEDs, most notably the aperture case mod. Found here. I am trying to learn up as much as possible on how to do this mod. I have tried posting on the respective mods on how to do this but without any luck. Which brings me here. I know that it is done using an Arduino board, but that is as far as I have gotten. I have some experience in java programing but not too much else. So, if anyone has any input on how to accomplish this mod, it would be greatly appreciated. Any aspect is welcome, from wiring, to programing, or anything else that is relevant. All help is appreciated. Best case scenario is a how to on completing this mod, or providing programming. But like I said, I'll take any help I can get! Thank you very much for any help or input!!
 
Last edited:
(As in Pulse-width-modulation). Good luck with it, it's not easily accomplished with LED's - their duty cycle isn't linear.
 
Assuming you only need to generate one color at a time, all that is required is 3 adjustable power supplies for each color (RGB). Whether software or manually controlled, the supplies will adjust the intensity of each color, either by changing the current or the voltage of the source (for voltage or current supplies, respectively).

As Grimgor said, you can use PWM control, which applies square voltage pulses to the LED of variable duty cycle. For an adjustable DC supply, the resulting intensity is not linearly related to the applied voltage. PWM control will result in the LEDs spending x% time fully on, and y% fully off, so intensity will likely not be a function of LED voltage-intensity non-linearities.

Creating a PWM source with a microcontroller for each led only requires a resistor + transistor, the rest is really in the programming (assuming a decent supply for the LEDs is available). Creating a fixed frequency PWM signal is very simple with microcontrollers with built in timers & comparators just for this purpose - it's usually just a matter of activating the timers & setting some values (cycles per pulse (frequency), and threshold trigger(s) (duty cycle)). You'll have to adjust for potential duty cycle-intensity non-linearity in software, as well as adjust the duty cycles of all 3 colors simultaneously to move from one color to another.

I am not familiar with Adruino ,but it looks to support stepper motor drives directly, so generating the correct duty cycle signal will be relatively simple, the rest is in figuring out which direction each of the 3 needs to be changing and at what speed. If you wanted to simplify (or complicate, depending on how you see it) things, you could use a 555 timer to generate the PWM signal (one 555 per color), while only needing to apply a voltage from an analog output of the Adruino to change the duty cycle.

There's a decent example of how you might proceed here: http://picprojects.org.uk/projects/rgb/
 
Last edited:
if/when i complete this mod, i am looking more for the microcontroller route. i really like the results from the aperture science case mod. i m pretty sure i can wire that, if i get more information on what type of transistors i would need, or determining which is needed if it is based on which LEDs i get. the programming of that mod allows the colors to be changed on the fly which is very desirable to me. so it leads me to my next question, would using an arduino be the best route for this. next, which transistors would be needed for this array. im thinking im going to be making a purchase from digikey soon, so ill get some decently bright leds from them. Thanks for the help this far, but i still need help :)
 
Transistors: you can use 2N7000 if it only has to handle the current of a few LEDs (in parallel) - maybe 3-5, depending on their current draw. Alternatively, you can use bigger fets (as in his RGB driver schematic (it uses the same code as the other project)) in order to drive several LEDs in parallel. The required mosfet current rating will depend on: how many LEDs you want to drive, the source voltage for them, and the current required by each LED. The max number in series will be limited by the voltage available, so you may need to wire them in series-parallel, requiring a higher current rating for the transistor. You might want to just use STP36NF06 if the extra expense & space required for them is OK. The 36NF06 will allow several amperes of drive current so you will be able to drive many LEDs in parallel. I calculated a conservative estimate of about 5A of drive per fet with a 33C rise above ambient (no heatsink) at half duty cycle, but this does not include switching losses. Using a series-parallel of 3V/20mA LEDs with the 12V rail & a single 36NF06, you will be able to drive several hundred with a single fet. You will, of course, need to include current limiting resistors with each string.

Programming: Adruino would be easier if you were doing this from scratch, but there's little point if you've found some code that will already do what you want, or close to it. The code that the guy wrote is in assembly, so you'll have to learn a bit if you want to change anything. Otherwise, you can download the hex file & program the PIC directly.
 
(As in Pulse-width-modulation). Good luck with it, it's not easily accomplished with LED's - their duty cycle isn't linear.
This is true, and important, and it makes things a bit trickier. The brightness of LEDs, or more precisely our perception of their brightness, is logarithmic. In other words, if you double the current, it looks incrementally brighter. If you double it again, the apparent brightness increases by the same increment.
 
ok, so basically i am looking at the programming for the arduino now. I think i will go this path, and contacted the designer of the aperture science mod. he said he had a friend that is thinking about selling the program that controls the leds, so naturally im trying to entice him and get it, but no luck. Anywho does anyone know the route to program these things?
 
I program AVRs on the side, but have no personal experience with Arduino. From what I've heard, though, it's pretty easy, and there are a TON of tutorials out there.
 
arduino is easy as cake, I have the decimilla, i think it got replaced by the duemuellalov or something like that.
 
thats good news, i just wanna know about the whole programming thing though. how i can get a program on my desktop that talks to the audrino. anyone know how i can go about that?
 
Either over serial, or over ethernet. Serial is built-in (it's how you program the thing), Ethernet is usually accomplished with some extra hardware.
 
Hi K-Mac,

I just came across your thread and I know it is a few months old of a post but maybe my information will still be of interest to you. I saw you said you had contacted the designer of the aperture science mod and he said:

"he had a friend that is thinking about selling the program that controls the leds"

and you commented on that:

"so naturally im trying to entice him and get it, but no luck."

Well there is now an alternative available and while not from the designers friend it is definitely an option. It is called the Computer Color Cannon and all it requires is a USB port and the driverless software (manual control and iTunes and WinAmp visualization plug-ins available) runs on recent Windows 32 and 64 bit OS's, check out a video here:

http://www.youtube.com/watch?v=jmUVlY4u-yA

and here is the website for it:

www.computercolorcannon.com
 
Back
Top