Pages

Micro Search Engine

Custom Search
Welcome To Microcontroller And Interfacing Programming

My Map

My Translator

Monday 17 January 2011

Driver an RGB LED Using Three Microcontroller Pins

The RGB LED contains three LEDs encased in one shell: Red, Green and Blue (some contain an extra blue led - as blue LEDs generate less output intensity (candela) per mA). It looks like a single white led except that it has four leads - one for the common ground connection and one for each led. This is the figure of the circuit;


This project uses puls width modulation to drive each of the leds in the RGB led. By changing the duty cycle of each PWM signal you can control the average current flowing through each led creating any color you want. The limit is set by the resoelution of the PWM (set at 256 steps per channel). The project relies on persistence of vision to make it appear that the led is continuously driven (the PWM signals must be repeated quickly enough so that you do not see any flicker) at a rate greater than 50Hz (approx). Too slow and you begin to see the led flickering.

By varying the current through each led you can create almost any other color but at close range you only see the individual colors of each LED. To see the 'merged' color view it from a distance or put a diffuser over it. I used a small piece of baking paper - which is transparent enough to let the light through and opaque enough to diffuse the light from the three LEDs. In a proper design you would use a semi-transparent plastic.

My Ranks