Skip to content

Using daisy chained 74hc595 chips with an Arduino

Notifications You must be signed in to change notification settings

The-Black-Pig/74hc595

Repository files navigation

74hc595

These demos are aimed primarily as a jumping off point for absolute beginners.

Using daisy chained 74hc595 chips with the Arduino.

What should be taken into consideration is the way data is moved between chip 1 and chip 2..... etc. Firstly you can send a data byte in two directions Least Significant Bit (LSB) first or the Most Sgnificant Bit (MSB) first. Taking the Latch pin LOW, then allows data to be pushed to the first chip. The first byte is written to chip 1 and the next byte is also written to chip 1 but pushes the first byte to the next chip and so on until all the chips have been filled. Only then, taking the Latch Pin HIGH will stop data more being accepted by the chip and the output pins are then activated.

WARNING: the 74hc595 cannot cope with more than about 20mA on each output pin and no more than 80mA total. Therefore if connecting LEDs directly to chip output pins use higher value resistors than normal. I use green LEDs with 2K to 3K resistors but any resister 10 times higher than you would normally use, should provide sufficient current reduction.

SETUP

74hc595 pin connections

  • Pin 1 - 2KΩ - LED 2
  • Pin 2 - 2KΩ - LED 3
  • Pin 3 - 2KΩ - LED 4
  • Pin 4 - 2KΩ - LED 5
  • Pin 5 - 2KΩ - LED 6
  • Pin 6 - 2KΩ - LED 7
  • Pin 7 - 2KΩ - LED 8
  • Pin 8 - Gnd
  • Pin 9 - Pin 14 on chip 2
  • Pin 10 - 10kΩ resister to Vcc rail
  • Pin 11 - D12 and Pin 11 on chip 2
  • Pin 12 - D8 and Pin 12 on chip 2
  • Pin 13 - 10kΩ resister to Gnd rail
  • Pin 14 - D11
  • Pin 15 - 2KΩ - LED 1
  • Pin 16 - Vcc (3 - 6V)

The wiring of the second chip is similar to the above wiring, only pin 9 is left unconnected unless you want to daisy chain another 74hc595.

As a matter of habit, I always use 10kΩ resisters on pull-up or pull-down pins, in case I want to feed a pulse to these pins in future projects.

Example Sketches

74hc595_binary_counter.ino
The first example counts from 0 to 65536 in binary, and takes exactly 10 minutes to complete.

74hc595_random_display.ino
The second example creates random on/off states on 16 channels.

74hc595_knight_rider.ino
74hc595_knight_rider_2.ino
And third and fourth examples are versions of the obligatory "Knight Rider" demo. A must, if you have row of LEDS set up. The two versions of the "Knight Rider" demo use slightly different coding techniques. The first one uses an array and the second uses bit shifting.

74hc595_bounce_effect.ino
A simple bit shift sketch where the LEDs appear to bounce in the middle.

74hc595_serial_input.ino
Input an integer between 0 and 65335 and show the binary equivalent with the LEDs.

Any code improvement suggestions are very welcome!

About

Using daisy chained 74hc595 chips with an Arduino

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages