Specifications
| Type | One seven-segment digit and decimal point, driven by a 74HC595 shift register: eight bits in on one wire, shown together when the latch rises |
|---|---|
| Digit | ARKLED SM420806N, 0.8 inch, red, common cathode: both commons on GND, so a 1 lights a segment |
| Chip | Nexperia 74HC595D, SOIC-16, under the digit. Q0 to Q7 drive segments a to g and the dot, in that order |
| Byte map | Bit 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 board | 5: GND, VCC, LATCH, CLOCK, DATA. NC is not connected |
| Supply | 2 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 current | 150 Ω 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 limit | 70 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 off | OE on GND (always on), MR on VCC (never cleared by a pin), Q7S not connected, so a second board cannot chain from this one |
| Header | 6-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 |
| Board | 22.4 × 41.0 mm, two 4.6 mm mounting holes 16 mm apart. The digit stands 10 mm off the board |
| In the box | 1 × 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.
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 board | VCC to | LATCH to | CLOCK to | DATA to |
|---|---|---|---|---|
| Arduino Uno | 5V | D8 | D12 | D11 |
| ESP32 | 3V3 | GPIO 27 | GPIO 26 | GPIO 25 |
| ESP32-S3 | 3V3 | GPIO 6 | GPIO 5 | GPIO 4 |
| Raspberry Pi Pico | 3V3(OUT) | GP2 | GP3 | GP4 |
- GND-1 to your board's GND.
- VCC-2 to your board's logic supply. Never 5V beside a 3.3 V board.
- NC-3: nothing.
- 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 lights | common cathode; a common-anode table shows the gaps |
| MSBFIRST | the table puts segment a in bit 0; LSBFIRST mirrors every digit |
| No chain | Q7S 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.
/*
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);
}"""
74HC595 Segment LED - count 0 to 9, MicroPython 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 -> 3V3 (never 5V: at 5V the chip may not read 3.3 V
as HIGH)
NC -> nothing (unconnected on the board)
LATCH -> GPIO 27 on an ESP32, GPIO 6 on an ESP32-S3, GP2 on a Pico
CLOCK -> GPIO 26 on an ESP32, GPIO 5 on an ESP32-S3, GP3 on a Pico
DATA -> GPIO 25 on an ESP32, GPIO 4 on an ESP32-S3, GP4 on a Pico
Thonny
Run > Configure interpreter MicroPython (ESP32) or
MicroPython (Raspberry Pi Pico)
Save it to the board as main.py to run it on every power-up.
Nothing to install: machine is built in.
"""
from machine import Pin
import time
# The GPIO numbers LATCH, CLOCK and DATA are wired to.
# ESP32: 27, 26, 25. ESP32-S3: 6, 5, 4. Pico: 2, 3, 4.
latch = Pin(6, Pin.OUT)
clock = Pin(5, Pin.OUT)
data = Pin(4, Pin.OUT)
# 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.
DIGITS = [0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F]
DOT = 0x80
def show(pattern):
"""Eight bits in, most significant first, then one latch."""
latch.value(0)
for i in range(7, -1, -1):
data.value((pattern >> i) & 1)
clock.value(1) # the rising edge shifts it in
clock.value(0)
latch.value(1) # the rising edge shows it
show(0) # blank
while True:
for n in range(10):
show(DIGITS[n])
print(n, hex(DIGITS[n]))
time.sleep(1)
show(DOT) # a dot between rounds
time.sleep(1)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.