SIPO and PISO shift registers with Arduino and ESP (ESP8266 / ESP32)

When working with Arduino, ESP8266 or ESP32, you quickly hit a simple limit: not enough GPIO pins.
Instead of stacking boards or using complex expanders, there is a very clean and proven solution: shift registers.

The two main types are:

  • SIPOSerial In, Parallel Out
  • PISOParallel In, Serial Out

Why use shift registers?

  • Save GPIO pins
  • Clean wiring
  • Easy to scale
  • Very cheap
  • Used everywhere in real hardware (industry, vending, panels)

With only 3 pins, you can manage 8, 16, 32+ inputs or outputs.


SIPO – Serial In, Parallel Out

What it does

You send data bit by bit (serial), and the chip exposes them all at once on parallel outputs.

Common chip

74HC595

  • 8 digital outputs
  • Can be daisy-chained
  • Very reliable
  • Fast enough for almost any project

Important pins

PinRole
DSSerial data
SH_CPClock
ST_CPLatch
Q0–Q7Outputs
OEOutput enable (optional)
MRReset (optional)

Arduino example – driving 8 LEDs

int dataPin = 11;
int clockPin = 13;
int latchPin = 10;

void setup() {
  pinMode(dataPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(latchPin, OUTPUT);
}

void loop() {
  digitalWrite(latchPin, LOW);
  shiftOut(dataPin, clockPin, MSBFIRST, B10101010);
  digitalWrite(latchPin, HIGH);
  delay(500);
}

Typical SIPO use cases

  • LEDs
  • Relays
  • MOSFET boards
  • 7-segment displays
  • Control panels
  • Power boards

PISO – Parallel In, Serial Out

What it does

Reads many inputs at once, then sends their state serially to the microcontroller.

Common chip

74HC165

  • 8 digital inputs
  • Can be chained
  • Very simple timing

Important pins

PinRole
PLParallel load
CPClock
Q7Serial output
D0–D7Inputs

Arduino example – reading 8 buttons

int loadPin = 8;
int clockPin = 12;
int dataPin = 11;

void setup() {
  pinMode(loadPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, INPUT);
}

byte readInputs() {
  digitalWrite(loadPin, LOW);
  delayMicroseconds(5);
  digitalWrite(loadPin, HIGH);
  return shiftIn(dataPin, clockPin, MSBFIRST);
}

void loop() {
  byte buttons = readInputs();
}

SIPO vs PISO

FeatureSIPO (74HC595)PISO (74HC165)
DirectionOutputInput
GPIO needed33
ChainableYesYes
SpeedHighHigh
Typical useLEDs, relaysButtons, switches

Arduino vs ESP considerations

Arduino (5V)

  • Works perfectly with HC / HCT chips
  • Very forgiving

ESP8266 / ESP32 (3.3V)

  • Prefer 74HCT or power the chip at 3.3V
  • Avoid floating OE / MR pins
  • Logic levels matter more

In practice, 74HC often works, but it’s not guaranteed in all cases.


Daisy-chaining

You can chain registers easily:

  • Q7’ → DS for SIPO
  • Q7 → DS for PISO
  • Same clock and latch

Examples:

  • 4 × 74HC595 → 32 outputs
  • 2 × 74HC165 → 16 inputs

Alternatives

ChipTypeWhy use it
MCP23017I²C GPIOInterrupts
PCF8574I²C GPIOVery simple
TLC5940PWM LEDBrightness control
ULN2003DriverCurrent handling

Still, SIPO / PISO are hard to beat for simplicity and reliability.


When SIPO / PISO are the right choice

Good choice if you want:

  • Simple hardware
  • Deterministic timing
  • No complex bus
  • Easy scaling

Not ideal if you need:

  • Analog inputs
  • Per-pin interrupts
  • Complex feedback

Conclusion

SIPO and PISO shift registers are basic but extremely powerful tools.
They are cheap, fast, reliable, and perfectly suited for Arduino and ESP projects.

If you are building:

  • a custom board
  • a control panel
  • a vending machine
  • home automation hardware

This should be one of your first tools.

Leave a Reply

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