{"id":1566,"date":"2016-11-11T05:47:54","date_gmt":"2016-11-11T12:47:54","guid":{"rendered":"http:\/\/play.fallows.ca\/wp\/?p=1566"},"modified":"2017-02-09T20:45:57","modified_gmt":"2017-02-10T03:45:57","slug":"overcome-nodemcu-limitations-gpio-expander","status":"publish","type":"post","link":"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/","title":{"rendered":"Overcome NodeMCU Limitations with GPIO Expander"},"content":{"rendered":"<p><a href=\"https:\/\/i0.wp.com\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2016\/11\/GPIO-Expander.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" style=\"border: 0px currentcolor\" title=\"GPIO Expander\" src=\"https:\/\/i0.wp.com\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2016\/11\/GPIO-Expander_thumb.jpg?resize=525%2C406\" alt=\"GPIO Expander\" width=\"525\" height=\"406\" border=\"0\" \/><\/a><\/p>\n<p>You can add a GPIO expander to the NodeMCU for $2.<\/p>\n<p><!--more--><\/p>\n<p>The other day, I was writing about NodeMCU GPIO pin limitations. Since then, I have uncovered an easy way to create many more GPIO pins for this device for only a couple of dollars. The solution is a PCF8574 IO Expansion Board I\/O Expander available on <a href=\"http:\/\/www.ebay.com\/itm\/PCF8574-IO-Expansion-Board-I-O-Expander-I2C-Bus-Evaluation-Development-Module\/400453349150?_trksid=p2047675.c100623.m-1&amp;_trkparms=aid%3D222007%26algo%3DSIC.MBE%26ao%3D1%26asc%3D40149%26meid%3D82c996c261714b2aaa988a75557b7d94%26pid%3D100623%26rk%3D1%26rkt%3D6%26sd%3D251047151130\" target=\"_blank\" rel=\"nofollow\">EBay<\/a> and elsewhere. I have ordered a few.<\/p>\n<p>This type of expansion board uses the I2C bus, which is a two wire serial data bus. I2C or <a href=\"https:\/\/en.wikipedia.org\/wiki\/I%C2%B2C\" target=\"_blank\" rel=\"nofollow\">Inter-Integrated Circuit Bus<\/a>. The I2C bus was originally designed for short data communications between chips on a circuit board. It is now mostly used for short distance serial communications between a microprocessor and a peripheral. It runs fairly fast and only needs two pins \u2013 one for clock, one for data. And, since it is addressable, you can daisy chain I2C peripherals on the same bus (same to pin connections) and set different addresses for each.<\/p>\n<h2>I2C GPIO Expander<\/h2>\n<p>In short, you can connect the GPIO expander to two pins on the NodeMCU. In turn, the GPIO expander will provide you with 8 additional GPIO. So, the net gain is six more pins. Although, if you are using some of the pins for input, you will also need another NodeMCU pin to read interrupts from the GPIO expander. These interrupts will tell your program when data is available to be read as an input (high or low).<\/p>\n<p>If I daisy chain two of these expanders together, I will be able to get a net gain of 12 pins (16 \u2013 two wire I2C \u2013 two interrupts.) As far as I know, the NodeMCU Arduino core implements I2C in software, so I will have my choice of pins for I2C implementation.<\/p>\n<p>This type of port expansion first became popular a few years ago for interfacing the LCD1602 display. This LCD display uses 8 bits of parallel data for writing to the display. In turn, this hogged 8 digital pins on the Arduino. As a result, several makers started providing a <a href=\"http:\/\/www.geeetech.com\/wiki\/index.php\/Serial_I2C_1602_16%C3%972_Character_LCD_Module\" target=\"_blank\" rel=\"nofollow\">piggyback board<\/a> from running this popular display on I2C rather than 8 Arduino pins.<\/p>\n<p>Finally, if you want to roll your own, there are various I2C <a href=\"http:\/\/playground.arduino.cc\/Code\/I2CPortExpander8574\" target=\"_blank\" rel=\"nofollow\">port expander integrated circuits<\/a> available.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can add a GPIO expander to the NodeMCU for $2.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","_share_on_mastodon":"0"},"categories":[11],"tags":[52,215,219,214],"series":[261],"class_list":["post-1566","post","type-post","status-publish","format-standard","hentry","category-electronics-projects","tag-arduino","tag-esp-12e","tag-i2c","tag-nodemcu","series-nodemcu"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Overcome NodeMCU Limitations with GPIO Expander - Making It Up<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Overcome NodeMCU Limitations with GPIO Expander - Making It Up\" \/>\n<meta property=\"og:description\" content=\"You can add a GPIO expander to the NodeMCU for $2.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/\" \/>\n<meta property=\"og:site_name\" content=\"Making It Up\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/john.fallows.5\" \/>\n<meta property=\"article:published_time\" content=\"2016-11-11T12:47:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-02-10T03:45:57+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2016\/11\/GPIO-Expander_thumb.jpg\" \/>\n<meta name=\"author\" content=\"John VE6EY\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@VE6EY\" \/>\n<meta name=\"twitter:site\" content=\"@VE6EY\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"John VE6EY\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/\",\"url\":\"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/\",\"name\":\"Overcome NodeMCU Limitations with GPIO Expander - Making It Up\",\"isPartOf\":{\"@id\":\"https:\/\/play.fallows.ca\/wp\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2016\/11\/GPIO-Expander_thumb.jpg\",\"datePublished\":\"2016-11-11T12:47:54+00:00\",\"dateModified\":\"2017-02-10T03:45:57+00:00\",\"author\":{\"@id\":\"https:\/\/play.fallows.ca\/wp\/#\/schema\/person\/9750e0ab227030255d9806757525f945\"},\"breadcrumb\":{\"@id\":\"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2016\/11\/GPIO-Expander_thumb.jpg?fit=525%2C406&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2016\/11\/GPIO-Expander_thumb.jpg?fit=525%2C406&ssl=1\",\"width\":525,\"height\":406},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/play.fallows.ca\/wp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Projects\",\"item\":\"https:\/\/play.fallows.ca\/wp\/category\/projects\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Electronics Projects\",\"item\":\"https:\/\/play.fallows.ca\/wp\/category\/projects\/electronics-projects\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Overcome NodeMCU Limitations with GPIO Expander\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/play.fallows.ca\/wp\/#website\",\"url\":\"https:\/\/play.fallows.ca\/wp\/\",\"name\":\"Making It Up\",\"description\":\"Enjoying Radio and Maker Hobbies\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/play.fallows.ca\/wp\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/play.fallows.ca\/wp\/#\/schema\/person\/9750e0ab227030255d9806757525f945\",\"name\":\"John VE6EY\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/play.fallows.ca\/wp\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e4048edfe09efff51033c48b4fb951e8ac0a4dc84a25c96b25e5ae9f5b7069a5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e4048edfe09efff51033c48b4fb951e8ac0a4dc84a25c96b25e5ae9f5b7069a5?s=96&d=mm&r=g\",\"caption\":\"John VE6EY\"},\"sameAs\":[\"https:\/\/x.com\/VE6EY\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Overcome NodeMCU Limitations with GPIO Expander - Making It Up","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:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/","og_locale":"en_US","og_type":"article","og_title":"Overcome NodeMCU Limitations with GPIO Expander - Making It Up","og_description":"You can add a GPIO expander to the NodeMCU for $2.","og_url":"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/","og_site_name":"Making It Up","article_publisher":"https:\/\/www.facebook.com\/john.fallows.5","article_published_time":"2016-11-11T12:47:54+00:00","article_modified_time":"2017-02-10T03:45:57+00:00","og_image":[{"url":"http:\/\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2016\/11\/GPIO-Expander_thumb.jpg","type":"","width":"","height":""}],"author":"John VE6EY","twitter_card":"summary_large_image","twitter_creator":"@VE6EY","twitter_site":"@VE6EY","twitter_misc":{"Written by":"John VE6EY","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/","url":"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/","name":"Overcome NodeMCU Limitations with GPIO Expander - Making It Up","isPartOf":{"@id":"https:\/\/play.fallows.ca\/wp\/#website"},"primaryImageOfPage":{"@id":"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/#primaryimage"},"image":{"@id":"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/#primaryimage"},"thumbnailUrl":"http:\/\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2016\/11\/GPIO-Expander_thumb.jpg","datePublished":"2016-11-11T12:47:54+00:00","dateModified":"2017-02-10T03:45:57+00:00","author":{"@id":"https:\/\/play.fallows.ca\/wp\/#\/schema\/person\/9750e0ab227030255d9806757525f945"},"breadcrumb":{"@id":"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/#primaryimage","url":"https:\/\/i0.wp.com\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2016\/11\/GPIO-Expander_thumb.jpg?fit=525%2C406&ssl=1","contentUrl":"https:\/\/i0.wp.com\/play.fallows.ca\/wp\/wp-content\/uploads\/sites\/4\/2016\/11\/GPIO-Expander_thumb.jpg?fit=525%2C406&ssl=1","width":525,"height":406},{"@type":"BreadcrumbList","@id":"https:\/\/play.fallows.ca\/wp\/projects\/electronics-projects\/overcome-nodemcu-limitations-gpio-expander\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/play.fallows.ca\/wp\/"},{"@type":"ListItem","position":2,"name":"Projects","item":"https:\/\/play.fallows.ca\/wp\/category\/projects\/"},{"@type":"ListItem","position":3,"name":"Electronics Projects","item":"https:\/\/play.fallows.ca\/wp\/category\/projects\/electronics-projects\/"},{"@type":"ListItem","position":4,"name":"Overcome NodeMCU Limitations with GPIO Expander"}]},{"@type":"WebSite","@id":"https:\/\/play.fallows.ca\/wp\/#website","url":"https:\/\/play.fallows.ca\/wp\/","name":"Making It Up","description":"Enjoying Radio and Maker Hobbies","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/play.fallows.ca\/wp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/play.fallows.ca\/wp\/#\/schema\/person\/9750e0ab227030255d9806757525f945","name":"John VE6EY","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/play.fallows.ca\/wp\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e4048edfe09efff51033c48b4fb951e8ac0a4dc84a25c96b25e5ae9f5b7069a5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e4048edfe09efff51033c48b4fb951e8ac0a4dc84a25c96b25e5ae9f5b7069a5?s=96&d=mm&r=g","caption":"John VE6EY"},"sameAs":["https:\/\/x.com\/VE6EY"]}]}},"share_on_mastodon":{"url":"","error":""},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6wNv5-pg","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/play.fallows.ca\/wp\/wp-json\/wp\/v2\/posts\/1566","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/play.fallows.ca\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/play.fallows.ca\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/play.fallows.ca\/wp\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/play.fallows.ca\/wp\/wp-json\/wp\/v2\/comments?post=1566"}],"version-history":[{"count":3,"href":"https:\/\/play.fallows.ca\/wp\/wp-json\/wp\/v2\/posts\/1566\/revisions"}],"predecessor-version":[{"id":1576,"href":"https:\/\/play.fallows.ca\/wp\/wp-json\/wp\/v2\/posts\/1566\/revisions\/1576"}],"wp:attachment":[{"href":"https:\/\/play.fallows.ca\/wp\/wp-json\/wp\/v2\/media?parent=1566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/play.fallows.ca\/wp\/wp-json\/wp\/v2\/categories?post=1566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/play.fallows.ca\/wp\/wp-json\/wp\/v2\/tags?post=1566"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/play.fallows.ca\/wp\/wp-json\/wp\/v2\/series?post=1566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}