{"id":331,"date":"2020-01-07T10:58:38","date_gmt":"2020-01-07T10:58:38","guid":{"rendered":"https:\/\/starthardware.org\/en\/?p=331"},"modified":"2020-10-30T20:12:11","modified_gmt":"2020-10-30T20:12:11","slug":"extending-arduino-with-shift-resister-74hc595","status":"publish","type":"post","link":"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/","title":{"rendered":"Extending Arduino with Shift Resister 74HC595"},"content":{"rendered":"\n<p>The shift register 74HC595 is an integrated circuit (IC), which makes it possible to expand the output channels of the Arduino board almost arbitrarily.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Functionality<\/h2>\n\n\n\n<p>Basically, the 74HC595 shift register converts serial data to parallel data. This means that e.g. the sequence on-on-off-on-on-on-off-on (11011101) is sent to the shift register, which sends this data to its own output pins (from 1 to 8). So it turns on its Pin1, Pin2 also, Pin 3 off \u2026 and so on. These pins remain in their state until new information arrives via the data in pin of the shift register.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/01\/shift-register-74hc595-arduino-functionality-single.gif\" alt=\"Shift register 74hc595 functionality single\" class=\"wp-image-332\" width=\"212\" height=\"123\"\/><\/figure>\n\n\n\n<p>The shift register receives the data sent serially via the DS pin. So that it can distinguish the individual data, a kind of heartbeat is sent simultaneously via the Shift Register Clock Pin (SHCP). Finally, the 74HC595 needs a reset connection to the Arduino board. This means that three digital outputs from the Arduino are used.<\/p>\n\n\n\n<p>Interestingly, several shift registers can be connected in series. This increases the number of possible outputs without the Arduino pins used becoming more.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1021\" height=\"242\" src=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/01\/shift-register-74hc595-arduino-functionality-multiple.gif\" alt=\"Shift register 74hc595 functionality multiple\" class=\"wp-image-333\"\/><\/figure>\n\n\n\n<p>By the way, you can find more information in the <a href=\"https:\/\/www.st.com\/resource\/en\/datasheet\/cd00005085.pdf\">data sheet<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Circuit<\/h2>\n\n\n\n<p>At first glance, the circuit diagram looks a bit complex. Basically, however, only the three mentioned digital outputs from the Arduino board are connected to the shift register 74HC595. In addition, the chip is connected to GND and 5V +.<\/p>\n\n\n\n<p><strong>Important!<\/strong> The clock pin of the shift register (SHCP) must be connected to the GND via a 100nF ceramic capacitor (imprint 104)!<\/p>\n\n\n\n<p>The individual outputs Q0 &#8211; Q7 are connected to LEDs with series resistors.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"829\" src=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/01\/shift-register-74hc595-arduino-circuit-single-1024x829.jpg\" alt=\"Shift register 74hc595 circuit single\" class=\"wp-image-334\" srcset=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/01\/shift-register-74hc595-arduino-circuit-single-1024x829.jpg 1024w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/01\/shift-register-74hc595-arduino-circuit-single-300x243.jpg 300w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/01\/shift-register-74hc595-arduino-circuit-single-768x622.jpg 768w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/01\/shift-register-74hc595-arduino-circuit-single.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Here is the circuit diagram for several shift registers:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"786\" src=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/10\/arduino-shift-register-595-circuit-schaltung-1024x786.jpg\" alt=\"\" class=\"wp-image-408\" srcset=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/10\/arduino-shift-register-595-circuit-schaltung-1024x786.jpg 1024w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/10\/arduino-shift-register-595-circuit-schaltung-300x230.jpg 300w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/10\/arduino-shift-register-595-circuit-schaltung-768x590.jpg 768w, https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/10\/arduino-shift-register-595-circuit-schaltung.jpg 1042w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>All circuits here are created with the <a href=\"https:\/\/fritzing.org\/home\/\">Fritzing software<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Code for the Shift Register 74HC595<\/h2>\n\n\n\n<p>Here is the code for a single shift register:<\/p>\n\n\n\n<pre class=\"wp-block-code wp-block-prismatic-blocks\"><code>\/\/  Name    : shiftOutCode, Hello World                                \n\/\/  Author  : Carlyn Maw,Tom Igoe, David A. Mellis \n\/\/  Date    : 25 Oct, 2006    \n\/\/  Modified: 23 Mar 2010                                 \n\/\/  Version : 2.0                                             \n\/\/  Notes   : Code for using a 74HC595 Shift Register           \/\/\n\/\/          : to count from 0 to 255                           \n\n\/\/Pin connected to ST_CP of 74HC595\nint latchPin = 8;\n\/\/Pin connected to SH_CP of 74HC595\nint clockPin = 12;\n\/\/\/\/Pin connected to DS of 74HC595\nint dataPin = 11;\nvoid setup() {\n  \/\/set pins to output so you can control the shift register\n  pinMode(latchPin, OUTPUT);\n  pinMode(clockPin, OUTPUT);\n  pinMode(dataPin, OUTPUT);\n}\nvoid loop() {\n  \/\/ count from 0 to 255 and display the number \n  \/\/ on the LEDs\n  for (int numberToDisplay = 0; numberToDisplay &lt; 256; numberToDisplay++) {\n    \/\/ take the latchPin low so \n    \/\/ the LEDs don't change while you're sending in bits:\n    digitalWrite(latchPin, LOW);\n    \/\/ shift out the bits:\n    shiftOut(dataPin, clockPin, MSBFIRST, numberToDisplay);  \n    \/\/take the latch pin high so the LEDs will light up:\n    digitalWrite(latchPin, HIGH);\n    \/\/ pause before next value:\n    delay(500);\n  }\n}<\/code><\/pre>\n\n\n\n<p>Here is the code for two shift registers:<\/p>\n\n\n\n<pre class=\"wp-block-code wp-block-prismatic-blocks\"><code>\/\/  Name    : shiftOutCode, Hello World                                \n\/\/  Author  : Carlyn Maw,Tom Igoe, David A. Mellis \n\/\/  Date    : 25 Oct, 2006    \n\/\/  Modified: 23 Mar 2010                                 \n\/\/  Version : 2.0                                             \n\/\/  Notes   : Code for using two 74HC595 Shift Register      \n\/\/          : first count up from 0 to 255                           \n\/\/          : second count down from 255 to 0\n\n\/\/Pin connected to ST_CP of 74HC595\nint latchPin = 8;\n\/\/Pin connected to SH_CP of 74HC595\nint clockPin = 12;\n\/\/\/\/Pin connected to DS of 74HC595\nint dataPin = 11;\nvoid setup() {\n  \/\/set pins to output so you can control the shift register\n  pinMode(latchPin, OUTPUT);\n  pinMode(clockPin, OUTPUT);\n  pinMode(dataPin, OUTPUT);\n}\nvoid loop() {\n  \/\/ count from 0 to 255 and display the number \n  \/\/ on the LEDs\n  for (int numberToDisplay = 0; numberToDisplay &lt; 256; numberToDisplay++) {\n    \/\/ take the latchPin low so \n    \/\/ the LEDs don't change while you're sending in bits:\n    digitalWrite(latchPin, LOW);\n    \/\/ shift out the bits:\n    shiftOut(dataPin, clockPin, MSBFIRST, numberToDisplay);  \n    shiftOut(dataPin, clockPin, MSBFIRST, 255-numberToDisplay);  \n    \/\/take the latch pin high so the LEDs will light up:\n    digitalWrite(latchPin, HIGH);\n    \/\/ pause before next value:\n    delay(500);\n  }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Additional Information<\/h2>\n\n\n\n<p>According to the data sheet, the 74HC595 shift register can only provide 25 &#8211; 35 mA of continuous current per channel. The STP16C596 offers an interesting and much more powerful alternative. This shift register holds 16 channels, each of which provides a continuous current of up to 120 mA. The <a href=\"https:\/\/www.st.com\/resource\/en\/datasheet\/cd00005085.pdf\">data sheet<\/a> can be found here.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sources<\/h2>\n\n\n\n<p><a href=\"https:\/\/amzn.to\/37ONWsV\">74HC595<\/a>*<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The shift register 74HC595 is an integrated circuit (IC), which makes it possible to expand the output channels of the Arduino board almost arbitrarily. Functionality Basically, the 74HC595 shift register converts serial data to parallel data. This means that e.g. the sequence on-on-off-on-on-on-off-on (11011101) is sent to the shift register, which sends this data to&hellip;&nbsp;<a href=\"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Extending Arduino with Shift Resister 74HC595<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":337,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[6],"tags":[],"class_list":["post-331","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Extending Arduino with Shift Resister 74HC595 - More Outputs!<\/title>\n<meta name=\"description\" content=\"The 74HC595 shift register enables the output channels of the Arduino board to be expanded. Here I show you how to do it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Extending Arduino with Shift Resister 74HC595 - More Outputs!\" \/>\n<meta property=\"og:description\" content=\"The 74HC595 shift register enables the output channels of the Arduino board to be expanded. Here I show you how to do it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/\" \/>\n<meta property=\"og:site_name\" content=\"StartHardware - Tutorials for Arduino\" \/>\n<meta property=\"article:published_time\" content=\"2020-01-07T10:58:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-10-30T20:12:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/01\/shift-register-74hc595-arduino-title.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Stefan Hermann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/starthardware.org\/en\/#website\",\"url\":\"https:\/\/starthardware.org\/en\/\",\"name\":\"StartHardware - Tutorials for Arduino\",\"description\":\"Arduino, Electronics, Fun\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/starthardware.org\/en\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/01\/shift-register-74hc595-arduino-title.jpg\",\"contentUrl\":\"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/01\/shift-register-74hc595-arduino-title.jpg\",\"width\":1200,\"height\":675,\"caption\":\"Shift Register 74HC595 and Arduino\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/#webpage\",\"url\":\"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/\",\"name\":\"Extending Arduino with Shift Resister 74HC595 - More Outputs!\",\"isPartOf\":{\"@id\":\"https:\/\/starthardware.org\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/#primaryimage\"},\"datePublished\":\"2020-01-07T10:58:38+00:00\",\"dateModified\":\"2020-10-30T20:12:11+00:00\",\"author\":{\"@id\":\"https:\/\/starthardware.org\/en\/#\/schema\/person\/811b16fabcbfeef4210ea79cf0990a59\"},\"description\":\"The 74HC595 shift register enables the output channels of the Arduino board to be expanded. Here I show you how to do it.\",\"breadcrumb\":{\"@id\":\"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/starthardware.org\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Extending Arduino with Shift Resister 74HC595\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/starthardware.org\/en\/#\/schema\/person\/811b16fabcbfeef4210ea79cf0990a59\",\"name\":\"Stefan Hermann\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/starthardware.org\/en\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5b5a74ee1d07024fd1eff9b1f7137108089169010a93afaee907b9325ee579a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5b5a74ee1d07024fd1eff9b1f7137108089169010a93afaee907b9325ee579a6?s=96&d=mm&r=g\",\"caption\":\"Stefan Hermann\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Extending Arduino with Shift Resister 74HC595 - More Outputs!","description":"The 74HC595 shift register enables the output channels of the Arduino board to be expanded. Here I show you how to do it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/","og_locale":"en_US","og_type":"article","og_title":"Extending Arduino with Shift Resister 74HC595 - More Outputs!","og_description":"The 74HC595 shift register enables the output channels of the Arduino board to be expanded. Here I show you how to do it.","og_url":"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/","og_site_name":"StartHardware - Tutorials for Arduino","article_published_time":"2020-01-07T10:58:38+00:00","article_modified_time":"2020-10-30T20:12:11+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/01\/shift-register-74hc595-arduino-title.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"Stefan Hermann","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/starthardware.org\/en\/#website","url":"https:\/\/starthardware.org\/en\/","name":"StartHardware - Tutorials for Arduino","description":"Arduino, Electronics, Fun","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/starthardware.org\/en\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/#primaryimage","inLanguage":"en-US","url":"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/01\/shift-register-74hc595-arduino-title.jpg","contentUrl":"https:\/\/starthardware.org\/en\/wp-content\/uploads\/2020\/01\/shift-register-74hc595-arduino-title.jpg","width":1200,"height":675,"caption":"Shift Register 74HC595 and Arduino"},{"@type":"WebPage","@id":"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/#webpage","url":"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/","name":"Extending Arduino with Shift Resister 74HC595 - More Outputs!","isPartOf":{"@id":"https:\/\/starthardware.org\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/#primaryimage"},"datePublished":"2020-01-07T10:58:38+00:00","dateModified":"2020-10-30T20:12:11+00:00","author":{"@id":"https:\/\/starthardware.org\/en\/#\/schema\/person\/811b16fabcbfeef4210ea79cf0990a59"},"description":"The 74HC595 shift register enables the output channels of the Arduino board to be expanded. Here I show you how to do it.","breadcrumb":{"@id":"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/starthardware.org\/en\/extending-arduino-with-shift-resister-74hc595\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/starthardware.org\/en\/"},{"@type":"ListItem","position":2,"name":"Extending Arduino with Shift Resister 74HC595"}]},{"@type":"Person","@id":"https:\/\/starthardware.org\/en\/#\/schema\/person\/811b16fabcbfeef4210ea79cf0990a59","name":"Stefan Hermann","image":{"@type":"ImageObject","@id":"https:\/\/starthardware.org\/en\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/5b5a74ee1d07024fd1eff9b1f7137108089169010a93afaee907b9325ee579a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5b5a74ee1d07024fd1eff9b1f7137108089169010a93afaee907b9325ee579a6?s=96&d=mm&r=g","caption":"Stefan Hermann"}}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts\/331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/comments?post=331"}],"version-history":[{"count":3,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts\/331\/revisions"}],"predecessor-version":[{"id":409,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/posts\/331\/revisions\/409"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/media\/337"}],"wp:attachment":[{"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/media?parent=331"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/categories?post=331"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/starthardware.org\/en\/wp-json\/wp\/v2\/tags?post=331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}