Arduino 4-Digit 7-Segment Display Multiplexing
Level 19 · Level 19 — All Four · 25 minutes
Four digits on one bus. Nothing can show them at once, so the sketch strobes faster than the eye.

Preview the project free; a course seat is required to run and submit. No hardware kit needed.
Your project challenge
Make the display read 3141. Only one digit can be lit at a time. Light them in turn, fast enough that all four look steady. Wire it up: - Segments a-g and dp to D2-D9 (one shared bus) - Commons d1-d4 to D10-D13 (one per digit) Set every common HIGH before you change the bus. Never stop the loop.
Components you’ll use
- Arduino Uno
- 4-Digit 7-Segment Display
What you'll build
A display reading 3141, on hardware that lights one digit at a time.
How it works
- A 4-digit display is not four displays. Twelve pins, thirty-two LEDs, so the pins get shared.
- One shared bus, eight wires across all four digits: a to g plus dp on
D2-D9. - Four commons, d1 to d4, on
D10-D13. Each picks a digit, which lights only while its own common is LOW. - Ground all four at once and every digit wears the whole bus: the bars pile up and you read
9999.
The key idea
The way out is not electrical, it is time. Show one digit, blank all four commons back to HIGH, show the next, go round.
2 ms per digit × 4 = 8 ms frame = 125 frames a second
Your eye holds a light for roughly a fiftieth of a second, so all four look steady. That is multiplexing, and almost every scoreboard runs on it.
⚠ Watch out
- Draw all four once and stop: dark about 20 ms later. Keep the loop going.
- Blank before you change the bus, or the old digit flashes the new digit's bars: ghosting, faint extra segments.
The interactive editor includes the wiring guide, code editor and simulation controls.