PAGE 118 OF 150 · MICROCONTROLLERS & LEDS
Colour Mixing with RGB LEDs
Mixing red, green and blue makes other colours.
LED SYMBOLTriangle points from anode to cathode; the arrows show light leaving the part.
Adding light
RGB mixing is additive: red and green make yellow, green and blue make cyan, red and blue make magenta, and all three together make white.
In practice
- Each channel has a value from 0 to 255, giving about 16.7 million colours.
- The three LEDs differ in brightness, so you may need to scale them for a balanced white.
- Use hue, saturation and value for smooth rainbows, then convert to RGB.
Match the resistors to each colour's forward voltage so the channels stay in proportion.
REMEMBER
Equal values rarely look white until you balance the channels.Try it yourself
Sketch the circuit on paper first, calculate the values, then build it on a solderless breadboard using a low-voltage supply. Measure with a multimeter before you make anything permanent.
Explore LED clocks, stopwatches and electronics at cosycom.com.