Hi guys, on to my second RpI project…I purchased an 8-channel I2C relay board (https://store.ncd.io/product/8-channel-general-purpose-spdt-relay-controller-with-i2c-interface/?attribute_pa_relay-amperage=5-amp-spdt&attribute_pa_pluggable-connectors=add-pluggable-connectors ) to build a budget-scale replacement for a hardware PLC that we end up having to replace every few years due to hardware failure. Figure the time is right to put together some python code so we’ll only need $150 worth of hardware instead of $1500…
Anyhow, the first thing I need to figure out is how to simulate the interrupt-driven nature of PLCs. I see that there is a GPIO library that does that very thing. Intro here: https://raspi.tv/2013/how-to-use-interrupts-with-python-on-the-raspberry-pi-and-rpi-gpio .
BUT my lack of experience with the hardware layers has me stalled getting out of the gate. Will the GPIO library communicate with the I2C board so I can follow the examples in that tutorial? If not, is there some sort of similar functionality in I2C? Or, is there a different GPIO board that I should use that can leverage those libraries?
Guess I should give a brief description of what’s going down: It’s a siren control panel for my volunteer firehouse. When we are dispatched to a call, we have a receiver that has a programmable relay that closes (set for 1 second right now, but it can do whatever). When that happens, a sequence of events starts: A claxon horn in the firehouse sounds for 3 seconds; the roof siren sound for one minute (with the on/off cycles within that minute dictated by the PLC); the lights in the engine room turn on for a pre-programmed interval; and the door switch is unlocked, also for a pre-programmed interval. There are also some manual controls on the control box: turn on all the lights; unlock the door; sound the siren; or start the entire sequence as if a call is received. So at least 4 inputs to watch for, while performing any and all actions when needed.