Alarm SystemThis is an example how to use a State Machine for an Alarm System. Learn more about a State Machine.
It has three inputs:
- Key switch
- Contact on the exit door
The schematic is quite simple due to the State Machine, if it was made with logic ports it had required a lot of symbols. Here an explanation with the simulator how it works in detail.
To explain how the scheme works it is loaded into the simulator: how to use the simulator
Using the state machine
- The state machine starts in Alarm off.
- When the key is turned (input key switch) the signal GoOn is high and the status diagram goes to state PreArmed.
- The signal PreArmed activates the buzzer.
- PreArmed triggers timer and after 20 seconds ARM is active.
- In status ARMED there are three possibilities:
- GoOff by the key result: AlarmOff
- Exit-Entery user has triggered the entry result: PreOff
- PIR result: Alarm
- When the PIR is triggered, the status runs to Alarm and the Siren and AlarmLed will be activated.
- The alarm also starts a timer to end the alarm. The system returns to ARMED.
- After an alarm the system is back in ARMED and the AlarmLed stays on to let the user know there was an alarm.
- The exit-entry is triggerd when the user enters the house. A 20 sec. timer is started. If the alarm is not turned off with the key the siren will be enabled.
Prepared for devices: ST6260C ST7FLite10 PIC16F88 PIC16F876 other devices can be used by reconnecting I/O pins.