3.3 V or 5 V
The LED takes its own voltage off the top before the resistor sees anything, so dropping the rail from 5 V to 3.3 V does not take a third off the current — it takes nearly all of it off the green, blue and white segments and leaves the red ones working.
The forward voltage comes off first
There are two things in series with each segment: the LED and the 220 Ω. They do not share the rail proportionally. The LED takes its forward voltage — whatever that is for its colour — and the resistor gets the remainder.
So the sum that matters is a subtraction before it is a division:
current = (rail − forward voltage) ÷ 220 Ω
Take 1.7 V off a 5 V rail and a red segment loses half its current. A blue one loses almost all of it, because it was only ever using 2 V of the 5 to begin with.
What to do about it
If the project is a 3.3 V board — an ESP32, a Pico, a Raspberry Pi — the fix is not to change the bar, it is to take COMMON from somewhere else. Almost every 3.3 V development board has a 5V or VIN pin carrying the USB supply. Put COMMON there.
The GPIO pins are unaffected by this. They are the bottom of the circuit and they only ever sink current, so a 3.3 V pin switching a segment whose top is at 5 V is doing nothing unusual. When that pin drives HIGH, there is 1.7 V left across the resistor and the LED, which is below every one of these LEDs' forward voltage — so the segment is properly dark, not faintly on.
The one thing to be careful of
5 V sitting on COMMON while the 3.3 V board is unpowered is the case to avoid: the rail can then push current through an LED and into a pin whose chip has no supply. In practice that means taking the 5 V from the same board that is driving the bar, so the two come up and go down together.
Which colour for which rail
- 5 V rail: any of the six. This is what the kit is designed around.
- 3.3 V rail, 5 V available: any of the six, with COMMON on the 5V pin.
- 3.3 V and nothing else: red or yellow. The nitride colours have nothing left to run on.
When it does not work
Because COMMON is on the 3V3 pin. A blue segment keeps about 3 V for itself, so a 3.3 V rail leaves a fraction of a volt for the 220 Ω and the current is a milliamp or two. Move the COMMON wire to the board's 5V or VIN pin: the GPIO pins are still doing the switching and they only ever sink.
Yes, while the 3.3 V board is powered. A pin driving 3.3 V leaves only 1.7 V across the resistor and the LED, which is below any of these LEDs' forward voltage, so no current flows and the segment is properly off. The case to avoid is 5 V present while the 3.3 V board is not powered — unplug both together, or take the 5 V from the same board.
For red and yellow, yes: 100 Ω from 3.3 V gives about 13 mA. For blue, green and white there is nothing to work with — at 3.3 V there is only a fraction of a volt left after the LED, and no resistor value recovers a supply that is not there.
It is fine. A red segment drops about 2 V, so 3.3 V leaves 1.3 V across the resistor and about 6 mA flows. Half the brightness of the same bar at 5 V, and perfectly readable — which makes red and yellow the colours to reach for on a 3.3 V-only project.
Red and yellow only, and dimly — about 4 mA. The nitride colours do not light at all below their own forward voltage. If a battery project needs blue, it needs a boost converter before it needs a bar graph.
What ten segments cost in GPIO, and when that stops being affordable.
Ten pins, or three →Edit this page — content/books/led-bar-graph/three-volts-or-five.mdx
Questions about this product
See what other owners have asked, and read their solutions.
10-Segment LED Bar Graph Kit, 12 Bars in 6 Colours
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.