Three resistors, three currents
Every colour has the same 1 kΩ resistor, and the three currents are still different. Red takes about 0.9 V less than green and blue, so it keeps more for its resistor: about 3.1 mA from 5 V against about 2.2 mA, and from 3.3 V nearly three times as much.
Where the volts go
Each bar is the pin's voltage split between one LED and its resistor. The LED's share barely moves as the pin voltage changes. The resistor gets everything left over, and only that share sets the current: volts left over, divided by 1 kΩ.
The three LEDs do not take the same share. Red is a different material from the other two, and it needs less voltage to conduct. The datasheet gives, at its test current of 20 mA:
| Colour | Forward voltage | Light at 20 mA |
|---|---|---|
| Red | 1.95 to 2.35 V | 3.0 to 4.0 lm |
| Green | 2.75 to 3.35 V | 5.0 to 7.0 lm |
| Blue | 2.75 to 3.35 V | 1.0 to 2.0 lm |
Through 1 kΩ the currents are a few milliamps, not 20, and an LED takes a little less voltage at a lower current. This book uses about 1.9 V for red and about 2.8 V for green and blue. Those are estimates, not measurements, and every current below is "about".
Three currents from one pin voltage
From an Uno's 5 V:
red (5.0 V - 1.9 V) / 1 kΩ = about 3.1 mA
green, blue (5.0 V - 2.8 V) / 1 kΩ = about 2.2 mAFrom a 3.3 V board:
red (3.3 V - 1.9 V) / 1 kΩ = about 1.4 mA
green, blue (3.3 V - 2.8 V) / 1 kΩ = about 0.5 mAFrom 5 V, red gets about 1.4 times the current of the others. From 3.3 V it gets nearly three times as much. The pin voltage dropped by a third; green's and blue's headroom dropped from 2.2 V to 0.5 V, while red's only went from 3.1 V to 1.4 V. The XL LED's 3.3 V article makes the same argument for one blue LED.
What that costs
Every one of these is far inside every limit: the LED's own maximum is 50 mA for red and 30 mA for green and blue, and the weakest pin in this book, a Pico's at its default setting, may supply 4 mA.
The cost is in the colours. On their own, each colour is just dimmer on a 3.3 V board. Mixed, they are dimmer by different amounts, and a mix is a ratio. That ratio is what chapter 3 comes back to.
When it does not work
1 kΩ keeps every colour at a few milliamps: far inside the LED's ratings and any board's pin limit, even with all three on, and still plainly visible through the diffuser. With 150 Ω green and blue would take about 15 mA each from 5 V.
Not from the pin itself. Green and blue take about 2.8 V, and a 3.3 V pin leaves only about 0.5 V for 1 kΩ. The resistors are soldered to the board. If brightness matters, drive the block from a 5 V board, where they get about four times the current.
No. They come from the datasheet's forward voltages, taken at the bottom of its range because the LEDs run at a few milliamps rather than the datasheet's 20 mA. Your LED may be a few tenths of a volt either side, and from 3.3 V that moves green and blue a lot. Treat every number here as approximate.
No. The most any pin supplies here is red's, about 1.4 mA from a Pico's 3.3 V, well inside its default drive of 4 mA. From an Uno the largest is red's, about 3 mA, against the ATmega328P's 40 mA limit.
Edit this page — content/books/rgb-led/three-resistors-three-currents.mdx
Questions about this product
See what other owners have asked, and read their solutions.
RGB LED
Loading discussions…
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.