Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Yes—you can drive a bare four-digit seven-segment LED display directly from an Arduino Uno or Nano without installing a display library. Your sketch must provide the segment glyphs, select one digit at a time, and refresh the digits quickly enough that persistence of vision makes them appear continuously lit.
This guide covers identification, wiring, current limiting, multiplexing, a complete common-cathode sketch, common-anode changes, useful display functions, and the faults that most often produce flicker, ghosting, or scrambled numbers. It applies to a bare multiplexed display, not a TM1637 module with a built-in controller.
First identify the hardware
A typical bare four-digit display shares eight LED lines—segments a through g and decimal point dp—between four digits. Four additional pins select the digits, for about 12 control lines. Some packages add colon or apostrophe LEDs and have 16 pins, so the exact part number and datasheet always take precedence. The SparkFun SevSeg documentation describes the usual eight-segment/four-digit arrangement (reference).
Free tools Windows power users keep installed
One-click scans. No signup required.
A TM1637 board is different: its controller handles scanning and exposes a two-wire, I²C-like interface. It is not wired like a raw LED package (Arduino documentation).
#1 Best Overall
- 4-Digit Digital Tube Display Module: The Driver Ic Is Tm1637, Only Two Signal Lines Can Make Mcu Control Four Digit 8-Segment Led. Can Be Used To Display Decimal, Letters And So On
- Working Voltage:3.3V/5V DC
- Working Current:30 / 80MA
- Color: red highlights
- LED brightness adjustable:Digital tube 8-level grayscale adjustable
Common-cathode versus common-anode
- Common-cathode: a digit common is normally enabled LOW at the LED cathode side, while a lit segment is driven HIGH. (If you drive the common through a transistor, the Arduino-level polarity may be inverted.)
- Common-anode: a digit common is normally enabled HIGH, while a lit segment is driven LOW.
Do not infer the type from color, shape, or a suffix. For example, Kingbright’s CA56-11EWA is explicitly common-anode (datasheet), while other four-digit parts are common-cathode.
Find the pinout safely
- Use the datasheet first. Search the complete part number printed on the display or its packaging. Pin numbering and digit order vary by manufacturer.
- Use diode-test mode. Disconnect the display, select the multimeter’s LED/diode range, and test a suspected common against segment pins. Reverse the probes and record which polarity lights a segment. Use the meter’s current-limited mode or add a resistor.
- Map an unknown part manually. Test one pin pair at a time through a resistor and record the result in a table: physical pin, segment or digit common, and polarity. Never connect an unknown LED pin directly to a power supply.
Understand the scan
The segment lines are shared:
Digit 1 ─┐ Digit 2 ─┼── a, b, c, d, e, f, g, dp Digit 3 ─┤ Digit 4 ─┘
The firmware repeatedly turns every digit off, writes the next segment pattern, enables exactly one digit, waits briefly, disables it, and advances. A useful starting point is 1–3 ms per digit, or a complete scan every roughly 4–12 ms. Longer slots can look brighter but may flicker; shorter slots reduce brightness. Refresh must continue even when the displayed value has not changed.
Wire for safe current
Use eight segment resistors if the decimal point is needed, four digit-select connections, a breadboard, and jumpers. Put a resistor in each segment path unless the display board explicitly includes suitable resistors. A single resistor shared by all segments can make brightness vary with the numeral.
Choose current from the display and board datasheets rather than automatically using a stated maximum. The basic calculation is:
Rank #2
- 2 pieces of 4-digit 7-segment LED display module
- A colon-shaped programable LED in the middle of module as a seperator
- Perfect for displaying time: hh:mm, mm:ss...
- 7-segment LED Display for Arduino, ESP32, ESP8266, Raspberry Pi, or any 5V or 3.3V microcontroller.
- Tutorials for Arduino is provided
R = (VCC − VF − VSWITCH) / ILED
For 5 V, approximately 2 V forward voltage, and a chosen 10 mA segment current, R ≈ (5 − 2) / 0.010 = 300 Ω; 330 Ω is a nearby starting value. It is not universal. Forward voltage differs substantially by color and model; SparkFun lists examples around 2.1 V for one red part, 1.9 V for a white part, and 3.4 V for a blue part (specifications).
At higher peak current or when several segments are lit, use transistor drivers for digit commons. Verify the Arduino’s per-pin and total-port limits; multiplexing does not make an unsafe current safe.
Wire and test one digit first
Before writing a scanner, connect one digit common and the segment lines through resistors. Light the pattern for 8. Confirm that every segment and polarity behaves as expected. This isolates a wrong pinout from a timing bug. Then connect all four digit commons.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Complete no-library Arduino sketch
This example assumes a bare common-cathode display, segment pins wired in the order a,b,c,d,e,f,g,dp, digit pins wired left to right, and one resistor per segment. The short delay is only the active slot; there is no long application-blocking delay.
Rank #3
- For use library: TM1637.h.
- Digital tube 8 grey level is adjustable.
- Module connects to digital I/O on 2 pins.
- The control interface electrical level is 5V.
const byte segmentPins[8] = {2, 3, 4, 5, 6, 7, 8, 9}; // a..g, dp
const byte digitPins[4] = {10, 11, 12, 13}; // left to right
// Bit 0=a, bit 1=b, ... bit 6=g, bit 7=dp
const byte glyphs[10] = {
0b00111111, 0b00000110, 0b01011011, 0b01001111, 0b01100110,
0b01101101, 0b01111101, 0b00000111, 0b01111111, 0b01101111
};
byte displayDigits[4] = {1, 2, 3, 4};
void allDigitsOff() {
for (byte i = 0; i < 4; i++) digitalWrite(digitPins[i], LOW);
}
void writeSegments(byte pattern) {
for (byte i = 0; i < 8; i++)
digitalWrite(segmentPins[i], (pattern >> i) & 1);
}
void refreshDisplay() {
static byte currentDigit = 0;
allDigitsOff(); // blank before changing segments
writeSegments(glyphs[displayDigits[currentDigit]]);
digitalWrite(digitPins[currentDigit], HIGH);
delayMicroseconds(2000); // 2 ms slot
digitalWrite(digitPins[currentDigit], LOW);
if (++currentDigit >= 4) currentDigit = 0;
}
void setup() {
for (byte i = 0; i < 8; i++) pinMode(segmentPins[i], OUTPUT);
for (byte i = 0; i < 4; i++) pinMode(digitPins[i], OUTPUT);
allDigitsOff();
writeSegments(0);
}
void loop() {
refreshDisplay();
}
The glyph table uses bit 0 for a through bit 6 for g. If your physical wiring differs, either reorder segmentPins or remap the table. A named map is preferable to unexplained binary constants:
const byte SEG_A = 0b00000001;
const byte SEG_B = 0b00000010;
// ... through SEG_G = 0b01000000, SEG_DP = 0b10000000
Adapt the sketch to common-anode
Invert both segment and digit logic at the Arduino interface:
void allDigitsOff() {
for (byte i = 0; i < 4; i++) digitalWrite(digitPins[i], HIGH);
}
void writeSegments(byte pattern) {
for (byte i = 0; i < 8; i++)
digitalWrite(segmentPins[i], !((pattern >> i) & 1));
}
// In refreshDisplay():
allDigitsOff();
writeSegments(glyphs[currentValue]);
digitalWrite(digitPins[currentDigit], LOW);
delayMicroseconds(2000);
digitalWrite(digitPins[currentDigit], HIGH);
If transistor stages are used, check the logic at the transistor interface; an NPN, PNP, N-channel, or P-channel stage can invert the expected Arduino level.
Add numbers, blanks, decimal points, and symbols
Four-digit integers
void setNumber(unsigned int value) {
displayDigits[3] = value % 10; value /= 10;
displayDigits[2] = value % 10; value /= 10;
displayDigits[1] = value % 10; value /= 10;
displayDigits[0] = value % 10;
}
This intentionally shows leading zeroes: 42 appears as 0042.
Rank #4
- Docs: github.com/nulllaborg/4_digit_clock_display_module. Comprehensive technical support is available for all our products. Feel free to contact us.
- Supports integers, decimals, and individual digit control at specific positions. The central colon (:) can be toggled on or off for digital clocks, timers, stopwatches, or sensor data readouts.
- Simple I2C interface with SDA and SCL connections, occupying only 2 I/O pins for easy programming, operates on 5V power input, and is compatible with HT16K33 protocol.
- Features immersion gold process and anti-reverse PH2.0 interface for reliable connections and durability.
- Wide Microcontroller Compatibility: Compatible with Arduino, ESP32, Raspberry Pi, and other microcontrollers for flexible integration into various projects.
Suppress leading zeroes
Reserve an all-off glyph, const byte BLANK = 0;, and blank higher positions until the first significant digit. Keep one zero visible when the value itself is zero. Your display buffer should hold glyph bytes, not only decimal digits, if it must mix blanks, minus signs, and letters.
Decimal points
With dp in bit 7, add 0b10000000 to a glyph. Whether that lights the point directly depends on common-anode inversion in writeSegments().
Letters
const byte LETTER_A = 0b01110111;
const byte LETTER_b = 0b01111100;
const byte LETTER_C = 0b00111001;
const byte LETTER_d = 0b01011110;
const byte LETTER_E = 0b01111001;
const byte LETTER_F = 0b01110001;
Seven segments cannot represent a complete, unambiguous alphabet. Characters such as M, N, Q, R, S, and W are approximations or impossible, and upper/lowercase forms may look alike.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Keep refresh timing separate from application timing
The display scan is a fast, repetitive task; a counter, sensor read, or button action is slower. Do not put delay(500) or delay(1000) around value updates if the same loop is responsible for scanning. Use millis() for slower work while calling refreshDisplay() continuously, or move scanning to a hardware-timer interrupt when other code has unpredictable execution time. Arduino multiplexing examples likewise recommend short intervals or timer-driven refresh rather than long blocking pauses (discussion).
Best Value
- High Performance Driver Module: Features TM1637 controller with 2-pin connection for stable 5V operating ensuring reliable digital display output
- 4-Digit 7-Segment Display: Each digit includes individual decimal point control allowing flexible numeric or symbol customization for various projects
- Plug-and-Play Installation: Measured 2.59x1.07x0.47in, pre-soldered pin headers clear off complex wiring processes enabling effortless setup within minutes
- 0.56 inch LED Segments: High-visibility red LED display 0.56 inch segments provide clear viewing from multiple angles in DIY applications
- Complete Package Includes: Including 4pcs display modules and 8 pin headers ready for immediate integration compatible with Ar-duino and compatible with Raspberry Pi projects
Troubleshooting
| Symptom | Likely cause | Test or fix |
|---|---|---|
| No segments light | Wrong display type, common pin, polarity, or missing ground | Return to diode-test mode and light one segment through a resistor. |
| All digits show the same value | Several digit lines enabled, floating inputs, or reversed disable level | Blank all digits, write segments, then enable exactly one digit. |
| Only one digit works | Wrong common-pin map, broken wire, or faulty transistor | Test each common independently with a known pattern. |
| Mirrored or scrambled numbers | Segment array order or digit order does not match wiring | Light one segment at a time and record its physical location. |
| Ghosting | Segments changed while a digit was still enabled | Use the blank–write–enable sequence and ensure switches turn fully off. |
| Flicker | Refresh blocked by delays, serial output, or heavy interrupts | Shorten the scan slot and move slow work outside the scanner. |
| Uneven brightness | Unequal slot timing, shared resistor, or unequal driver drops | Use one resistor per segment and a fixed slot for every digit, including blanks. |
| Very dim display | Large resistor, short duty cycle, high forward voltage, or insufficient drive | Check the part's VF/current data and add suitable transistor drivers; do not simply remove resistors. |
| Arduino resets | Excessive LED/digit current or supply transients | Limit current, use external drivers/supply where appropriate, and share ground. |
When a driver is the better choice
Direct GPIO is best for learning, unusual pin mappings, and small projects where you have 12 available control lines and can dedicate processor time to refreshing. It offers maximum control but requires careful current design and responsive timing.
A TM1637 module needs only two signal wires and is convenient, but its controller hides the raw multiplexing. An HT16K33 board provides I²C and hardware scanning; Adafruit's four-digit FeatherWing uses selectable addresses in the 0x70–0x77 range (product documentation). A MAX7219 includes scan circuitry but is specified for common-cathode displays (datasheet), so it is not a universal solution for common-anode parts. A 74HC595 saves GPIO pins but does not itself solve multiplex timing, current limiting, or digit-driver capacity.
Choose a bare common-cathode display if you want the tutorial's polarity to match your hardware; choose a bare common-anode part if you are prepared to invert the logic and verify its pinout. Driver-backed modules are preferable when pin count, consistent brightness, or CPU time matters more than learning the LED scan itself.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

