What is a Shift Register?
A shift register (74HC595) takes serial data (one bit at a time) and outputs it in parallel (8 pins at once). This lets you control 8 outputs using only 3 Arduino pins.
Why Use One?
The Arduino Uno/HERO only has 14 digital pins. When you need to control lots of LEDs or a multi-digit display, you quickly run out. Shift registers solve this.
Pin Connections (74HC595)
| 595 Pin | Name | Arduino Pin | |---------|------|-------------| | 14 | SER (Data) | Any digital | | 12 | RCLK (Latch) | Any digital | | 11 | SRCLK (Clock) | Any digital | | 8 | GND | GND | | 16 | VCC | 5V | | 10 | SRCLR | 5V (active low) | | 13 | OE | GND (active low) | | Q0-Q7 | Outputs | LEDs etc. |
How It Works
- Pull LATCH low
- Shift 8 bits in one at a time (MSB first)
- Pull LATCH high → all 8 outputs update simultaneously
Arduino's shiftOut() function handles the bit-shifting:
shiftOut(dataPin, clockPin, MSBFIRST, byte);
Chaining
You can daisy-chain multiple 595s by connecting Q7' (pin 9) to SER of the next chip. This gives you 16, 24, 32+ outputs using the same 3 pins!