2 wire dual colour LED, can i pwm to mix colours? - Page 1
Forum section: electronics / beginners

author: max_torque
author_rank: Super Contributor
timestamp: August 26, 2014, 11:44:19 am
content: So, take a std 2 wire "back to back" dual colour LED, lets say red and green. Put it between two microcontroller pins, with a suitable resistor for current limitation (obviously a compromise as LED has different Vf in either direction!).Obviously, i can show one "solid" colour by setting one pin high and the other low, and show the other "solid" colour by reversing those settings. But, if i PWM between them at some frequency (100Hz ish?) will i get a "blended" colour somewhere between the two solid colours (ie orange)??(colour will not be linear with duty cycle as forward currents will be different i guess)

author: TriodeTiger
author_rank: Regular Contributor
timestamp: August 26, 2014, 11:52:06 am
content: Why not try it and see? If it were just two dies in one package, it would be the same as using any other RGB LED, except one of the dies requires a reverse voltage applied to it.QuoteIf two colours can be displayed, relatively closely together, it should blend together at a distance. Being on an LED die I cannot see why not.

author: max_torque
author_rank: Super Contributor
timestamp: August 26, 2014, 12:08:54 pm
content: I can't try it because i don't have the actual LED to hand, so far i've used 3wire LEDs that means i can have separate current limiting resistors.I was just wondering whats sort of PWM frequency i'd need to do this without obvious flicker? I assume, similar to that of multiplexing LEDs so around 100Hz?

author: tautech
author_rank: Super Contributor
timestamp: August 26, 2014, 12:16:42 pm
content: I have pulsed LED's @ 50 Hz for power saving with no visible flicker. Sorry I can't remember the on times, but have a play with a 555 to find what works.Remember most CRT TV's had a 25 Hz refresh rate that was not discernible to the human eye so you possibly could go quite slow @~30 Hz.

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: August 26, 2014, 02:15:09 pm
content: Yes, it will work.Flicker perception is incredibly subjective. Back when we used CRT computer monitors, 60Hz was unusable for me, but I know loads of people who didn't notice a problem. At 85Hz, I could still detect flicker in my peripheral vision if I was close to a large screen. Of course, "large" was 20 inch or so, back in those days.Personally, I'd agree with 100Hz for PWM. Perhaps higher. Depends on what your eyes, depends on what your micro+code allows... I did a fading light things using a 16F84 many years back, and went for something in the region of 200Hz IIRC. You are right to say there might be non-linearities - I used a lookup table to decide on different values for the PWM code. Our eyes are as non-linear as our ears...CRT TV sets did not refresh at 25Hz. They were interlaced, so the field scan was 50Hz (or 60Hz in some parts of the world, of course). Flicker in peripheral vision was one of the problems with bigger screens. Though ironically, flicker does help with motion portrayal, which is why some professional LCD screens use tricks such as pulsing backlights or blank frame insertion.

author: macboy
author_rank: Super Contributor
timestamp: August 26, 2014, 02:41:09 pm
content: If you don't mind adding two more components, you can boost the current for one LED only by putting a diode and resistor in parallel with the existing current limiting resistor. This will allow you to tweak the relative brightness of the two LEDs.

author: Zero999
author_rank: Super Contributor
timestamp: August 26, 2014, 08:00:32 pm
content: If you don't mind it drawing some power, when neither of the LEDs are lit, you can use one pin and two current limiting resistors connected between the 0V and positive rails.