← All parts
74HC165 Shift Register (PISO)
SN74HC165
Texas Instrumentsic logic timer
The SNx4HC165 is an 8-bit parallel-load shift register that converts parallel data to serial data. It features eight parallel inputs, a serial input, and complementary serial outputs, with control for shifting or loading data.
In stock
Specifications
10- Operating Voltage
- 2 to 6 V
- Number Of Bits
- 8
- Interface
- parallel-to-serial
- Supply Current Max
- 80 µA
- Output Drive Current
- ±4 mA
- Propagation Delay Typical
- 13 ns
- Input Current Max
- 1 µA
- Clock Frequency Max
- 36 MHz
- Operating Temperature Range
- -40 to 125 °C
- Package Type
- SOIC, SSOP, PDIP, SO, TSSOP
Pinout
16| Pin | Name | Functions | Notes |
|---|---|---|---|
| 1 | SH/LD | GPIO | Shift or Load input; low for parallel load, high for shifting |
| 2 | CLK | GPIO | Clock input for shifting data |
| 3 | E | GPIO | Parallel data input E |
| 4 | F | GPIO | Parallel data input F |
| 5 | G | GPIO | Parallel data input G |
| 6 | H | GPIO | Parallel data input H |
| 7 | QH | GPIO | Complementary serial data output |
| 8 | GND | GND | Ground connection |
| 9 | Q | GPIO | Serial data output |
| 10 | SER | GPIO | Serial data input |
| 11 | A | GPIO | Parallel data input A |
| 12 | B | GPIO | Parallel data input B |
| 13 | C | GPIO | Parallel data input C |
| 14 | D | GPIO | Parallel data input D |
| 15 | CLK INH | GPIO | Clock Inhibit input; high prevents output changes |
| 16 | VCC | POWER | Positive supply voltage |
Interactive pinout
Highlight:
SN74HC165
Click a pin to copy its name · tap a tag above to spotlight a bus.
Starter code
Community starter examples — minimal, unofficial, and provided to get you wiring fast. Verify against the manufacturer datasheet before relying on them.
Arduino (C++)
arduino
// 74HC165 parallel-in / serial-out shift register — community starter example
// Reads 8 inputs with shiftIn(); chain QH -> next SER for more.
#if defined(ESP32)
#define LOAD_PIN 5 // SH/LD
#define CLK_PIN 18 // CLK
#define DATA_PIN 19 // QH (serial out)
#else
#define LOAD_PIN 8
#define CLK_PIN 7
#define DATA_PIN 9
#endif
byte readInputs() {
digitalWrite(LOAD_PIN, LOW); // load parallel inputs
digitalWrite(LOAD_PIN, HIGH);
return shiftIn(DATA_PIN, CLK_PIN, MSBFIRST);
}
void setup() {
Serial.begin(115200);
pinMode(LOAD_PIN, OUTPUT);
pinMode(CLK_PIN, OUTPUT);
pinMode(DATA_PIN, INPUT);
}
void loop() {
Serial.println(readInputs(), BIN);
delay(300);
}MicroPython
python
# 74HC165 parallel-in shift register (ESP32) — community starter example
from machine import Pin
import time
load = Pin(5, Pin.OUT) # SH/LD
clk = Pin(18, Pin.OUT)
data = Pin(19, Pin.IN) # QH
def read_inputs():
load.value(0); load.value(1) # latch the 8 inputs
v = 0
for _ in range(8):
v = (v << 1) | data.value()
clk.value(1); clk.value(0)
return v
while True:
print(bin(read_inputs()))
time.sleep(0.3)Wiring
| Pin | Arduino Uno R3 | ESP32 DevKitC (WROOM-32) | Notes |
|---|---|---|---|
| VCC | +5V | 3V3 | 2-6 V |
| GND | GND | GND | |
| SH/LD | D8 | GPIO5 | Latch: LOW loads inputs |
| CLK | D7 | GPIO18 | Shift clock |
| QH | D9 | GPIO19 | Serial data out to the board |
| CLK INH | GND | GND | Tie LOW to enable clocking |
| A..H | - | - | 8 parallel inputs (buttons/switches) |
Typical uses
- Reading many buttons/switches from 3 pins
- Expanding inputs (chain for 16, 24, ...)