IC 74HC595 with Arduino | Control LED with IC Shift Register | Tutorial

IC 74HC595 Shift Register: The basic use of the Shift Register is to increase the number of digital output pins. Although we have enough room on the Arduino board for output pins but certain times we often need more output pins for our project. In this case, we use the IC shift register to increase the number of output pins.

  • In IC there are 8 digital pins. The shift register takes 3 Arduino pins therefore the net gain is five o/p pins.
  • Pin 15 and pin 1-7 are o/p pins (Q0 - Q7)
  • Q7 outputs the first bit sent to the IC, down to Q0, which output the first.
  • Pin 8 connects to GND.
  • Pin 9 is Data Out and is used to send data to another shift register if one is present.
  • Pin 10 is always connected to 5V.
  • Pin 11 and 12 are called clock and latch.
  • Pin 13 is called output enable and is usually connect to GND.
  • Pin 14 is for incoming bit data sent from Arduino.
  • Pin 16 is used for power 5V from Arduino.
Procedure:
  1. First of all, connect the IC 74HC595 to the breadboard. 
  2. Now connect the Clock (pin 11), Latch (pin 12), and Data pin (pin 14)  to  Arduino pin numbers 2,4, and 6 respectively as you can see the white wire. 
  3. Now connect the VCC (pin 16) and MR (pin 10) to 5V (orange color wire). 
  4. Let us now connect the pin 8 and OE (pin 13) of IC to the GND(the black wire). 
  5. Now rest of the pins are available for output so you can connect any wire (yellow) from these pins for output. 
  6. For this experiment I am connecting this output pins to 3 led like this. 


Arduino Sketch :
#define DATA 6
#define LATCH 4
#define CLOCK 2
void setup() {
  // put your setup code here, to run once:
pinMode(LATCH,OUTPUT);
pinMode(CLOCK,OUTPUT);
pinMode(DATA,OUTPUT);
}

void loop(){
  // put your main code here, to run repeatedly:
int i;
for(i=0;i<256;i++)
{
digitalWrite(LATCH,LOW);
shiftOut(DATA,CLOCK,MSBFIRST,i);
digitalWrite(LATCH,HIGH);
delay(100);
}

}

For live demonstration visit: https://gplinks.co/PQ8sJoJM


Thank you!

No comments:

Post a Comment

សូមអរគុណ!

Pages

close