O'Reilly logo

Raspberry Pi LED Blueprints by Agus Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introducing a shift register

If our project needs to control 32 LEDs, we would normally require 32 pins of a microcontroller (MCU). The problem is that every MCU has a limited number of pins for GPIO. To address this issue, we can extend our MCU GPIO pins.

One of the solutions to extend GPIO pins is to use a shift register. We can use 74HC595 to extend the GPIO output pins. If you want to extend the GPIO input pins, you can use 74HC165. The schema of 74HC595 can be seen in the following figure:

Introducing a shift register

The Q0 to Q7 pins are the parallel output from the chip. The DS pin is the serial data. STCP is the latch pin, and SHCP is the clock pin.

In this section, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required