Raspberry Pi I/O expander

The idea is to use a Raspberry-Pi based system to do observatory control and management functions. This includes

  • Simple intrusion alarm system. Monitor some number of input “zones” for either perimeter door/window state, motion detectors or for monitoring the position of the roll-off roof.
  • Annunciator outputs. For the alarm system, lighting control and peripheral power control.
  • Environmental monitoring - temperature, humidity, possibly cloud sensors.

For debugging, diagnostic and installation purposes, input and output signals should have LED indicators to indicate their current state.

Inputs signals ought to be opto-isolated. This is to achieve some amount of protection against ESD damage due to long wire runs and for galvanic isolation to avoid problems due to different or isolated grounds, etc.

Output signals should be open-collector output drivers. Snubber diodes should also be installed by default. Possibly, a pull-up resistor could be jumpered if required. Expectation is that many/most of the outputs will used to drive external relays. These relays, because of their bulk, will be separately installed. Preassembled multiple-relays boards are relatively inexpensive.

Just assume 3.3v logic levels for the I²C bus, and ideally have 5v tolerant I/O via the open collector outputs and opto-isolated inputs.

Use and I²C based interconnect to the Raspberry Pi (or other controller) to drive an I/O expander device. In the event additional inputs or outputs are required, additional modules can be connected with different I²C addresses. The board shall have jumpers/links available to select the address.

Should have jumper/link selectable pull-up resistors for the I²C bus.

The MCP23017 device seems to be popular and a minimal board is is available as just the basic device with no drivers/protection/etc. Data sheet is here.

For driving an external relay board, are the open collector darlington drivers necessary?

Use something like a ULN2803A open-collector driver. Since the MCP23017 has significant drive capability, connect LED indicators to the ULN2803A inputs, and use those (and their pull-up resistor) to force the relay driver into a known state during reset while the MCP23017 I/O pins initialize to inputs with no weak pull-ups enabled.

Maybe pin-out a spot for an I²C to Dallas one-wire bus device and a 1-wire bus with protection?

Part Description Cost Link
MCP23017-E/SP Microchip I²C I/O expander (DIP) $1.26 579-MCP23017-E/SP Datasheet
ULN2803A ST Micro Darlington Transistor NPN Array (DIP) $0.92 511-ULN2803A Datasheet
LTV-844 Lite-On 4 channel AC Optocoupler (DIP) $0.98 859-LTV-844 Datasheet
DS2482S-100+ I²C 1-Wire Master (SO-8 SMD tube) $1.56 700-DS2482S-100 Datasheet

The PLC 49 open-source PLC seems like an interesting reference for some of the I/O components. The schematic serves as an interesting example.