Modified: 13th Jun 16 |

Rgb Led Controller

Had an RGB LED strip laying around. It was initially meant for lighting up the kitchen, but the colors were just terrible. So I figured i could use it to give some funky light in my new bedside table.

During this project I found out that the reason for the abysmal light these LED strips produced, were because the different color components have wildly differing light intensities, at the same voltage level on the strip. For instance, the blue component is nearly 5 times as bright as the red component, and the green component is about twice as bright as the red component. (no wonder the light made everything in my home look weirdly blueish.) I have however calibrated the intensities for my light controller.

Lets skip all the boring explanations, and see the the action.

The original controller that came with these LED strips also had an awful fading mode, where you would see obvious kinks in what should have been smooth transition between colors. I think I managed to make a pretty smooth transistion effect. I've also taken into account the human perception of light intensity to make the fading effect much more noticeable.

The LED strip is powered by a lab supply at 12 volts. The small PCB right next to the strip is basically just three 3Amp transistors and some resistors and pin headers.

It is the Arduino Uno next to the breadboard, that is actually controlling the LEDs. As a result of the blue and green components being much more intense than the red, they need to have significantly lower duty cycles than the red component. The PWM used for the red component is only 8 bit, and i originally used 8 bit PWM for the green and blue too. The problem then occurs when you want really dim light, say a duty cycle of 1/255, the matching duty cycle of the blue component would then be 1/255/4, which rounds to 0 when you only have a timer resolution of 255. Fortunately the Atmega AVR has a 16 bit timer too, which then has to be prescaled accordingly, to make all the timing match among the color components.

Most of the time was spent on trying to calibrate the intensities among the LEDs at various PWM duty cycles, and I think I've managed to find a sweet spot.