Using an 74HC595 Shift Register from STMicroelectronics 4

This tutorial is a quick tutorial on how to use a 74HC595 shift register from STMicroelectronics. You can find the datasheet here.

After this tutorial, you will be able to use any 74HC595 shift register, and you will have a functional 4 bits (you can extend up to 8) counter counting from 0 to 15.

This module will be used to perform a 3-wire LCD display setup in the future.

Components

  • Arduino Uno (BoxTec) – ~23.57 €
  • 74HC595 Shift Register (Tayda) – 0.20 $
  • 1 µF Capacitor (Tayda) – 0.02 $
  • 220 Ω Resistors for your LEDs (assuming they have 20 mA consumption and 2.1 forward voltage) (Tayda) – 0.01 $
  • Breadboard
  • M/M jumper cables

Setup

All Code and schematics can be found on our GitHub page.

Connecting the Shift Register

For convenience, here is the layout of the 74HC595 module.

dataSheet

Shift Register Attached To
8 (GND) Ground of your Uno
10 (SCLR) Vcc
11 (SCK) Pin 13
12 (RCK) Pin 10
13 (G) Ground
14 (SI) Pin 7
16 (Vcc) Vcc (via 1 uF decoupling capacitor)
15 (QA) LED 1 (220 Ohm between positive pin of LED and output of register)
1 (QB) LED 2 (220 Ohm between positive pin of LED and output of register)
2 (QC) LED 3 (220 Ohm between positive pin of LED and output of register)
3 (QD) LED 4 (220 Ohm between positive pin of LED and output of register)

Wiring

See the pictures below for how the wiring should be performed.

shiftRegister LEDs ArduinoUno wholeSetup

Code

/*
Standalone Module for proof of concept of 74HC595 Shift Register

Blog: http://arduinodev.woofex.net/2013/01/26/74hc595_shiftregister/
Code: https://github.com/Trefex/arduino-shiftregister/

For Pin connections, please check the Blog or the github project page
Authors: Christophe Trefois (Trefex)
Changelog:
2013-01-26: Initial Import of code

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter
to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
*/

int latchPin = 10;
int clockPin = 13;
int dataPin = 7;

void setup() {
// Set output pins of the UNO
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
}

void loop() {
for (int i=0; i<16; i++) { digitalWrite(latchPin, LOW); delay(400); shiftOut(dataPin, clockPin, MSBFIRST, i); digitalWrite(latchPin, HIGH); delay(100); } } [/code]

4 thoughts on “Using an 74HC595 Shift Register from STMicroelectronics

  1. Pingback: Multiplexing with Arduino with 74HC595 Shift Register | sk1585

  2. Reply rsc Jan 19,2017 17:41

    “See the pictures below for how the wiring should be performed.” you’re delusional if you think anyone is going to go cross-eyed trying to decipher your pictures. Please post circuit diagrams or at least use Fritzing to generate breadboard diagrams.

    • Reply Trefex Jan 19,2017 22:54

      Thanks for your feedback. You can just use the table instead. Also, if you don’t like the tutorial, don’t use it, but no need to be rude.

  3. Reply Bearkh Feb 14,2017 09:16

    Yeah you shez head, no need to be rude you piece of hss

Leave a Reply