Rainbow LED indicates voltage with color
Edited by Brad Thompson
David Prutchi, Impulse Dynamics, Haifa, Israel -- EDN, December 7, 2004
Meters that indicate analog levels via a moving-pointer meter, a numeric display, or a column of LEDs typically occupy considerable panel area and require more than a casual glance to read. An indicator lamp or LED takes little space but indicates only an on or off condition. However, an unobtrusive LED that changes color as a function of a measured value would enable an observer to easily assess the measurement.
The circuit in Figure 1 comprises IC1, a Microchip PIC12F675 microcontroller driving IC2, a Kingbright AAF5060PBESEEVG "rainbow" indicator that contains three ultrabright LED chips (red, green, and blue) within one package. Modulating each LED's duty cycle produces all of the perceivable colors of the visible spectrum, including white light. Listing 1 contains a PIC program for the PicBasic Pro compiler, which is available from MicroEngineering Labs Inc (www.melabs.com). This program converts a 0 to 5V input applied to Pin 3 of IC1 to an 8-bit digital value that corresponds to a perceived color containing certain amounts of red, blue, and green.
Under control of a PWM routine, each LED flashes for an interval proportional to its corresponding content of red, green, or blue. During each PWM frame, an LED die receives power for as many as 14 steps per frame as the color map of Figure 2 shows. Although not all LEDs are necessarily simultaneously illuminated, the eye's slow response integrates their output to create the illusion of a change in intensity proportional to the duty cycle. The RGB-encoding function in Listing 1 assumes that the analog input to IC1 has a zero-signal offset of 2.5V, which switches all LEDs off. "Cool" colors (shades of blue, purple, and aqua) denote an input in the 0 to 2.5V range, and "hot" colors (shades of red, orange, yellow, and white) denote an input in the 2.5 to 5V range. You can create different palettes by changing the primary-color proportions stored in the RGB encoding table.
Check out our Best of Design Ideas section!
-
Re: "Active pullup/pulldown network saves watts" 2/17/05 issue.
Yes the suggested circuit saves watts, but there is a reason to use the old fashioned "conventional network" (figure 1) circuit with the 500ohm resistor. The resistor design should provide at least 20mA of current to cut through any oxide/organic buildup of the switch contacts. If the switch current is lowered to the suggested 2.4mA, not too many switch suppliers will guarantee switch closure over the life of the switch unless you use expensive (and environmentally negative) mercury wetted switches.
Don Marzewski - 2005-16-2 10:58:00 PST -
Were is the listing?? The circuit is quite obvious, the trick is in the software......David
David Cohen - 2004-23-12 21:10:00 PST -
What happened to Listing 1????
This is an expensive way of doing this
Dave
Dave La Rosa - 2004-22-12 18:45:00 PST -
(Rainbow LED ... EDN Design Idea December 7, 2004)
What an interesting scheme!
Unfortunately, if you want to build this thing for the "fun" of it and don't have the programmer or compiler software, this is a very costly project!
Spend $400.00 to make up a project that uses maybe $10.00 in parts? Not me!
J. Warner - 2004-8-12 12:40:00 PST


















