Simple Shift Register Circuit
Fun projects from beginner to advanced

Simple Shift Register Circuit

Simple Shift Register Circuit

Don't know what a shift register is or how it works? Here's a fun little project to help you learn how the 74HC595 Shift Register functions.

This project explains how you can control 16 LEDs using a 74HC595 shift register. The advantage of doing this is it uses less pins on your arduino board, which means more pins for inputs/outputs! Shift registers are used in many applications and it is great to know how to use them.
This project needs:
* Breadboard x 1
* Assorted jumper cables
* 74HC595 Shift register x 2
* Tactile switch x 5
* Resistor 620 ohm x 21
* Resistor 1K ohm x 1
* Red LED x 17
* Yellow, Blue, Green, Orange LED x 1 each

Connecting it up
Interative window: move around and zoom in and out with your mouse

Electrical Diagram

Simple Shift Register Electrical Diagram

Technical stuff
The 74HC595 is an 8-bit shift register, meaning it can shift/store/output 8 bits (1 byte) of information.
The 74HC595 shift register works like a switch block. You can tell it which of the 8 bits to be a 1 or 0 (on or off). The shift register can be controlled by any 3 digital pins on the Arduino board. You will have to use 5 digital pins if you want to use the "Clear" and "Output Enable" functions.

74HC595 Pinout

The 74HC595 is broken up into 3 parts:
* Shift register - this is where the bits get shifted in and out
* Storage register - this is where you can store 8 bits of information
* 3-state outputs - these are the output pins (Q0-Q7)

The 74HC595 has 16 pins in total, the pinout diagram above shows where each pin is. The functions of the pins are:
* Vcc (pin 16)= Power supply (5 volts)
* GND (pin 8)= Ground (0 volts)
* Q0,Q1,Q2,Q3,Q4,Q5,Q6,Q7 (pins 15,1,2,3,4,5,6,7)= Outputs,
* DS (pin 14)= Data in, this value is put into the shift register with the "Clock"
* Q7S (pin 9)= Data out, this is the least significant bit (LSB) of the shift register. Connect this to the "Data in" pin of another 74HC595 to create a 16 bit shift register
* SHCP (pin 11)= Shift register Clock pin ("Clock"), moves the data bit into the shift register on the rising edge (ie. when clock is changed from 0 to 1)
* STCP (pin 12)= Storage register Clock pin ("Latch"), lets the information move from the shift register to the storage register
* MR (pin 10)= Master Reset ("Clear"), This clears all the information in the shift register. This pin needs to be "High" (5v) if you don't want the shift register to clear.
* OE (pin 13)= Output Enable ("Blank"), This enables/disables the output pins. Ground this pin to enable the output pins.

Lets now look at how the 74HC595 works:
The shift register has a clock, every time the "Clock" changes from a "0" to a "1" (LOW to HIGH) the "Data in" bit is shifted into the most significant bit "MSB" of the register. This means if you have an 8 bit number to shift into the register you have to start shifting in the LSB first, if you want the number to be the same once the shifting has finished.


Once you have shifted your "bits" into the shift register you can then copy all 8-bits down into the storage register. To do this you simply change the "Latch" pin (STCP) from a "0" to "1" (LOW to HIGH).
These bits are now stored in the storage register until you copy another 8-bits from the shift register.
To clear the storage register you can do this 2 different ways:
1. Shift 8 zeros into the shift register then copy them into the storage register
2. Change the "Clear" pin (MR) to a "0". This makes all bits in the shift register zero. Then use the latch pin to copy the zero's into the storage register. Don't forget to switch the Clear pin back to HIGH so you can continue to use the shift register.

Once you have information in the storage register the output pins (Q0-Q7) will be displaying the 8-bit value. Keep in mind the Output Enable pin (OE) must be "0" for the output pins to work. If you dont want the output pins to work, simply change the OE pin to a "1".

Below is an animation of the 74HC595 shift register and how the bits are shifted, latched, cleared, and output.

74HC595 Animated

Project complete!
Now you can use the 74HC595 shift register for different projects!



* Shift Out Tutorial:


© Copyright intRobotics. All Rights Reserved.