Version 4
    element14 presents
    How to Add Outputs to an Arduino Using a Shift Register

    The Learning Circuit | element14 presents |  Project Videos



    Serial In Parallel out (SIPO) shift registers can take data in a single input and transfer it to multiple outputs. This type of shift register can be used to expand the outputs of an Arduino. Watch as Karen shows how to create a circuit that uses only 3 I/O pins of an Arduino to create 8, 16, or more outputs.


    int clearPin = 5; //Arduino pin 5 connected to Pin 10, SRCLR(Clear/Reset) of 74HC595
    int serialData = 6;  //Arduino pin 6 connected to Pin 14, SER(serial input) of 74HC595
    int shiftClock = 7;  //Arduino pin 7 connected to Pin 11, SRCLK(shift clock) of 74HC595
    int latchClock = 8;  //Arduino pin 8 connected to Pin 12, RCLK(storage/latch clock) of 74HC595 ]
    void setup() {   //runs once at startup
       //set pins to output so you can control the shift register
      pinMode(clearPin, OUTPUT);
      pinMode(shiftClock, OUTPUT);
      pinMode(latchClock, OUTPUT);
      pinMode(serialData, OUTPUT);
      digitalWrite(clearPin, LOW); //Pin is active-low, this clears the shift register
      digitalWrite(clearPin, HIGH); //Clear pin is inactive
    void loop() {    //runs and loops continuously
        for (int shiftCount = 0; shiftCount < 256;shiftCount++) {  
              // count from 0 to 255 and display the number on the LEDs
       digitalWrite(latchClock, LOW);    
              // take the latchClock low so 
              // the LEDs don't change while you're sending in bits:
       shiftOut(serialData, shiftClock, MSBFIRST, shiftCount);      // shift out the bits
       digitalWrite(latchClock, HIGH);     //take the latch pin high so the LEDs will light up
       delay(500);     // pause before next value


    Bill of Material:


    Product NameManufacturerQuantityBuy KitBuy Kit
    Arduino Uno, ATmega328P MCU, 14 3.3V I/O, 6 Analogue Inputs, 6 PWM OutputsArduino1Buy NowBuy Now
    Breadboard, MCM 60 rows, ABS, 8.5mm, 165mm x 56mmMulticomp1Buy NowBuy Now
    SN74HC595N -Shift Register, HC Family, 74HC595, Serial to Parallel, 1 Element, 8 bit, DIP, 16 PinsTEXAS INSTRUMENTS2Buy NowBuy Now
    Through Hole Resistor, 470 ohm, 500 mW, ± 5%VISHAY16Buy NowBuy Now
    Through Hole Resistor, 10 kohm, 250 mW, ± 1%TE Connectivity2Buy NowBuy Now
    Red LED, Through Hole, 5mm, 20 mA, 2.1 VLED TECHNOLOGY8Buy NowBuy Now
    LED, Green, Through Hole, T-1 3/4 (5mm), 20 mA, 2.1 V, 570 nmMulticomp Pro8Buy NowBuy Now
    140 Pc. Jumper Wire Kit, 22 AWG, Solid, Assorted Lengths and ColorsTwin Industries1Buy NowBuy Now
    Wire Kit, Jumper, Male to Male, Solderless, 100 mm - 250 mm, 75 PieceMCM2Buy NowBuy Now
    USB Cable, USB Type A Plug, USB Type B Plug, 915 mm, 36.1 ", USB 2.0, BlackMULTICOMP1Buy NowBuy Now


    Additional Parts:


    Product Name

    Computer with Arduino IDE