DIGITALbeginner

74HC595 Segment LED

One 0.8-inch red seven-segment digit with a 74HC595 shift register under it, on a TinkerBlock board: three wires set all eight segments, one byte per digit, a 1 lights a segment. Common cathode, 150 Ω per segment, VCC on your board's logic supply, and no chaining: the 595's serial output is not connected.

Comes in this kit — not sold separately

Specifications

TypeOne seven-segment digit and decimal point, driven by a 74HC595 shift register: eight bits in on one wire, shown together when the latch rises
DigitARKLED SM420806N, 0.8 inch, red, common cathode: both commons on GND, so a 1 lights a segment
ChipNexperia 74HC595D, SOIC-16, under the digit. Q0 to Q7 drive segments a to g and the dot, in that order
Byte mapBit 0 is segment a, bit 6 is g, bit 7 the dot, sent MSBFIRST. 0 is 0x3F, 2 is 0x5B, 8 is 0x7F
Wires to your board5: GND, VCC, LATCH, CLOCK, DATA. NC is not connected
Supply2 to 6 V on VCC for the chip. VCC goes to your board's logic supply: 5V on an Uno, 3V3 on an ESP32, an ESP32-S3 or a Pico, because at 5 V the chip wants 3.5 V for a HIGH
Segment current150 Ω per segment: at most 8.7 mA a segment at 3.3 V, about 17 mA at 5 V. Arithmetic on the datasheets, not a measurement
Chip limit70 mA through the 595's VCC pin, absolute maximum. At 3.3 V all eight segments stay inside it; at 5 V more than 4 lit segments pass it
Tied offOE on GND (always on), MR on VCC (never cleared by a pin), Q7S not connected, so a second board cannot chain from this one
Header6-pin right-angle male, 2.54 mm pitch: GND-1, VCC-2, NC-3, LATCH-4, CLOCK-5, DATA-6, numbered on both faces. No square pad
Board22.4 × 41.0 mm, two 4.6 mm mounting holes 16 mm apart. The digit stands 10 mm off the board
In the box1 × TK53 block, header fitted. It also ships inside the TinkerBlock kits

What it is

One digit on three wires. A 74HC595 shift register sits under a 0.8-inch red digit: your board sends a byte down DATA, one bit on each pulse of CLOCK, then pulses LATCH, and the seven segments and the dot change together.

Drag to turn it
The TK53. The chip, eight resistors and a capacitor are all under the digit. Turn it over for the back.

Each of the chip's eight outputs drives one segment through its own 150 Ω resistor, in order: Q0 is segment a, Q6 is g, Q7 the dot. The digit is common cathode, so a 1 lights a segment, and a digit is one byte: 2 is 0x5B.

The page this replaces called the board chainable, labelled its segment table common anode, and suggested inverting the byte to fix a wrong digit. On this board the 595's serial output is not connected, the digit is common cathode, and inverting the byte lights everything but the digit.

Wiring, in five lines

Your boardVCC toLATCH toCLOCK toDATA to
Arduino Uno5VD8D12D11
ESP323V3GPIO 27GPIO 26GPIO 25
ESP32-S33V3GPIO 6GPIO 5GPIO 4
Raspberry Pi Pico3V3(OUT)GP2GP3GP4
  1. GND-1 to your board's GND.
  2. VCC-2 to your board's logic supply. Never 5V beside a 3.3 V board.
  3. NC-3: nothing.
  4. LATCH-4, CLOCK-5 and DATA-6 to three digital outputs.

Digit up, header at the bottom, the pins run GND-1 to DATA-6 from left to right. There is no square pad on this block; the numbers are printed on both faces.

Three things to know

A 1 lightscommon cathode; a common-anode table shows the gaps
MSBFIRSTthe table puts segment a in bit 0; LSBFIRST mirrors every digit
No chainQ7S goes nowhere; a second board takes its own LATCH

Where to start

The handbook below is nine short articles. The six pins is the one to read before wiring. Shift, then latch and One byte, one digit are how it works, VCC sets the current is what 3.3 V and 5 V each cost, and Count 0 to 9 is the sketch, for an Uno, an ESP32, an ESP32-S3 or a Pico, in Arduino and in MicroPython.

