Author Topic: 2 wire dual colour LED, can i pwm to mix colours?  (Read 2133 times)

0 Members and 1 Guest are viewing this topic.

Offline max_torqueTopic starter

  • Super Contributor
  • ***
  • Posts: 1275
  • Country: gb
    • bitdynamics
2 wire dual colour LED, can i pwm to mix colours?
« on: August 26, 2014, 11:44:19 am »
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)


 

Offline TriodeTiger

  • Regular Contributor
  • *
  • Posts: 199
  • Country: ca
Re: 2 wire dual colour LED, can i pwm to mix colours?
« Reply #1 on: August 26, 2014, 11:52:06 am »
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.

Quote
will i get a "blended" colour
If 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.
« Last Edit: August 26, 2014, 11:56:53 am by TriodeTiger »
"Yes, I have deliberately traded off robustness for the sake of having knobs." - Dave Jones.
 

Offline max_torqueTopic starter

  • Super Contributor
  • ***
  • Posts: 1275
  • Country: gb
    • bitdynamics
Re: 2 wire dual colour LED, can i pwm to mix colours?
« Reply #2 on: August 26, 2014, 12:08:54 pm »
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?
 

Online tautech

  • Super Contributor
  • ***
  • Posts: 28327
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: 2 wire dual colour LED, can i pwm to mix colours?
« Reply #3 on: August 26, 2014, 12:16:42 pm »
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.
Avid Rabid Hobbyist
Siglent Youtube channel: https://www.youtube.com/@SiglentVideo/videos
 

Offline Mark Hennessy

  • Frequent Contributor
  • **
  • Posts: 305
  • Country: gb
    • My electronics and audio website
Re: 2 wire dual colour LED, can i pwm to mix colours?
« Reply #4 on: August 26, 2014, 02:15:09 pm »
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.
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2254
  • Country: ca
Re: 2 wire dual colour LED, can i pwm to mix colours?
« Reply #5 on: August 26, 2014, 02:41:09 pm »
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.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19491
  • Country: gb
  • 0999
Re: 2 wire dual colour LED, can i pwm to mix colours?
« Reply #6 on: August 26, 2014, 08:00:32 pm »
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf