December 5, 2026

74HC595 Shift Register Explained: 16 Outputs From 3 Pins, and Why the Latch Matters

Two chips on a breadboard driving a row of LEDs from a microcontroller

Three microcontroller pins can drive sixteen LEDs, or twenty-four, or as many as anyone cares to chain. The part that makes it possible is the 74HC595, a chip whose Texas Instruments datasheet was first issued in December 1982, and it is still the first answer most hobbyists hear when an Arduino runs out of pins. The interesting part of the chip is not the shifting. It is a second set of eight flip-flops, the storage register, that most tutorials mention in passing. A small simulation for this post shows why: without it, sixteen outputs flicker through eleven wrong patterns every time they are updated.

Video: DroneBot Workshop on YouTube

Two registers in one package

What the datasheet says it is

The SN74HC595 datasheet (TI document SCLS041J) describes the device as containing “an 8-bit, serial-in, parallel-out shift register that feeds an 8-bit D-type storage register.” Those are two separate stages. The shift register accepts data one bit at a time. The storage register holds what the outputs actually show.

The pins that matter

Pin Job
SER Serial data input
SRCLK Shift register clock; shifts on the rising edge
RCLK Storage register clock; copies the shift register to the outputs on the rising edge
OE Output enable, active low; high puts QA to QH in high impedance
SRCLR Clears the shift register, active low
QA to QH The eight parallel outputs
QH’ Serial output, for chaining to the next chip

A typical microcontroller hookup uses three pins: SER for data, SRCLK as the clock and RCLK as the latch. OE is tied low so the outputs are always on, and SRCLR is tied high so the register is never cleared by accident.

A pile of colorful glass marbles reflecting light

Shifting a byte in

One bit per clock

On each rising edge of SRCLK, every bit in the shift register moves one place along, and the value on SER enters at the first position. After eight clocks, the eight bits sent are sitting in the shift register in order. The bit that was in the last position falls out of QH’.

The Arduino way

Arduino’s shiftOut() reference describes exactly that sequence: the function “Shifts out a byte of data one bit at a time,” writing each bit to the data pin, “after which a clock pin is pulsed (taken high, then low).” Its signature is shiftOut(dataPin, clockPin, bitOrder, value), where bitOrder picks whether the most or least significant bit goes first.

The reference adds a warning that matters for the 595, whose clocks trigger on rising edges: “you’ll need to make sure that the clock pin is low before the call to shiftOut().” If the clock pin happens to be high at the start, the first transition is a falling edge, and a bit can end up in the wrong place.

Then latch

After the bits are in, a rising edge on RCLK copies all eight into the storage register in one step, and the outputs change together. In Arduino code that means pulling the latch pin low, calling shiftOut(), and pulling the latch pin high.

What the latch prevents

A simulation of two chips

To see why the second register exists, a short Python model simulated two 595s chained into sixteen outputs. All outputs started off. The model then shifted in a new pattern, 1010101011110000, one bit per clock, and recorded what the sixteen outputs displayed after every clock, in two versions: one where the outputs follow the shift register directly, and one where they only update on the latch.

The results

Version Distinct output states shown Wrong intermediate patterns Final pattern correct
Outputs follow the shift register 13 11 Yes
Outputs update on the latch 2 0 Yes

Without the latch, the outputs walked through eleven patterns that were neither the old display nor the new one, as the bits marched across. With the latch, the display jumped from old to new in one step.

Does a fast update hide it?

At the 25 MHz maximum clock frequency the datasheet lists for the SN74HC595 at 4.5 V, sixteen bits take 0.64 microseconds, far too fast for an eye to see. But a software shiftOut() is much slower than the chip’s limit, and the reference itself points to the SPI library as “a hardware implementation that is faster.” On a slow bit-banged update, or on outputs driving relays, motor drivers or anything else that reacts in microseconds, the wrong patterns would be real events, not just flicker. The storage register removes the question entirely.

Bundle of colorful wires on a white background

Chaining chips

QH’ to SER

To add eight more outputs, wire the first chip’s QH’ to the second chip’s SER, and tie both chips’ SRCLK pins together and both RCLK pins together. Each clock now moves every bit along the combined sixteen-bit chain, with bits spilling from the first chip into the second. Send sixteen bits, pulse the latch once, and both chips update at the same instant.

The same pattern extends to any number of chips. Three pins still control everything; only the number of bits sent per update grows. The first bit sent ends up farthest down the chain, on the last chip’s QH, which is the most common source of “my outputs are reversed” confusion when wiring a chain for the first time.

Speed per chip

Each added chip costs eight more clocks per update. At the datasheet’s 25 MHz limit that is 0.32 microseconds per chip. With a 4 MHz SPI clock, a common setting on small microcontrollers, a sixteen-output chain updates in 4 microseconds. In practice the code that decides what to display usually takes far longer than the shifting. Longer chains do add one physical concern: every chip’s SRCLK and RCLK inputs hang on the same two wires, and on a long ribbon or a large board those shared clock lines are worth keeping short and clean, since a single glitch on SRCLK shifts every bit in every chip by one place.

How much current it can drive

Per pin and per package

The datasheet rates the QA to QH outputs at ±6 mA at a 4.5 V supply, with the output guaranteed to stay at or above 3.84 V while sourcing 6 mA and at or below 0.33 V while sinking it. Separately, it lists the maximum continuous current through the VCC or GND pin as ±70 mA. That second number is the one that catches LED projects.

LEDs on at once Current per LED Total Against the 70 mA limit
8 6 mA 48 mA Within
8 8 mA 64 mA Within
8 10 mA 80 mA Over

Choosing resistors

As an example, a red LED that drops about 2 V on a 5 V supply needs roughly 500 ohms to run at 6 mA, ignoring the small drop inside the chip’s output. A 470 or 560 ohm resistor, the nearest common values, lands close. Running all eight LEDs at 20 mA each would draw 160 mA through one GND pin, more than double the package limit, which is how 595s end up warm and then dead.

Loads that need more current, such as relays, motors or LED strips, should go through a transistor or a driver chip on each output, with the 595 only providing the logic signal.

For breadboard projects:

As an Amazon Associate I earn from qualifying purchases. A commission may be earned if you buy through this link, at no extra cost to you.

Electronic circuit board with various components

The other two control pins

Output enable for dimming and blanking

OE is active low: when it is high, the datasheet says QA to QH go into a high-impedance state, effectively disconnecting them. Tying OE to a PWM-capable pin instead of ground turns it into a brightness control for every LED on the chip at once, and holding it high at power-up keeps outputs dark until the first valid pattern has been latched. Without that, a 595 can power up showing whatever random state its flip-flops started in.

Clear

SRCLR, also active low, empties the shift register. It does not touch the storage register, so the outputs keep showing the old pattern until the next latch. Most designs tie it high and clear the chip by shifting in zeros, which needs no extra pin.

Three pins, a latch pulse and a current budget cover nearly every use of the chip. The fourth wire worth adding is the one most people skip: OE, so the outputs stay dark until the program says otherwise.

Sources

  • Texas Instruments, SN74HC595 datasheet, SCLS041J (revised October 2021): https://www.ti.com/lit/ds/symlink/sn74hc595.pdf
  • Arduino Documentation, “shiftOut()”: https://docs.arduino.cc/language-reference/en/functions/advanced-io/shiftOut/

920 Posts

Peter Kalafatis writes and edits X9M8. He holds a bachelor's degree from LIU Post and a master's in Media Studies from The New School, with academic work in the philosophy of science, human behavior, AI, and memetics.

View All Posts

Leave a Reply

Your email address will not be published. Required fields are marked *