top of page

PLC Security System
This project was a great experience to learn about ladder logic and sensor monitoring. The ladder logic and flowchart were written completely by me and were evaluated by a TA. This was my first time using SIMATIC, which I have gotten much better at (lol), and my first exposure to complex Boolean logic and FSM teachings.
​
I created a Boolean algorithm flowchart, programmed the PLC and HMI, attached sensors, performed FSM tests, and analyzed the results to use statistically-relevant numbers.
​
​
Sensor and System Overview

Notes:
-
These were wired into the PLC by me with the help of my professor before the coding, this was somewhat trivial so I did not include this
-
Sensor A represents a door lock
-
Sensor B represents window locks
-
Sensor E represents a "panic button" somewhere in the home

This is the HMI (Human-Machine Interface) of the PLC. It uses the red, yellow, and green lights to symbolize statuses of the security system. Red symbolizes failure to disarm (calling the police). Yellow symbolizes active status (counting down to call the police). Green represents that the system is armed and can be triggered. The passcode used in this system was pre-set to 2531 to simplify the user-experience. It could theoretically be changed to anything though. The passcode, used to disarm, is input onto the touchscreen when prompted.
Algorithm Flow Chart for Security System

Table for Symbolic Flowcharts
Main Flowchart

Predefined Processes in Main Flowchart

PLC (Specifically SIMATIC) Syntax for Following Ladder Logic


PLC Code and Explanations (based completely on the algorithm above)
Initialization Phase

The Initialization phase monitors the states of the sensors and confirms that no sensor has been preemptively triggered. If the condition is fulfilled, the security system is initialized and idles until an “Arm” button is pressed on the HMI.
Button Press Phase

The Button Press Phase idles until the homeowner begins one of the arming sequences by pressing either “Arm Stay” or “Arm Away”. The two options represent the ability to allow movement in the home while the system is armed. In other words, the infrared motion and vibration sensors states are monitored only in the “Arm Away” sequence. Once an arming choice is pressed on the HMI, the ladder logic for the corresponding choice is initiated.
Arm Away Phase

The “Arm Away” phase is activated when the “Arm Away” button is pressed on the HMI. The next step after pressing the “Arm Away” button is to enter the correct passcode of 2531 then to press ENTER. If the password was correct, the green light turns on to symbolize the armament of the system. Once the system is armed for “Arm Away”, the states of the toggle switches, mushroom-head press-button, magnetic reed switch, infrared motion detector, and vibration sensor are monitored for changes. If a change in state is detected, the security system will set the “Trigger” value to on
Arm Stay Phase

Similarly, the “Arm Stay” Phase is activated when the “Arm Stay” button is pressed on the HMI. The next step after pressing the “Arm Stay” button is to enter the correct passcode of 2531 then to press ENTER. If the password was correct, the green light turns on to symbolize the armament of the system. Once the system is armed for “Arm Stay”, the states of the toggle switches, mushroom-head press button, and magnetic reed switch are monitored for changes. The infrared motion detector and vibration detector are not monitored to allow motion in the home without triggering the system. If a change in monitored states is detected, the security system will set the “Trigger” value to on.
Disarmament Phase

The Disarmament Phase begins when the “Triggered” value is set to on. When the system is “Triggered”, the greenlight is turned off and the yellow light is turned on. The next step is for the countdown to begin. The countdown was chosen based on statistical evidence and research to determine the optimal time to maximize time allotted for disarmament while minimizing the time of opportunity for an intruder (see table below). If the countdown reaches zero, the yellow light turns off and the red light turns on, symbolizing a failure to disarm. The system can be disarmed during the countdown by pressing the “Disarm” button and then inputting the correct passcode, followed by ENTER. If this is done before the countdown ends, the system is disarmed, and the yellow light will turn off. If the passcode is incorrect three times, the system will turn off the yellow light and turn on the red light, symbolizing a failure to disarm. The attempt tracking feature prevents password guessing from an intruder, creating more safety.
Resolution Phase

The Resolution Phase resets the output values used to communicate changes in the ladder logic. When the system is disarmed or fails to disarm, a reset cycle of integral coils is implemented. This feature allows multiple sequential arming and disarming sequences while streamlining efficiency. It is important to only reset these values after the system is properly disarmed. When the lights are off for the system, the system can be armed.
The complete ladder logic can be seen at the end. Reachability analysis was also conducted using an online SAT-solver (not shown)
Research of Walking Speeds (Based on Available Data from Healthline)


PLC Ladder Logic (Together)





bottom of page