How does a 7-segment display work?
The digits on clocks, meters, oven and air-con panels are really 7 (8 with the dot) small LEDs. Tap the segments and watch which one lights and why.
🎮 Play: tap the segments or pick a digit
Display type
Code (dp g f e d c b a)
🔬 What's inside? Every segment is an LED
Common cathode: the negative ends (cathodes) of all the LEDs are joined and brought out on the COM pin. COM goes to ground; to light a segment you feed + (HIGH, 1) to its pin through a resistor.
📌 Pinout (10-pin single digit, e.g. 5161AS / 5161BS)
front view, decimal point at bottom right
Hover over or tap a segment: its pin lights up yellow. Pinouts can vary by maker; confirm by measuring.
🧮 Resistor calculator: one resistor per segment
R = (Vcc − Vf) / I = 300 Ω → use a standard 1000 Ω (100 mW)
Why not a single resistor on COM? With a shared resistor the current is split among the lit segments: a 1 looks bright and an 8 looks dim. Each segment gets its own resistor.
⚡ Multi-digit displays: scanning (multiplexing)
A 4-digit display has 8 segments + 4 digits = 12 pins instead of 4 × 8 = 32. The segment lines are shared by all digits; the processor lights the digits one at a time, very fast. Your eye thinks they're all on at once (persistence of vision). Slow it down and see:
Scan speed
Segment lines (a…g, dp): shared by all digits
Digit select (D1…D4): switched on in turn
Digit lit right now: D1 → “1”
🔧 Find the type and pins with a multimeter
- Set the meter to diode mode. Put the red probe on one pin and touch the black probe to the others in turn: if a segment glows faintly, the red end is an anode and the black end a cathode.
- If one pin lights every segment while the black probe is on it, that pin is the common cathode (CC); if it does so with the red probe on it, it's common anode (CA).
- The common pin is usually one of the two middle pins (3 and 8); they're joined inside.
- A segment that never lights is an open LED. Half-lit (ghosting) segments on a board usually come from the scan timing or a driver transistor.
🔌 How is it driven?
- •Straight from processor pins: 8 pins + a resistor per segment (e.g. 220–330 Ω on an Arduino).
- •74HC595 shift register: 8 segments from 3 pins; extra transistors for scanning a multi-digit display.
- •CD4511 / 74HC4511 (BCD → 7-segment decoder for common cathode): turns a 4-bit number straight into a digit.
- •MAX7219 / TM1637 ready-made drivers: handle the scanning and current setting themselves; up to 8 digits.