# What do bi/tri color LEDs look like when switched at high speed?

So, if I have (say) a red/green bicolor LED and switch between the two colors faster than the eye can see (eg 250 Hz), what colors are perceived?

Can I use a RGB tricolor LED to mix any color output?

• Depends on the LED, but an RGB tricolour LED can represent any colour, you just need to swtich it correctly. But ratios may or may not be equal. Easiest way to work this out is usually via experimentation. Dec 6, 2022 at 12:59
• Experimentation, because the R/G/B forward voltages/currents are not equal, then the emission intensities are not equal, nor is our ocular perception of these intensities. Dec 6, 2022 at 13:06
• If you switch the red and green with 250 Hz and 2 milliseconds for each diode you will see the same yellow as with both diodes on simultaneously and 50 % of the switched current.
– Uwe
Dec 6, 2022 at 13:13
• I remember an experiment from school. We cut-out a circular disc made from strong card and painted it red, green and blue like slices of a cake. We then stuck a pencil through the centre and spun the pencil fast and, it turned white when we looked at it. I can't remember if we had three segments or 9 segments or some other multiple of three but, it proved stuff to me (back in the 1960s). Dec 6, 2022 at 13:32
• You can reproduce many colors but there's a limited gamut available with your three LEDs. It may be enough if you are not too picky. Dec 6, 2022 at 13:55

Have a look at https://en.wikipedia.org/wiki/RGB_color_spaces Depending on the wavelengths chosen for the red, green and blue LED you could not mix any color. Colors outside the defined color triangle could not be mixed. Each LED may have only a positive intensity. Colors outside the triangle would require at least one negative intensity and could not be mixed using the chosen wavelengths.

"The human eye with normal vision has three kinds of cone cells that sense light, having peaks of spectral sensitivity in short ("S", 420 nm – 440 nm), middle ("M", 530 nm – 540 nm), and long ("L", 560 nm – 580 nm) wavelengths."

If you use one or more LED with a wavelength far outside the ranges of the cone cells some colors could not be mixed, colors that would be mixable using a better selection of LED wavelengths. So if you use 430, 460 and 480 nm, you could not trigger the cone cells for red.

• Note that those peak wavelengths don't tell the whole story. Those curves have long tails The tail is very important into the red, and a bit less important into the blue. 580nm will look orange, not red. To get anything that looks red you need the L cones to have much greater sensitivity than the M, i.e. beyond about 620nm. Common red LEDs are 640nm which is a good strong red, though it still doesn't look saturated. 440nm is already looking cyan-ish, 420nm makes for better blue Dec 7, 2022 at 10:18

Roughly speaking, alternating between two LEDs at high rate looks exactly same as lighting them both up simultaneously - assuming the LEDs don't move so you won't see them alternating.

Just look at your computer monitor with some magnifying glass.

Red and green lights added together appears yellow. Zoom in to a yellow part of the screen and you will see red and green subpixels lit.

If you switch between red and green, it will appear some sort of yellow, depending on exact balance of the spectrum and intensity of red and green LEDs.

However, if the LED moves or you move your eyes rapidly, you can see it making a line which alternates between red and green. Even at 250 Hz. Just like watching movies with rapid movements on DLP projectors. Some toys with moving LEDs make this phenomenon very visible.

RGB LEDs allow reproducing any colour (within the limits of the relative LED spectrums and intensities obviously) including white with the correct balance of RGB intensities.

Typical addressable RGB LED has a built in PWM circuitry to drive the three individual LEDs with 8-bit resolution, thus allowing for 16 million colours like typical LCD screens.

• It doesn't even have to move fast at 250Hz - to get 1mm lines of each colour would be less than walking pace. A 1kHz PWM frequency on a bike light is easy to spot (and estimate) from the streaks formed by drops of water thrown off the front wheel. You can get some pretty neat effects if you play with the drive frequency and motion speed, like making a disc appear to spin the wrong way (I keep meaning to do that on my bike wheels with a microcontroller to measure the rotation rate and pulse LEDs a little slower) Dec 7, 2022 at 10:32

## That is how LEDs make color!

Hit Amazon and get yourself a \$15 LED strip kit (with LED strip typically 5m, RGB controller, remote, power supply). Throw it together and play with it.

(they show the LED spool making a rainbow; that is false advertising; with this type using 5050 LEDs the entire spool can only be one color at once. But it can be any color. "Individually addressible" LED strips do exist that can rainbow like that, but are not useful as a teaching tool to answer your question.)

Put an oscilloscope on the controller outputs and look at the signal. It's a square wave with varying duty cycle AKA "PWM dimming".

Now, disconnect the blue wire from the controller. Your LED strips will now only do red/green/amber and things in that spectrum. Those are the same colors you will get from your red/green bicolor LED if you sent PWM to it.

The trick with a 2-pin bicolor LED is your maximum duty cycle for R or G can't exceed 50% (or rather, can't sum to more than 100%).

And yup, the same thing works with a tricolor LED, though presumably that has four pins so you can go 100% duty cycle on each channel.

• More false advertising: That rolled-up LED strip in the picture looks a lot longer than 5m. Dec 7, 2022 at 15:47
• @Hearth Au contraire. Apart from the colors, that really is a photo of a typical china-sourced 5m spool for SMD5050/10mm width/IP20 stripes, loaded with a 30 LEDs per meter stripe. Source: The spools I have at home. Dec 7, 2022 at 16:04
• Yeah, the reel size is typical for an LED strip. I have miles of them - sorry, kilometers :) Dec 7, 2022 at 19:03

I do exactly this for front panel LEDs on my equipment at work. Running at 100Hz, I can create distinctly different red, orange, yellow and green states.

The catch is that you don't just need a fast switching frequency. If you want to create colours, you need to vary the percentage of time an LED is on - so if you want to be able to vary intensities with a resolution of 1%, you need to be updating your LED states at 10kHz.

Even with this though, you do have the problem that the individual red and green elements of a bicolour LED are fairly visible if you've got an LED with a clear housing, so you will tend to see two distinct red and green lights instead of one light of the combined colour. You either need an LED with a frosted housing or you need some kind of frosted element in the way.

That said though, mixing yellow from red and green LEDs is always unsatisfactory. We're used to seeing fairly warm yellows, whereas LEDs will always give you something more like a hazard-suit yellow. For stage lighting where this is important, better-quality lights often add separate amber LEDs to give a more convincing shade of yellow - these are denoted RGBA.

Mixing white from RGB has the same problem. We know the clarity we expect from white light, and RGB elements simply can't deliver it. So again, better-quality stage lights often add a separate white LED to do this properly, giving us RGBWA lights.

• One of the complications regarding stage lighting is that is an illumination use case rather than direct observation. Which means the thing you are shining the light on then filters what is observed. So really high end fixtures use only white LEDs (which are full spectrum), and filter them like incandescent fixtures did. Dec 8, 2022 at 0:36