INTERFACE 74HC595 SHIFT REGISTER WITH ARDUINO

INTRODUCTION:

  • 74HC595 is a shift register that works on Serial IN Parallel OUT protocol.
  • It receives data serially from the microcontroller and then sends out this data through parallel pins.
  • We can increase our output pins by 8 using the single chip.
  • We can also connect more than 1 shift register in parallel.
  • So, let’s say I have connected three shift registers with our microcontroller then our output pins are increased by 8 x 3 = 24.
  • I hope I have cleared the idea, so now let’s have a look at its pinout.

It has a wide range of applications, especially in LED Boards. You must have seen the large LED boards where we have to control a lot of LEDs with a single microcontroller, 74HC595 is used in such projects a lot.

COMPONENTS REQUIRED:

  • SHIFT REGISTER, 74HC595.
  • ARDUINO UNO
  • POWER SUPPLY
  • JUMPER WIRES

CIRCUIT DIAGRAM:

WORKING:

Whenever we apply a clock pulse to a 595, two things happen:

  • 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.
  • Bit 0 in the Shift Register accepts the current value on the 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 is a 0.

CONNECTIONS:

Make the following connections:

  • OE to ground
  • MR to 5V
  • DS to Ardunio DigitalPin 11 (DATA PIN)
  • SH_CP to Ardunio DigitalPin 12 (CLOCK PIN)
  • ST_CP to Ardunio DigitalPin 8 (LATCH PIN)

SOURCE CODE:

int latchPin = 8;
int clkPin = 12;
int dataPin = 11;

byte LED = 0;

void setup() 
{
  Serial.begin(9600);
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);  
  pinMode(clkPin, OUTPUT);
}

void loop() 
{
  shiftLED();
  delay(500);
  for (int i = 0; i < 8; i++)
  {
    bitSet(LED, i);
    Serial.println(LED);
    shiftLED();
    delay(500);
  }
  LED=0;
  shiftLED();
}

void shiftLED()
{
   digitalWrite(latchPin, LOW);
   shiftOut(dataPin, clkPin, MSBFIRST, LED);
   digitalWrite(latchPin, HIGH);
}

DEMONSTRATION VIDEO:

DRIVE FOLDER :

https://drive.google.com/drive/folders/1ZngPo4loQ1dFz-kepgjGq-YgNs-o6Wdx?usp=sharing

REFERENCES:

2 thoughts on “INTERFACE 74HC595 SHIFT REGISTER WITH ARDUINO”

  1. I’m really loving the theme/design of your website. Do you ever run into any internet browser compatibility issues? A small number of my blog audience have complained about my website not working correctly in Explorer but looks great in Firefox. Do you have any advice to help fix this issue?

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.