RGB LED - Page 1
Forum section: electronics / beginners

author: NivagSwerdna
author_rank: Super Contributor
timestamp: May 06, 2016, 11:08:27 am
content: This is a very newbie question...I have a RGB LED purchased from EBAY (actually I bought a few...), it has no data sheet or spec other than it is a RGB LEDThe LED has 4 wires all different lengths, the longest wire being common and the others being R,G and B.I would like to drive the LED from a microcontroller pin in such a way that it shows R, G and R+G.My issue is that G seems much brighter than R and in particular R+G looks G rather than Y.Applying Ground to the common pin...With a constant current limited supply 4mA of R, but only a fraction of a 1mA is required for G is required for readable levelsSo for 5V from my microcontroller pin... 1k on R and 8k on G? These seem like very big numbers? Does that sound right?

author: danadak
author_rank: Super Contributor
timestamp: May 06, 2016, 11:21:14 am
content: Rled = (Vdd - Vledthreshold - Voutpinlow) / IledSo if Vledthreshold =~ 1.5, Voutpinlow = ~.4, Vdd = 5,you can compute what you will get.Note Y, R, G thresholds all different.Regards, Dana.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: May 06, 2016, 11:39:23 am
content: Thanks for that.It seems that the R never seems to get hugely bright, so if I aim to get the R running at 10mA and then get the G running at same brightness around 1mA...... my colour vision is unfortunately not perfect (!) but to me it seems that at low currents the G LED looks very yellow and only greens up at higher currents (at which it far outpaces the R)...Maybe it's me with the issue!

author: sokoloff
author_rank: Super Contributor
timestamp: May 06, 2016, 12:15:49 pm
content: With a microcontroller, you can use pulse-width modulation (PWM) to vary the brightness as well.This lets you run higher currents for a percentage of the time. Imagine a square wave with a 5% on-cycle vs a square wave with a 50% on-cycle. The second will be much brighter visually, of course.This also lets you pick resistors [possibly none] that give you full brightness on the LED and then it's a simple matter of software to change the intensity, meaning you can upgrade as fast as you can compile and download rather than rewiring the breadboard or reworking a PCB, and is much less sensitive to parts variations/tolerances/temperature.IMO, this is a much better solution than Ohm's lawing your way to get the color balance you want based on the random LED you have in your hand.

author: danadak
author_rank: Super Contributor
timestamp: May 06, 2016, 01:45:11 pm
content: In this application if trying to run LED directly from UP w/o usingcurrent limiting R you have to be aware of a couple of issues -1) The UP has a max current / pin spec that you cannot exceed.You cannot rely on PWM to control that, has to be an R or someother kind of current limited LED drive, like a current source.2) The UP has a limit on internal port or buss current limit youcannot exceed, again only R to limit current supports that. Ifyou exceed the current you could get internal logic operationfailure.3) Use of a PWM + Rlimits perfectly acceptable. Note PWM at100% duty cycle, which is 100% brightness, in this case effectivelyout of the circuit, and R establishes the curretn for max brightness.4) Use of a PWM (with a light sensor) can serve an important function,control of brightness with ambient light, therefore saving power con-sumption in a low light environment.Regards, Dana.

author: Jeroen3
author_rank: Super Contributor
timestamp: May 06, 2016, 07:10:13 pm
content: The human eye has a nonlinear percieved brightness. Which also changes depending on the color.Also, some led colors can be made more efficiently.

author: stmdude
author_rank: Frequent Contributor
timestamp: May 06, 2016, 07:15:05 pm
content: Quote from: Jeroen3 on May 06, 2016, 07:10:13 pmYup. In the RGB context, the eye is about as sensitive to R & B, but about twice as sensitive to G, as compared to R&B.

author: Audioguru
author_rank: Super Contributor
timestamp: May 07, 2016, 01:13:25 pm
content: Old green LEDs were about 2.2V and were not bright. New LEDs are made with the same material as blue LEDs, are about 3V and are very bright.I agree that our vision is more sensitive to green than to red.