Hi
As mentioned before the primary purpose in all of this is a way to monitor activity within my house without installing new detectors etc and it does this very well, capturing information from all perimeter and space protection devices. This is saved in a database for potential use in any "home automation" I may install.
A basic block outline is attached showing components and connections.
The security system consists of a control panel operated by a remote keypad, detectors including PIRs and these are all normally closed devices, and an external sounder comprising of SAB siren and strobe.
Testing showed that the zone connections would fall from +2.4v to 0v when a detector activated, the Set+ output would rise from 0v to +12v when the panel was set, and the strobe output would fall from +12v to 0v when triggered.
An ESP WROOM-32 dev-board was chosen as target as it can accept a 5v supply and subsequently provide +3.3v output and this is used to monitor and control the system.
The easiest way to control the panel is to connect in parallel with the remote keypad. The keys are arranged in a 4x4 matrix so it was a simple matter to connect the keypad to a 16-channel relay board. When the associated relay operates the corresponding key is "pressed".
The relay board needs a 12v supply, and subsequently provides a 5v output that can be used to power other components. The alarm control panel provides an +12v auxiliary output which can be used to power detectors etc, so a simple matter to have the relay board powered by the panel.
Each of the sixteen relays are activated by holding a controlling pin low, so a PCF8575 IO Expander is used. The expander provides sixteen outputs corresponding to a 16-bit input sent from the ESP over I2C. As the expander operates at 5v and the ESP at 3.3v a level shifter IC is used to safely interface the two.
As the Set+ and Strobe connections will toggle between 0v and +12v depending on status, they connect via a a simple resistor based level shifter to the ESP.
The zones, being at 2.4v connect directly. Note that I have only shown four PIR detectors connecting to zones Z1 to Z4.
When any zone detects, the n/c connection opens which pulls the corresponding line low. The ESP detects this and updates a local database with the details. This works very well indeed.
I have a separate database that is used to log the status of the control panel, if it is set or not or has been triggered. This status, as well as being logged is also sent via MQTT to my phone. My phone can send instructions back to the panel again using MQTT to the ESP. A "set" message will contain my code details and the ESP will accept this and translate into the correct sequence to be sent to the relay board over I2C. An "update" will gather the status of the Set+ and Strobe pins and send out over MQTT.
Very much still a work in progress and code has been rewritten a couple of times. Once I tidy it up a bit I'll post.
Regards