Content
# Industrial GPIO Expander – MCP23017




> Industrial-grade 16-channel I/O expander on a DIN-rail mountable PCB. Featuring MCP23017, optoisolated inputs, ULN2803A high-current outputs, and hardware address selection with 7-segment display. Designed for PLC expansion and industrial automation.
[](https://youtu.be/AG7PeMTG8dg)
---
## ✨ Features
- 🧠 **MCP23017** – 16-bit I²C I/O expander
- 🔌 **I²C Interface** – Up to 8 devices on same bus (128 GPIO)
- 🛡️ **Optoisolated Inputs** – 8x 24V industrial inputs with TLP291-4
- ⚡ **High-Current Outputs** – 8x 5V/24V selectable outputs with ULN2803A
- 🔢 **Hardware Address Selection** – 3-position slide switch (0-7)
- 📟 **7-Segment Display** – Shows current I²C address
- 💡 **LED Indicators** – Status LEDs for all 16 I/O channels
- 🔋 **Flexible Power** – 5V/24V selectable, power via I²C or external supply
- 🏗️ **DIN-Rail Mountable** – 103mm × 60mm PCB with 3D-printed enclosure
- 🔍 **Industrial Protection** – Reverse polarity, TVS diodes, PTC fuses, optoisolation
---
## 📁 Repository Contents
| Folder | Description |
|--------|-------------|
| 📂 [`/GERBER`](https://github.com/BEEMB/Industrial-GPIO-Expander-MCP23017/tree/main/Hardware/GERBER) | Ready-to-order Gerber files |
| 📄 [`/Schematic`](https://github.com/BEEMB/Industrial-GPIO-Expander-MCP23017/tree/main/Hardware/Schematic) | PDF + image exports |
| 🖥️ [`/PCB_Layout`](https://github.com/BEEMB/Industrial-GPIO-Expander-MCP23017/tree/main/Documentation%20/PCB%20Layout) | PCB views (top/bottom/layers) |
| 📁 [`/3D_Models`](https://github.com/BEEMB/Industrial-GPIO-Expander-MCP23017/tree/main/Hardware/3D_Models) | DIN-rail enclosure STL files |
| 📸 [`/Images`](https://github.com/BEEMB/Industrial-GPIO-Expander-MCP23017/tree/main/Documentation%20/Images) | Real build photos + 3D renders |
| 📁 [`/Software`](https://github.com/BEEMB/Industrial-GPIO-Expander-MCP23017/tree/main/Software) | Arduino test code |
---
## 🛒 How to Order
1. Upload Gerber files to [**JLCPCB**](https://jlcpcb.com/?from=TIP)
2. Select: `FR-4` material / `1.6mm` thickness / `ENIG` surface finish
3. **PCB Specifications:**
- Layers: 2
- Size: 103mm × 60mm
- Color: All colors have the same price
4. Add stencil if you plan to assemble yourself
5. Upload STL files to **JLC3DP** for enclosure
| Parameter | Selection |
|-----------|-----------|
| 3D Technology | FDM |
| Material | PLA-P |
| Colors | Black or Gray |
---
## 🔧 How to Assemble
### SMD Assembly (Hot Plate / Reflow):
1. Apply solder paste through stencil
2. Place components (start with smallest first)
3. Reflow on hot plate (245°C peak)
4. Inspect under microscope for bridges
### Through-Hole Assembly:
1. Insert terminal blocks, connectors, and switches
2. Solder each pin with temperature-controlled iron
3. Trim excess leads
4. Clean with isopropyl alcohol
### Assembly Order:
1. **SMD Components** (0603 resistors/caps → ICs → optocouplers)
2. **Through-Hole Components** (terminal blocks → connectors → switches)
3. **Final Inspection** and cleaning
---
## 💻 How to Program
### 1️⃣ Set I²C Address
- Use 3-position slide switch (A0, A1, A2)
- Address = (A0 × 1) + (A1 × 2) + (A2 × 4)
- Confirmed on 7-segment display
### 2️⃣ Connect I²C
```
MCU → I2C_IN Connector (bottom right)
- VCC
- GND
- SDA
- SCL
```
### 3️⃣ Upload Arduino Sketch
```cpp
#include <Wire.h>
#define MCP_ADDR 0x20
void setup() {
Wire.begin();
// Set all GPIOA as outputs
Wire.beginTransmission(MCP_ADDR);
Wire.write(0x00); // IODIRA
Wire.write(0x00); // All outputs
Wire.endTransmission();
}
void loop() {
// Cycle outputs
for(int i = 0; i < 8; i++) {
Wire.beginTransmission(MCP_ADDR);
Wire.write(0x12); // GPIOA
Wire.write(1 << i);
Wire.endTransmission();
delay(500);
}
}
```
### 4️⃣ Select Board
- **Arduino IDE:** Select `Arduino Uno` or compatible board
- **Libraries:** Wire library (built-in)
---
## ⭐ Special Access
You can get direct access to this circuit Files online through this link: [Altium Online Access](https://diy-guy-chris.365.altium.com/designs/B946E0F8-08BB-44F3-9F6D-7489046B26EA)
---
## 📺 Watch the Tutorial
[🎥 Click here for the full YouTube video](https://youtu.be/AG7PeMTG8dg)
---
## 📜 License
MIT © Chris – Electronics Every Day
---
## 🙌 Support
If you try this project, share your build!
⭐ Star this repo if you found it useful.
---
## About
🔍 Industrial-grade 16-channel GPIO expander on DIN-rail mountable PCB. Features MCP23017, optoisolated inputs, ULN2803A high-current outputs, hardware address selection with 7-segment display, and selectable 5V/24V power. Perfect for PLC expansion and industrial automation.
[YouTube Tutorial Link](https://youtu.be/AG7PeMTG8dg)
### Topics
`industrial-automation` `gpio-expander` `mcp23017` `i2c` `din-rail` `plc` `industrial-io` `open-hardware` `embedded-systems` `arduino` `automation`