element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
The Learning Circuit
  • Challenges & Projects
  • element14 presents
  • The Learning Circuit
  • More
  • Cancel
The Learning Circuit
Documents How to Add Outputs to an Arduino Using a Shift Register -- The Learning Circuit 77
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join The Learning Circuit to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: tariq.ahmad
  • Date Created: 13 Aug 2020 7:50 PM Date Created
  • Last Updated Last Updated: 20 May 2020 7:24 AM
  • Views 5816 views
  • Likes 9 likes
  • Comments 4 comments
Related
Recommended

How to Add Outputs to an Arduino Using a Shift Register -- The Learning Circuit 77

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

The Learning Circuit | element14 presents |  Project Videos

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

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

 



Attachments:
TLC 77_Resources.zip
  • e14presents_makerkaren
  • arduino_tutorials
  • arduino
  • the learning circuit 77: how to add outputs
  • Share
  • History
  • More
  • Cancel
  • Sign in to reply

Top Comments

  • DAB
    DAB over 4 years ago +3
    Another good episode, well explained, though I was concerned when you powered everything from the USB. Hopefully you did a calculation on the current load before doing so. As a very old electronic technician…
  • makerkaren
    makerkaren over 4 years ago in reply to DAB +1
    Guess I got lucky because I didn't check the current load first. I think in general the power rails on the Arduino should be able to handle those, but now you've got me questioning myself. I didn't even…
  • DAB
    DAB over 4 years ago in reply to makerkaren +1
    Hi Karen, If you use one of the circuit simulators, they can sometimes provide the true current load. I always used the data sheets and did the math. It is ok for simple circuits and you can roll up the…
  • beacon_dave
    beacon_dave over 4 years ago in reply to makerkaren

    You can usually query the approximate power draw on the USB port using software on the laptop.

     

    Failing that you get in-line USB multimeters which will show voltage and current draw on a USB port.

    (It would be nice to get some reviews on these.)

     

    There is usually a polyfuse on the Arduino's USB power rail which should help reduce damage if the current draw goes over the 500mA.

     

    You could also insert an ammeter in-between the Arduino and the breadboard power rail to get a rough value for the breadboard circuit. I seem to recall that the Arduino UNO draws around 35mA powered by  USB in 'normal use'.

     

    Another area perhaps to consider is the current on each GPIO pin and in total across GPIO pins as that can easily damage the microcontroller. Not so bad if you have the replaceable DIL style chip in the socket, more of an issue if you have the SMT style.

     

    Perhaps good subject material for a future episode.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 4 years ago in reply to makerkaren

    Hi Karen,

     

    If you use one of the circuit simulators, they can sometimes provide the true current load.

    I always used the data sheets and did the math. It is ok for simple circuits and you can roll up the numbers for more complex circuits by doing a small set at a time.

     

    What concerned me was you were using the USB port, which has a 500 ma limit. The Arduino probably sucked up a lot of that current and LEDs can pull a lot depending upon the resistor you use to control the brightness.

    Each IC probably has limited effect since you have a dynamic circuit where the transistors inside are switching a lot.

     

    It is just good practice to look at current management, especially when you get into more complex circuits.

    If you overload the USB, it can kill your PC, so learn to play it safe.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • makerkaren
    makerkaren over 4 years ago in reply to DAB

    Guess I got lucky because I didn't check the current load first. I think in general the power rails on the Arduino should be able to handle those, but now you've got me questioning myself. I didn't even consider needing to run them off a separate power supply since it was just chips and LEDs. Is there a way to physically test current load or does one simply need to check data sheets and do the math?

     

    Creating a programmable pulse generator sounds interesting. I was going to ask how you can control both frequency and pulse width, but I think I actually figured it out already. Haha. Thanks for commenting. Your input is always appreciated.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 4 years ago

    Another good episode, well explained, though I was concerned when you powered everything from the USB.

    Hopefully you did a calculation on the current load before doing so.

    As a very old electronic technician, we always checked current loads before plugging anything in.

     

    These serial to parallel chips are very useful.

    They use them in avionics to decode the IFF code from transponders.

    I have used the parallel to serial chips to create a programmable pulse generator with both frequency and pulse width.

     

    Lots of options when playing with serial and parallel signals.

     

    DAB

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube