In this video, I'll take a look at using the MCP23017 16 port I/O expander with an ESP8266 (or ESP32) and ESPHome to add from 16 to 128 additional digital I/O pins to your project using just the 2-wire I2C bus from the ESP board. I'll cover the pin out, connections and limitations of the MCP23017, the ESPHome code and finally show how I use multiple port expanders to control 72 individual LEDs and three push buttons from a single ESP board to build a completely impractical clock!.
Written version of this project with parts, wiring diagrams and more: https://resinchemtech.blogspot.com/2023/10/IO-expander.html
Chapter Links:
=============
00:00 Intro
01:26 ESP and MCP23017 Overview
03:57 Pinout and Limitations
06:29 ESPHome Component Mapping
07:28 Basic Bench Test
10:10 ESPHome Bench Test Config
11:29 Multiple expander wiring and ESPHome Config
13:07 A Crazy Clock Example with 75 I/O Pins
14:34 Building the Clock Face
16:16 Building the Clock Controller
18:44 Testing the Final Clock Build
19:36 Wrap Up And Other Ideas
Parts Used or Shown:
===================
You may not need all these parts, or may need additional parts, depending upon your particular project. This is just a list of what I used or showed in the video:
9" Wooden Clock Face: https://amzn.to/3LWvUv5
3 mm LEDs (colors of your choice): https://amzn.to/3QcAqIv
24 gauge bare copper wire: https://amzn.to/3twydyR
5V 10A power supply (in lieu of bench power): https://amzn.to/46KZD1X
5V to 3.3V buck converter (in lieu of bench power): https://amzn.to/3QcB9JJ
Wemos D1 Mini (ESP8266): https://amzn.to/48TXZgG
MCP23017 16 Port I/O Expanders: https://amzn.to/3SeVqQr
Breadboard Jumper Kit: https://amzn.to/45pqG1L
Dupont Jumper Wires: https://amzn.to/3ZX8oEe
1/4 Watt Resistors: https://amzn.to/46JDlxJ
Normally Open Pushbuttons: https://amzn.to/45ppJ9H
Other optional tools and items:
------------------------------
Compass: https://amzn.to/3tt1vOG
Digital Angle Finder: https://amzn.to/45uIoAU
ILI9341 2.8" TFT Display: https://amzn.to/3MmE2p9
Hot Glue Gun and Glue: https://amzn.to/3ZR6QLS
Protoboard/Breadboard (updated version from the old one I used): https://amzn.to/3tzBPQE
Some of these links may be Amazon affiliate links. Use of these links will not affect your pricing, but as an affiliate this channel may earn a small commission if you make a purchase. Any commission earned will go towards future projects and videos.
Addtional Information/Links:
===========================
Written version of this project: https://resinchemtech.blogspot.com/2023/10/IO-expander.html
MCP23017 Data Sheet: https://ww1.microchip.com/downloads/en/devicedoc/20001952c.pdf
ESPHome Code used for Breadboard Test: https://gist.github.com/Resinchem/2d1cc6c11ee7f752409bc7805ada6121
If you'd like to help support this channel, or just say thanks, you can consider buying me a cup of coffee:
https://www.buymeacoffee.com/resinchemtech
#esp8266 #esp32 #esphome