Supplies

Category Components
Main ICs MCP23017 (I²C I/O Expander)
ULN2803A (High-current driver)
TLP291-4 (Optocouplers)
Powe MB2S (Bridge rectifier)
XL1509-5.0E1 (DC-DC converter)
AMS1117-3.3 (Voltage regulator)
PCB & Assembly 2-layer PCB (103×60mm)
SMD components (resistors, capacitors, LEDs)
Terminal blocks (screw connectors)
3D-printed DIN-rail enclosure (STL files included)
Optional Arduino UNO (for testing)
I²C cables
Soldering tools (hot plate, iron, tweezers)

Schematic Design

Design the circuit in Altium starting with the power entry: a bridge rectifier for reverse polarity protection, followed by a DC-DC converter to step down voltage to 5V. The MCP23017 connects to the I²C bus and drives 8 outputs through the ULN2803A. 

For inputs, use TLP291-4 optocouplers to isolate the 8 input channels from external peripherals . Add a 3-position slide switch for hardware address selection (0-7) and a 7-segment display to show the address.

PCB Layout

Route a 2-layer PCB following industrial PLC standards: power entry at the top left, outputs along the top edge, inputs along the bottom edge, and I²C connectors at the bottom right .

The board measures 103×60mm and includes status LEDs for all 16 I/O channels. you can access the full project design files through my Altium Online Repository. For manufacturing, export Gerber files and upload them to JLCPCB.

Assembly

Apply solder paste through a stencil, then place SMD components (resistors, capacitors, ICs) using tweezers.

Reflow the board on a hot plate at 245°C peak temperature, then solder through-hole components (terminal blocks, connectors) with a soldering iron.

 Clean the board with isopropyl alcohol and inspect for bridges under a microscope.

Testing & Enclosure

Connect the I²C port to an Arduino and upload a sketch to cycle through outputs. For inputs, mirror the input states to outputs to test all channels.

Set the I²C address using the slide switch and verify it on the 7-segment display. Finally, 3D-print the DIN-rail enclosure , secure the board with M3 threaded inserts, and attach a rail clip.

Mount the module on a DIN rail and verify all functions.