Arduino Basics: Intro to The 74HC595 Shift Register

74hc595 arduino - 74HC595 Shift Register also called as 595 chip. With Shift Register, we can use one Arduino pin to blink Multiple LED.

74HC595 shift register has 16 pins. It holds data in locations what can be thought of as eight memory locations, each of which can be a 1 or a 0.

Digital data can be stored in the form of bits. We say a bit to refer to one of the number which build up the binary value.

If a binary value is 10101010, then the first bit is 0, and the 8th bit is 1. So each bit can be either 0 or 1.

One 74HC595 shift register will provide us eight pins to use where it is using three pins of Arduino. If we use two 74HC595 shift registers, then also they will occupy 3 pins of Arduino and give us 8+8 = 16 pins.
74hc595 chip arduino shift register basic

We are using shift register to expand the number of pins of Arduino. This is what is known as bit-shifting. We can easily daisychain as many shift registers as we like!

The 595 essentially controls 8 separate output pins, using only 3 input pins. And if we need more than 8 additional I/O lines, we can easily daisychain as many shift registers as we like and create tons of I/O lines. All of this is accomplished by what is known as bit-shifting.

How 74HC595 Shift Register works?

The 74HC595 has 2 registers (which can be thought of as “memory containers”), each with just 8 bits of data. The first one is called the Shift Register. The Shift Register lies deep within the IC circuits, quietly accepting input.

Whenever we apply a clock pulse to a 74HC595, two things happen:
  1. The bits in the Shift Register move one step to the left. For example, Bit 7 accepts the value that was previously in bit 6, bit 6 gets the value of bit 5 etc.
  2. Bit 0 in the Shift Register accepts the current value on DATA pin. At the rising edge of the pulse, if the data pin is high, then a 1 gets pushed into the shift register. Otherwise, it's a 0.
On enabling the Latch pin, the contents of Shift Register are copied into the 2nd register, called the Storage/Latch Register.

Each bit of the Storage Register is connected to one of the output pins QA–QH of the IC, so in general, when the value in the Storage Register changes, so do the outputs.

74HC595 Shift Register Wiring

Place the shift register on to the breadboard, ensuring each side of the IC is on a separate side of the breadboard. With the little U-shaped notch facing upwards, the pins are 1-8 down the left hand side from top to bottom and 16 – 9 down the right hand side from top to bottom.
  • Connect pins 16 (VCC) and 10 (SRCLR) to the 5v pin on the Arduino and connect pins 8 (GND) and 13 (OE) to the Gnd pin on the Arduino. This should keep the IC into the normal working mode.
  • Next we need to connect the 3 pins that we will control the shift register with:
    • Pin 11 (SRCLK) of the shift register to pin 6 on the Arduino
    • Pin 12 (RCLK) of the shift register to pin 5 on the Arduino
    • Pin 14 (SER) of the shift register to pin 4 on the Arduino
  • Now, we just have to connect up all of the output pins to our LEDs, ensuring that a 220Ω resistor is placed before the LEDs as to reduce the current and that the cathodes of the LEDs go back to ground.
  • When placing the LEDs be sure that they are connected in order, so that QA is wired to the first LED, and QH is wired to the last LED, as otherwise our code is not going to light up the LEDs in the correct order!

Arduino Basics: Intro to The 74HC595 Shift Register

In this video we take a look at the 74hc595 shift register. With this IC we can output serial data using only 3 outputs on the Arduino and the 595 will convert that into 8bit parallel data that can be used to drive LEDs among other things.


You can download arduino 74HC595 datasheet here.

Comments