hc595_segment_led.ino
/*
  74HC595 Segment LED - count 0 to 9                  TK53 / /p/tk53

  Wiring. Count from pin 1, printed GND-1 on the TinkerBlock board
  (this board has no square pad), digit up, header at the bottom:

    GND   -> GND
    VCC   -> your board's logic supply: 5V on an Uno, 3V3 on an
             ESP32, ESP32-S3 or Pico. At 5V the chip may not read
             a 3.3 V board's HIGH, so never 5V beside a 3.3 V board.
    NC    -> nothing   (unconnected on the board)
    LATCH -> D8 on an Uno, GPIO 27 on an ESP32, GPIO 6 on an
             ESP32-S3, GP2 on a Raspberry Pi Pico
    CLOCK -> D12 on an Uno, GPIO 26 on an ESP32, GPIO 5 on an
             ESP32-S3, GP3 on a Raspberry Pi Pico
    DATA  -> D11 on an Uno, GPIO 25 on an ESP32, GPIO 4 on an
             ESP32-S3, GP4 on a Raspberry Pi Pico

  Arduino IDE
    Tools > Board            your board, e.g. Arduino Uno
    Tools > Port             the one that appears when you plug in
    Tools > USB CDC On Boot  Enabled   (ESP32-S3 only)
    No library to install: shiftOut is built in.
    Serial Monitor at 115200.
*/

// The pins LATCH, CLOCK and DATA are wired to. These are the Uno's.
// ESP32: 27, 26, 25. ESP32-S3: 6, 5, 4. Pico: 2, 3, 4.
const int LATCH_PIN = 8;
const int CLOCK_PIN = 12;
const int DATA_PIN = 11;

// One byte per digit. Bit 0 is segment a (QA) and bit 7 the
// decimal point (QH). The digit is common cathode: a 1 lights.
const byte DIGITS[10] = {
  0b00111111,  // 0
  0b00000110,  // 1
  0b01011011,  // 2
  0b01001111,  // 3
  0b01100110,  // 4
  0b01101101,  // 5
  0b01111101,  // 6
  0b00000111,  // 7
  0b01111111,  // 8
  0b01101111,  // 9
};
const byte DOT = 0b10000000;   // the decimal point, QH

// Eight bits in, then one latch: the digit changes all at once.
void show(byte pattern) {
  digitalWrite(LATCH_PIN, LOW);
  shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, pattern);
  digitalWrite(LATCH_PIN, HIGH);         // the rising edge shows it
}

void setup() {
  Serial.begin(115200);
  pinMode(LATCH_PIN, OUTPUT);
  pinMode(CLOCK_PIN, OUTPUT);
  pinMode(DATA_PIN, OUTPUT);
  show(0);                               // blank
}

void loop() {
  for (int n = 0; n < 10; n++) {
    show(DIGITS[n]);
    Serial.print(n);
    Serial.print("  0x");
    Serial.println(DIGITS[n], HEX);
    delay(1000);
  }
  show(DOT);                             // a dot between rounds
  delay(1000);
}
View on GitHub · blocks/tk53-hc595-segment-led/arduino/hc595_segment_led/hc595_segment_led.ino @ v1.13

When it doesn’t work

Common anode or common cathode?
Common cathode. Both of the digit's common legs are on GND, so a 1 in the byte lights a segment. A table written for a common-anode digit lights the gaps instead of the digit.
The digits are the wrong shapes.
If it is the same wrong shape every time, it is bit order: the book's table goes with MSBFIRST. If the segments are random, check DATA and CLOCK are not swapped.
Can I chain two of them?
Not in the usual way: the 595's serial output, Q7S, is not connected on this board. Share DATA and CLOCK between two boards and give each its own LATCH instead.
Should VCC go to 3V3 or 5V?
To your board's logic supply: 5V on an Uno, 3V3 on an ESP32, an ESP32-S3 or a Pico. At 5 V the chip needs 3.5 V to see a HIGH, which a 3.3 V board does not give.
It is dim on my ESP32.
At 3.3 V each segment gets under 9 mA, against about 17 mA at 5 V. That is expected, and it keeps the chip inside its 70 mA limit with every segment lit.

The 74HC595 digit handbook

9 articles · about 40 minutes

This page is the reference: what the part is, what it is made of, and the questions people arrive already asking. The handbook is the walk — the same part in the order somebody actually meets it.

The board

2 articles

Six pins, one of them not connected, and everything but the header hidden under a 0.8-inch digit: the 74HC595, eight resistors and a capacitor.

From a byte to a digit

3 articles

Eight bits go in on one wire, one clock edge each, and appear together when the latch rises. Each bit is one segment, and a 1 lights it.

Limits

2 articles

What VCC does to the current in each segment and in the chip, and why a second board takes one more pin rather than none.

Using it

2 articles

Five wires and a sketch that counts from 0 to 9, then what the digit is telling you when it shows the wrong thing.

Edit this page — content/modules/hc595-segment-led.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

74HC595 Segment LED

Loading discussions…

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum →