Source: https://mokxi.com/parts/sevenseg4
Updated: 2026-11-10

Part

# Four-digit seven segment, multiplexed

Four digits on twelve legs: one digit at a time, fast enough that the eye sees all four.

See every part

- 12 pins
- 2 settings
- In 1 project
- In 1 lesson

Drawn live by the editor's own code, at the size you see it.

At a glance

## The Four-digit seven segment, multiplexed in brief

What it is, and every setting the properties panel gives it.

The 5641AS is the bare four-digit seven-segment display in starter kits: four 0.56 inch digits on twelve legs, with no driver chip. Eight legs are the segments A to G and DP, each wired to that segment in all four digits, and four are the digit commons DIG1 to DIG4. The 5641AS is common cathode and the 5641BS common anode, a property. On an Uno the usual wiring is the segments on pins 2 to 9 through 220 ohm resistors and the commons on 10 to 13; on an ESP32 it is twelve free GPIOs, and 3.3 volts lights the segments more dimly. Only one digit can show at a time, so the sketch scans them. Mokxi models the 32 segments as LEDs and the eye as two poles of 15 milliseconds: a scan of 50 Hz or faster reads as four steady digits a quarter as bright, a slower one flickers, and changing the segments before switching the old digit off paints a faint ghost. The classic mistakes are resistors on the commons, which dims a digit as more segments light, and a delay() elsewhere in loop() that stalls the scan. Colon variants and brightness spread are not modeled.

Family

Displays

Pins

12

common

cathode (or anode)

cathode (a 5641AS, digits selected by pulling their common low) or
anode (a 5641BS, digits selected by pulling their common high and segments lit by
pulling them low).

color

red (or green, blue, yellow, white)

the LED color.

Pins

## 12 pins

Named as the editor names them, so a wire lands where you expect it.

- E
- D
- DP
- C
- G
- DIG4
- B
- DIG3
- DIG2
- F
- A
- DIG1

How to use it

## How to use a 4-digit 7-segment display with an Arduino

Segments A to G and DP go to pins 2 to 9, each through its own 220 ohm resistor, and the four digit commons, DIG1 to DIG4, go straight to pins 10 to 13. Each segment leg feeds that segment in all four digits, so only one digit can show at a time: the counter here shows each digit for four milliseconds and moves on, and the eye reads four steady digits.

On this common-cathode 5641AS a digit is on while its common is LOW and a segment lit while its leg is HIGH. Switch every common off before you change the segments, or the old digit shows a faint ghost of the new one; move that line in the sketch and look closely. A delay() anywhere else in loop() stops the scan and leaves one digit lit.

Part pin

Board pin

A, B, C, D, E, F, G, DP

Pins 2 to 9, each through 220 ohm

DIG1

Pin 10

DIG2

Pin 11

DIG3

Pin 12

DIG4

Pin 13

On an ESP32 the same scan runs on twelve free GPIOs; from 3.3 V the segments get less current through the same 220 ohm and look dimmer.

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

One digit of the scan, from the four-digit counter

How it is modeled

## What is true about the Four-digit seven segment, multiplexed, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Modeled

Each segment is the same diode as the LED. A common leg carries the
current of every segment lit on it, which is eight segments' worth for an "8." and
more than a microcontroller pin should sink: the textbook circuit puts a transistor on
each common, and the part will tell you the current if you probe it. Put the resistors
on the segment legs, not the commons, or the digit dims as more segments come on.

### Not modeled

The colon and apostrophe some variants have. Segment-to-segment brightness spread.

From Four-digit seven segment display, in full.

Projects

## See the Four-digit seven segment, multiplexed in a project

One built-in project uses it. It opens in the editor, already wired.

Lessons

## Where it turns up in a lesson

One lesson places it in its own circuit.

### Learn articles

1 lesson

- Arduino 4 Digit 7 Segment Display: Wiring and Code

Boards

## The boards it is shown on

This board has a built-in project with the Four-digit seven segment, multiplexed in it.

- Arduino Uno R3

Libraries

## Arduino libraries for the Four-digit seven segment, multiplexed

Built in, so the sketch compiles with nothing to install. Each page has the calls, the wiring and an example to run.

- SevSeg

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the Four-digit seven segment, multiplexed

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
