LED bar graph, 10 segments
Ten LEDs in a row in one DIP, each with its own two legs and its own resistor.
- 20 pins
- 1 setting
- In 2 projects
- In 1 lesson
The LED bar graph, 10 segments in brief
What it is, and every setting the properties panel gives it.
The 10-segment LED bar graph, sold as the DC-10 or simply an LED level meter, is ten separate LEDs in a DIP-20 block with no chip inside. Pins 1 to 10 are the anodes A1 to A10, and the cathodes come back along the other side, so C1 is pin 20, straight across from A1, and the block straddles a breadboard’s channel. Each bar wants its own resistor: on an Uno, anodes on pins 2 to 11 through 220 ohms and every cathode to ground; on an ESP32, ten free GPIOs at 3.3 volts, where blue and white bars, with their higher drop, are much dimmer. Mokxi models each bar as the plain LED, with a forward drop set by the color property (red, green, blue, yellow or white), nothing at all when reversed, and a two-pole 6 millisecond eye average, so a PWM bar looks dimmer instead of flickering and a fast chaser keeps up. The classic mistakes are the block in backwards, which leaves every bar dark, and one shared resistor in the ground return, which dims every bar as more come on. Bar-to-bar brightness spread, the mixed-color blocks and heat are not modeled.
- Family
- Displays
- Pins
- 20
- color
- red (or green, blue, yellow, white)
- red, green, blue, yellow or white.
20 pins
Named as the editor names them, so a wire lands where you expect it.
- A1
- A2
- A3
- A4
- A5
- A6
- A7
- A8
- A9
- A10
- C10
- C9
- C8
- C7
- C6
- C5
- C4
- C3
- C2
- C1
How to use a 10-segment LED bar graph with an Arduino
It is ten separate LEDs, so it wants ten resistors. Anodes A1 to A10 go to pins 2 to 11, each through 220 ohm, and every cathode, C1 to C10, goes to ground. Pin 1 is at the chamfered corner, and each cathode sits straight across from its anode, so the block straddles the breadboard’s channel.
The level meter here maps a knob on A0 to whole bars and dims the top bar with analogWrite() where its pin has PWM (3, 5, 6, 9, 10 and 11), so the meter moves smoothly. One shared resistor on the ground return dims every bar as more come on, and a block in backwards lights nothing at all.
On an ESP32 ten free GPIOs work the same; at 3.3 V a blue or white bar, with its higher drop, is much dimmer than red or green.
What is true about the LED bar graph, 10 segments, here
In its help article’s own words: what the simulation gets right, and where it stops.
Modeled
Each bar is the same diode as the LED: a forward drop set by the color, the current your resistor allows, and nothing at all when it is reversed. Ten bars want ten resistors, or a resistor network; a single resistor in a shared return would dim every bar as more came on, as it does on the bench. Brightness is what the eye sees, so a bar dimmed with PWM looks dimmer rather than flickering.
Not modeled
Bar-to-bar brightness spread, the mixed-color versions (green, yellow and red bars in one block), and anything to do with heat.
From LED bar graph, in full.
See the LED bar graph, 10 segments in a project
2 built-in projects use it. Each opens in the editor, already wired.
Where it turns up in a lesson
One lesson places it in its own circuit.
The boards it is shown on
This board has a built-in project with the LED bar graph, 10 segments in it.
The rest of the bench
Every one of these is drawn and simulated the same way.
Wire up the LED bar graph, 10 segments
Open the editor and push it into the breadboard. It is free, and it runs on your own machine.