Shift Register 8-Bit - 74HC595

Simple shift register IC. Clock in data and latch it to free up IO pins on your micro.

Check out this [tutorial](http://cdn.sparkfun.com/datasheets/Components/General IC/arduino_segment_led.zip) on how to use this product with the 7 Segment LED and Arduino. Thanks Patrick and Mycha!

Shift Register 8-Bit - 74HC595 Product Help and Resources

Shift Registers

August 23, 2013

An introduction to shift registers and potential uses.

Core Skill: Soldering

This skill defines how difficult the soldering is on a particular product. It might be a couple simple solder joints, or require special reflow tools.

2 Soldering

Skill Level: Rookie - The number of pins increases, and you will have to determine polarity of components and some of the components might be a bit trickier or close together. You might need solder wick or flux.
See all skill levels


Core Skill: Programming

If a board needs code or communicates somehow, you're going to need to know how to program or interface with it. The programming skill is all about communication and code.

2 Programming

Skill Level: Rookie - You will need a better fundamental understand of what code is, and how it works. You will be using beginner-level software and development tools like Arduino. You will be dealing directly with code, but numerous examples and libraries are available. Sensors or shields will communicate with serial or TTL.
See all skill levels


Core Skill: Electrical Prototyping

If it requires power, you need to know how much, what all the pins do, and how to hook it up. You may need to reference datasheets, schematics, and know the ins and outs of electronics.

3 Electrical Prototyping

Skill Level: Competent - You will be required to reference a datasheet or schematic to know how to use a component. Your knowledge of a datasheet will only require basic features like power requirements, pinouts, or communications type. Also, you may need a power supply that?s greater than 12V or more than 1A worth of current.
See all skill levels


Comments

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • DrLuke / about 14 years ago / 16

    Hey guys, I wrote an article for www.bildr.org that explains the shift register with some wicked analogies! It comes with Arduino and AVR example code, too!
    http://bildr.org/2011/02/74hc595/

    • Thanks dude, that article really helped me understand these things. Maybe SFE should do an 'According to Pete' on these things??

    • Member #519339 / about 10 years ago / 2

      I wrote on my website how to handle up to 48 leds using two 74hc595. http://alvarorevuelta.net/midispositivomidi-the-code/ Hope it helps :)

    • icyfyer / about 13 years ago / 2

      Thank you for the tutorial. Some advice: it really needs proofreading.

    • Nikarus / about 13 years ago / 2

      wow ty for the explination dude, now i think i can make an LED project I'm working on run on an uno instead of having to get a mega for it. Good thing these are only a $1.50. One thing I wonder though, if you had say 8 of these daisy chained (thats what 64 outputs) would that start getting towards the edge of an uno's power output just running the cheap leds (not the really bright ones)?

      • Member #302799 / about 12 years ago * / 1

        30ma (0.03A) max per chanel 64 chanels = 1.92A. The arduino can suply ~0.5A through USB, if you add an external power source you should be good. Caution the internal V reg on the arduino is only rated at 1.5A so you will need either an external reg, or just hook up a battery straight to the things.

        • joshjingles / about 10 years ago / 1

          If I'm using the 595 to control an 8ch 5V relay does it need more power than the one arduino pin can supply (if powered not by USB but a PS)?

      • icyfyer / about 13 years ago / 1

        The Arduino is only responsible for sending the data to the first SR, and clock to all of them. It doesn't source the current to power all the shift registers; that's why they have VSS pins. So you should be fine.

    • mbrown9412 / about 14 years ago * / 2

      Wow, That's amazingly helpful! Thanks!

    • RichardBronosky / about 10 years ago * / 1

      The link no longer works. :-( Please fix.

      Update: The search seems to find it, but the permalink on the article, which is the same as what you gave, returns a MYSQL error. Very odd.

      http://bildr.org/?s=74hc595

    • Member #523438 / about 11 years ago / 1

      Thank you, that helped me a lot.. it's exactly what I was looking for, thanks for sharing.

    • Applekid / about 13 years ago / 1

      I never really looked into shift registers because I didn't know about RCLK... I always figured there would be some set up "side effects".
      Thanks for lighting the candle, now I think I love shift registers. lol

  • NXTreme / about 15 years ago / 3

    There is a great tutorial over at arduino.cc that explains how to use these shift registers. Find it here http://www.arduino.cc/en/Tutorial/ShiftOut

  • Donny Viszneki / about 16 years ago / 3

    The name string for this product ("Shift Register 8-Bit - 74HC595") should probably say "SIPO" or "serial-in parallel-out."

    • RaymondBotha / about 15 years ago / 4

      This product is actually compatible in the following ways:
      i)PISO
      ii)SIPO
      iii)SISO
      iv)PIPO

      • sethborders / about 14 years ago / 2

        I dont think this can do PIPO or PISO there seems to only be serial data in

      • ulidtko / about 11 years ago / 1

        Mind to demonstrate how is this possible? The datasheet says right at the title "8-Bit Serial-In, Parallel-Out Shift".

  • Keegan / about 13 years ago / 2

    I want to make sure I understand the datasheet correctly:
    Each pin can output up to 35mA, but all together the chip can output up to 70mA?

    • SomeGuy123 / about 13 years ago / 3

      That is correct. If you have two pins on, each one would be able to supply their full amount of 35mA. If you have all the pins on, each one would only be able to supply 8.75mA.

  • WilliamK / about 14 years ago / 2

    Here's an Arduino code to control 16 leds with 2 chips.<br />
    <br />

    define LEDlatchPin 22 // LEDs Output C595N //<br />

    define LEDclockPin 24 // LEDs Output C595N //<br />

    define LEDdataPin 23 // LEDs Output C595N //<br />

    <br />
    class LEDs<br />
    {<br />
    public:<br />
    LEDs()<br />
    {<br />
    pinMode(LEDlatchPin, OUTPUT);<br />
    pinMode(LEDclockPin, OUTPUT);<br />
    pinMode(LEDdataPin, OUTPUT); <br />
    <br />
    Reset();<br />
    }<br />
    <br />
    void Tick(void)<br />
    {<br />
    digitalWrite(LEDlatchPin, LOW);<br />
    digitalWrite(LEDdataPin, LOW);<br />
    digitalWrite(LEDclockPin, LOW);<br />
    for (int i=15; i>=0; i--) <br />
    {<br />
    digitalWrite(LEDclockPin, LOW);<br />
    if (Value[i]) digitalWrite(LEDdataPin, HIGH); else digitalWrite(LEDdataPin, LOW);<br />
    digitalWrite(LEDclockPin, HIGH);<br />
    digitalWrite(LEDdataPin, LOW);<br />
    }<br />
    digitalWrite(LEDclockPin, LOW);<br />
    digitalWrite(LEDlatchPin, HIGH);<br />
    }<br />
    <br />
    void Reset(void) { memset(Value,false,sizeof(Value)); }<br />
    <br />
    boolean Value[16];<br />
    };

  • Sciguy / about 15 years ago / 2

    Any idea when these will come in stock?

  • 3000farad / about 15 years ago / 2

    I got one of these and it was defective. There was a resistance of 1.5 ohms (yes, I was reading the meter right. It was not megaohms or anything) across the power pins, so it would just cause a ground short.

  • Another tutorial on how to use this with Arduino is here: http://bit.ly/cwzmxN

  • KingVash / about 16 years ago / 2

    These can be great on breadboard projects because all the outputs are on one side and in order.

    • icyfyer / about 13 years ago / 2

      QA is actually on the other side, but for the most part you are correct.

  • Member #253032 / about 10 years ago / 1

    I had no luck with any of the tutorials but I found this one and the shift register is now working as described!

    http://staticjolt.com/shift-registers-arduino-tutorial/

    https://www.youtube.com/watch?v=bqfPZXEuyuc

  • RichardBronosky / about 10 years ago / 1

    I found a great article by, Hackaday.com Managing Editor, Mike Szczys that explains how to use an AVR/Arduino SPI bus to drive a 595 shift register. It's very cool that the hardware SPDR can be used to eliminate the need to do manual serial clocking. http://jumptuck.com/2011/11/03/how-to-drive-595-shift-registers-with-avr-hardware-spi/

    Unfortunately I cannot use this for my project because I have other SPI devices sharing the SPI port. This is only a problem if you care about the output being enabled while you are communicating with your other devices. Since I have a 7 segment display on the shift register, it would dim the LEDs to have the 595's OE disabled while SSing the other devices. OE (Output Enable) is interchangable with SS when there is only one SPI device. But, to play nice with others, you would need SS to connect to a non-existant Input Enable pin.

  • red913 / about 10 years ago / 1

    Anyone know why when I'm running the 7 segment library that's provided here I can only get it to display the number 8? It has some examples that I'm trying and the demo and serial example both will only display 8 and that's it. I'm running it on a 4 digit, 7 seg display.

  • Kamikid / about 11 years ago / 1

    Gonna order one of these to play around with!

  • Member #473674 / about 11 years ago / 1

    Nick Poole - Best Shift Registers explanation ever. Well done! Now I understand how to use them...and will buy some!

  • will the register pins on one of these sink current? I have successfully used one to control the segments on common cathode 4-digit display but I'm still using 4 pins on my Arduino to make the digit selection with. I would like to chain two of these shift registers together and use 4 bits from the 2nd register to control the digits. Ultimately, I'd like to try using 3 of them to control 2 4-digit displays for a total of 8 digits (and, yes, I know I could get one chip to do all that, but I'm trying to design projects for my students that will make them have to do some trickier programming, and coming up with "non-standard" hardware solutions is the only way to keep them from just copying code of the Internet).

  • Member #369433 / about 11 years ago / 1

    I am wondering m74hc595b1 is same as 74hc595 microprocessor? I cant find what these are difference?

  • Member #437129 / about 11 years ago / 1

    This chip (and tutorial) workes great on my UNO. BUT... on my small clone Anarduino (love these...) the output is unpredictable, usually all the LEDs stay lit. The only real difference I can tell is that the Anarduino clone usues a 16MHz resonator rather than 16MHz crystal and 22pF capacitors. Would the use of a resonator cause timing issues that could make the 74HC595 chip not work? -profharris

  • Wraithan / about 11 years ago / 1

    In case anyone was wondering, it appears the 74HC595 makes connections before it breaks them. If you have 0-6 HIGH and you are only changing 7 between HIGH and LOW, 0-6 appear to stay stable. If it isn't stable then it is a faster break than my teensy can detect, or my wires have enough capacitance to compensate.

    • Kamiquasi / about 11 years ago / 1

      Correct :) When viewing datasheets for these types of devices, check whether the output is 'latched'. If it is, you're good to go. If it isn't, expect pitfalls :)

  • Member #446058 / about 11 years ago / 1

    I bought this and it works great.

    just a technical question, I am using an arduino UNO and have connected the DATA, the Clock, and the Latch all to digital pins (no PMW) is that OK? (it works fine.. but its nice to have a justification) and I have noticed that some tutorials have the clock use a PMW pin others have the data... Kindly enlighten me if possible.

    Thanks :)

  • dewclaws / about 11 years ago / 1

    Is it possible to use one of these to drive a common anode Display module, like the 1.0" Single Digit Alphanumeric Display? If sow, how would you wire up a pair of these to drive that unit? Sorry a little lost on what I should use to avoid having to have a ton of resistors. I plan to multiplex the display to void to much draw. Or does that make sense?

  • Member #439941 / about 12 years ago / 1

    Awesome explanation!

  • Soldanr / about 12 years ago / 1

    Was anybody able to get the 7 Segment Pineapple Library written by Quin to work? I tried to trouble-shoot the library and had no success.

  • Member #377760 / about 12 years ago / 1

    Is there a higher Volts (9V) version of this IC?

  • Member #340672 / about 12 years ago / 1

    Hello everyone, I'm really struggling with getting this shift register to control the 1 amp motor driver https://www.sparkfun.com/products/9457 . I have wired everything according to the bildr tutorials of both components but I keep coming up with the same problem. Anytime I resist the motors movement, the shift register freaks out and sends random signals to the motor controller. I feel like I've tried everything. Any ideas? I'd be happy to answer any questions you have about my setup because I'm at a loss. Thanks a lot for your help!

  • Dr. DFTBA / about 12 years ago / 1

    Can I connect the output of one into the input of another?

  • BloodCoder / about 12 years ago / 1

    Do you see any problems running 300 74HC595 chained together? basically 100 columns of 8 RGB LEDs.

    • MikeGrusin / about 12 years ago / 3

      If you can deal with the power distribution (100 x 8 x 3 x 10mA = 24A), then no, there's no specific reason that this shouldn't work. You'll want to buffer the SCK and RCK signals every 10 chips or so, as a single logic output can't drive that many inputs (the limit is called "fanout").

      Before you commit, consider other solutions such as addressable LED driving chips, either multiple (64) or single LED.

  • Member #197750 / about 12 years ago / 1

    "666 in stock" Umm... Sparkfun? Is there something you want to tell us, perhaps about a demon in the basement?

  • NathanJSeeley / about 12 years ago / 1

    so I suck at reading data sheets... I was wondering what the maximum voltage is that I can put through this shift register is. I am wanting to make an automated fireworks display and I need to supply 6-12 volts to the igniters. can this IC handle it or would I need to find a High voltage version?

    • MikeGrusin / about 12 years ago / 1

      The section you're looking for is usually labeled "absolute maximum ratings". For this part, it says that the maximum VCC is 7V, and although you can get 35mA out of a pin, you're limited to putting 70mA into the chip as a whole. Basically, the 74HC595 is much more of a logic part than a driver part (and it's not a great idea to run at the limits in any case).

      However, there are other solutions. We carry a version of this chip which is meant for driving larger loads, check out the TPIC6B595. Also, it's common in cases like this to route an output from a low-power device like the 74HC595 through a FET, solid-state relay, or other high-current driver to run the big stuff. Good luck with your project!

  • Nikarus / about 13 years ago / 1

    Hey if I wanted, could you set up 2 of these registers in parallel so that 2 of them receive the exact same info simultaneously?

  • bookmunkie / about 13 years ago / 1

    What does it mean in the datasheet when it says it can drive up
    to 15 LSTTL loads?

  • Quincy / about 13 years ago / 1

    I ordered 3 if these and none of them worked, has anyone else had this problem?

  • bisbeejim / about 13 years ago / 1

    Help!
    I can't get the 3rd shift register to work properly. All of the LEDs from the 3rd shift reg light up and stay lit. The wiring looks right and the code looks right. Has anyone else had this problem?

    • dearmash / about 13 years ago / 1

      Hey, talk about good timing. I had the same exact issue 2 hours ago. It's more than likely programmer error. I proved that when I coded it for two registers & hooked it up to 2 & 3, rather than 1 & 2. That worked.
      The issue turned out to be using ints as the default. Changing to unsigned long (more than 2^24 bits) did the trick. This means all of the 1UL

  • madman123456789 / about 13 years ago / 1

    what the frick is a shift register

  • Radioactive / about 14 years ago / 1

    Is is possible to PWM the outputs ( all of them, at the same time, freq ) by toggling Output Enable?
    Looking at the specs it appears that this works. Not sure...

  • b-dude / about 14 years ago / 1

    25 year embedded software engineer here, trying my hand at my first hardware project since high school electronics. Starting out is overwhelming with the number of controller and logic chips out there to choose from. Thank you for narrowing down my choices with related parts on your website, notes and useful comments. It is very helpful cutting through the noise and finding a starting point.
    I'm thinking of using two 74HC595 for driving your alphnumberic LED displays in my project as discussed in other comments here. Since I need 4 displays (as well as other outputs), that means 8 of these little guys which is about the same price as a few more microcontrollers. I googled the part and found it much cheaper elsewhere. Any chance of lowering the price of the 74HC595 so I can get all my parts from you?

    • MostThingsWeb / about 12 years ago / 1

      I know I'm a year late, but you can always get these parts from Mouser at a much lower rate.

  • Spencer2 / about 14 years ago / 1

    Is there a though hole Eagle file for this anywhere? I have completely exhausted google.

    • Omaga Sohe / about 13 years ago * / 2

      I know it's months later, but people are going to see it anyway. Eagle has one stock, look under the 74xx-us, and the 74*595 part. the DIL16 package is the one your loking for.
      even if it's a duh, no brainer, rtfm type question, please someone toss out the answer. You know how confusing this can be for newbies.

  • Bill9603 / about 14 years ago / 1

    Do you have an SMD version of this? It is listed in the EAGLE library. Under: 74*595 -> 74LS595D ---- SOIC

  • SeanA / about 14 years ago / 1

    Someone mentioned that this can be used as a PISO device? Has anyone actually been able to get it to behave that way and if you did, how did you do it?

  • Rcrowley / about 14 years ago / 1

    How about publishing that tutorial in a PC-friendly format? I don't have anything that will open tar.tz files.

    • Eric-Montreal / about 14 years ago / 2

      tar, tgz and tar.gz originate from Linux, but you can read them easily on any Windows machine using the excellent multi format archiver 7Zip (open source) :
      http://www.7-zip.org/download.html
      This reads and writes most archive formats, including their own increasingly popular 7z format (LZMA, better compression than zip format)

  • Soda / about 14 years ago / 1

    Anyone have a good tutorial on how to get started using this with an ATMega168 (or similar AVR)? I'd like to control a 7-segment LED with just a few pins. (I've seen those Arduino ones, but I'm writing code in C and compiling with AVR-gcc.) Thanks.

  • tehjrow / about 14 years ago / 1

    Am I correct that the vcc pin is what actually puts the power to the output pins when they're activated? For more than a few LEDs you'd need to use external power rather than the arduino. Right?

  • Dingle / about 15 years ago / 1

    NEED MOAR POWA!!!!
    na, but seriously though, i tried the tutorial from the arduino site and USB is not enough to power the 8 L.E.D's

    • Member #302799 / about 12 years ago / 1

      That's odd. It can only suply 70ma and the usb can supply ~500ma.

    • mbrown9412 / about 14 years ago * / 1

      were you using resistors?
      or what LED's were you using?
      I can easily run 15 or so LED's of my Arduino, sometimes more

Customer Reviews

4.3 out of 5

Based on 3 ratings:

Currently viewing all customer reviews.

2 of 2 found this helpful:

Add extra I/O pins with ease

The 75HC595 shift register is a great and fast way to add I/O pins to your microcontroller. It only requires 3 pins to drive it and has an unlimited number of outputs, assuming you have enough chips.

2 of 2 found this helpful:

Works as advertised.

Don't forget to tie OE low and SRCLR bit high for everything to work properly :-) Crazy fast too. Times for shifting are in tens of nanoseconds.

Great for Driving 7-Seg Displays

I have used these to drive Sparkfun's 4-digit 7-segment bubble displays. They performed better than expected. Will buy again.