Topics/Displays/10-Segment LED Bar Graph Display
DIGITALbeginner

10-Segment LED Bar Graph Display

Ten independent LEDs in one 20-pin package, with a resistor board that puts 220 Ω in front of each. Which way round it goes, why LOW lights a segment, and what ten of them at once costs an Arduino.

10-Segment LED Bar Graph Kit, 12 Bars in 6 Colours

Specifications

In the box12 bar graphs, 2 each of 6 colours; 12 resistor boards; 12 printed frames; male pin header strips; a storage case
Segments10 per bar, each an independent LED with its own anode pin and cathode pin. No driver chip, nothing to initialise
Package20 pins on a 2.54 mm pitch in two rows 7.62 mm apart, so it straddles a breadboard's centre channel. Body 25.4 × 10.1 mm, 14.2 mm tall
Resistor board10 × 220 Ω chip resistors, marked 221, each from one hole in the TO SEGMENT LED DISPLAY row to the COMMON rail. Ships with no pins fitted
ColoursRed, yellow, green, blue, white, and a multicolour bar of 2 red, 3 yellow, 2 green and 3 blue segments
Forward voltageAbout 2 V for red and yellow, about 3 V for green, blue and white. Typical for the chemistry rather than measured
Segment currentAbout 14 mA for a red or yellow segment and about 9 mA for green, blue or white, from a 5 V rail through the board's 220 Ω
RailCOMMON goes to 5 V, not to ground. The GPIO pins sink the current, so writing LOW lights a segment
Pins it needs10 digital outputs, one per segment — or 3 through a pair of 74HC595 shift registers
On an Arduino UnoNine of the ten pins share one 100 mA sink budget in the ATmega328P, and ten red segments at once is about 122 mA of it

What it is

Ten LEDs in one package, side by side behind a black face, with twenty pins: ten anodes along one edge and ten cathodes along the other. There is no driver chip in it. Each segment is an ordinary two-pin LED that happens to share a piece of plastic with nine others.

That makes it the simplest display you can buy and the most literal: one wire per segment, one digitalWrite per segment, and nothing in between to misconfigure.

Six ten-segment bar graphs standing in a row on a dark surface, each fully lit: red, yellow, white, green, blue, and one multicolour bar whose segments run red, then yellow, then green, then blue from left to right.
All six colours in the kit, every segment lit. Two of each, twelve in the box.

What is in the box

Twelve bars — two each of red, yellow, green, blue, white and multicolour — twelve current-limiting resistor boards, twelve printed frames, strips of male pin header for the boards, and a case.

The open kit case: a teal card printed 10 SEGMENT LED BAR GRAPH DISPLAY with the lonely binary logo, two long strips of black male pin header, a panel of black resistor array boards, and a dozen bar graph packages in grey frames, each with two rows of silver pins.
The resistor boards arrive joined in a panel and with no pins fitted. The header strips beside them are what goes in.

The resistor board

Ten chip resistors marked 221 — 220 Ω — each running from one hole in the row printed TO SEGMENT LED DISPLAY down to a rail that surfaces at four holes printed COMMON. That is the entire circuit, and twelve of them save you soldering a hundred and twenty resistors.

The front of the resistor array board: a row of ten plated holes above the words TO SEGMENT LED DISPLAY, ten small chip resistors marked 221 in a line beneath, and a lower row of four plated holes either side of a white label reading COMMON.
COMMON is the positive end of every segment, not a ground. It goes to 5 V.

Which colour for which rail

Rail on COMMONRed, yellowGreen, blue, white
5 Vabout 14 mA, brightabout 9 mA, bright
3.3 Vabout 6 mA, readablea milliamp or two, very dim
3 V cellabout 4 mA, dimdoes not light

The LED takes its own forward voltage before the resistor gets any say, so dropping the rail hurts the 3 V colours far more than the 2 V ones. 3.3 V or 5 V works it out.

Wiring, in four lines

  1. Put the bar across the breadboard's centre channel.
  2. One row of its pins to the resistor board's TO SEGMENT LED DISPLAY row, segment for segment.
  3. The board's COMMON row to 5V.
  4. The bar's other row to ten digital pins — D4 to D13 in the handbook's sketches.

No ground wire to the bar: the GPIO pins are the ground end of every segment. If the bar stays dark, turn it end for end — one row is the anodes and nothing printed on the part says which.

Where to start

The handbook below is eleven short articles with a working figure in each. If you only read one, read COMMON to 5 V, which is the wiring and the reason LOW means on. If it is already wired and dark, when nothing lights separates the four faults that all look identical.

When it doesn’t work

Which row of pins is the anode row?
Nothing printed on the part tells you, and the part number on the body is not a reliable guide — the product renders reuse one number across several colours. You find out by trying it: wire it up, run the sketch, and if the bar stays dark, lift it out and turn it end for end. With the kit's 220 Ω resistor board in the circuit there is nothing that can be damaged by having it the wrong way round — an LED simply does not conduct backwards, so no current flows at all.
Why does writing LOW turn a segment on?
Because the microcontroller is the bottom of the circuit, not the top. Current comes down from 5 V through the 220 Ω and the LED into a GPIO pin, and it only flows if that pin is holding 0 V. Writing HIGH does not switch the segment off so much as remove the difference across it: the pin drives 5 V, COMMON is at 5 V, and there is nothing left to push. The arrangement is called active low, and it is how most LEDs are driven from a microcontroller.
The resistor boards have no pins on them.
That is how they ship, and the header strips in the box are what go in them. Break a ten-way piece off a strip, push it through the row printed TO SEGMENT LED DISPLAY from the printed side, and solder all ten from the back; then do two or four of the COMMON holes so the board does not pivot in the breadboard. A header that is pushed through and not soldered makes contact some of the time, which looks exactly like a bug in your sketch.
Can I run it from an ESP32 or a Pico?
Yes, and the GPIO pins are not the problem — they only ever sink current here. What matters is where COMMON goes. On a 3.3 V rail there is almost nothing left after a green, blue or white LED's own 3 V, so those bars barely light; take COMMON from the board's 5V or VIN pin instead. Red and yellow bars work acceptably straight off 3.3 V at about 6 mA a segment.
Why is my blue bar dimmer than my red one?
Forward voltage, and the code has nothing to do with it. A red LED keeps about 2 V for itself and a blue one about 3 V, so behind the same 220 Ω on the same 5 V rail the red segment gets about 14 mA and the blue about 9 mA. On the multicolour bar both kinds are in the same package, which is why its blue end looks softer than its red end.
Is it a problem to light all ten segments at once?
On an Arduino Uno, slightly. The ATmega328P's data sheet budgets sink current by port group rather than by pin, and nine of the demo sketch's ten pins are in the same group — ports B0 to B5 and D5 to D7 — whose sum should stay under 100 mA. Nine red segments at 14 mA is about 122 mA. Nothing is damaged; what the data sheet stops promising is that a pin still holds a proper LOW, so the bar dims slightly and unevenly. Light fewer at once, use one of the 3 V colours, or drive it through a shift register.
Do I need a ground wire to the bar?
Not a separate one, if the same board drives it: the GPIO pins are the ground end of every segment, so the return path is through the microcontroller. If the bar and the driving board have different power supplies, then yes — they must share a ground.
How many pins does it cost?
Ten, one per segment, wired straight. That is fine for one bar and leaves eight of an Uno's eighteen usable pins. Two bars does not fit, and the usual answer is a 74HC595 shift register — three wires for as many bars as you like, with the LED current coming off the register's supply rather than the microcontroller's port group.

The LED bar graph handbook

11 articles · about 55 minutes

This page is the reference: what the part is, what it is made of, and the questions people arrive already asking. The handbook is the walk — the same part in the order somebody actually meets it.

Why a bar of ten

2 articles

A number you can read without reading. Ten separate LEDs in one package, twenty pins, and no chip anywhere in it.

What is in the box

2 articles

Twelve bars in six colours, twelve resistor boards with no pins in them yet, and a difference between the colours that shows up the first time you run it off 3.3 V.

Making it light

2 articles

COMMON to 5 V, ten pins to the other row, and a sketch whose LOW means on. Where the polarity comes from and what happens when it is backwards.

What ten segments cost

3 articles

Current, rail voltage and pins — the three budgets a bar graph spends, and the one the data sheet has an opinion about.

A build and a check

2 articles

A knob that moves the bar, the rounding that decides which segment lights, and what to look at when none of them do.

Edit this page — content/modules/led-bar-graph.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

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.

Browse Modules and blocks on the forum