Sie sind auf Seite 1von 7

Intruder alarm system

In this project, you will design and implement an intruder alarm system for detecting attempted thefts in a home or business environment.
The system has a door sensor connected to P0.0, a window sensor connected to P0.1, a keypad at Port 2, an inside buzzer and an outside buzzer connected at P0.6 and P0.7. All inputs and outputs are active-low. The keypad has 12 keys: 0-9 keys for password, # key for accepting the password (like Enter key on keyboard), and * key for changing password.

Operation
The alarm system must let the user, after setting the alarm by entering a password and #, has enough time to open the door and leave the room before the monitoring process starts. Similarly, if the user opens the door when the system is armed, he or she will have time to enter the password before the alarm begins to sound.

States
The system is to operate as follows: When initially activated, the system is in Disarmed state. In Disarmed state, the sensors are ignored. The alarm does not sound. The system remains in this state until the user enters a valid password via the keypad. When a valid password is entered, the system enters Arming state. If the * key is pressed during this state, the system enters Change_Password state.

States
In Arming state, the system waits for 60 seconds, to allow the user to leave the area before the monitoring process begins. After 60 seconds, the system enters Armed state. During this time, if a correct password is typed in, the system enters Disarmed state.

In Armed state, the status of the various system sensors is monitored. If a window sensor is tripped, the system enters Intruder state. If the door sensor is tripped, the system enters Disarming state. The keypad activity is also monitored: if a correct password is typed in, the system enters Disarmed state.

States
In Disarming state, we assume that the door has been opened by someone who may be an authorized system user. The system remains in this state for up to 60 seconds, after which by default it enters Intruder state. If, during the 60-second period, the user enters the correct password, the system enters Disarmed state. In Intruder state, an alarm will sound by both buzzers. The alarm will keep sounding (indefinitely), until the correct password is entered.

States
In Change_Password state, the user must enter the current password and press the # key. If the password is correct, the user enters a new password and # key. The system updates the new password and goes to Disarmed state. If password is not correct or no password is entered after 20 seconds, the system goes to Disarmed state.

Requirements
Scan the keypad every 50 ms. Return characters (0-9, *, #) corresponding to the pressed keys. Store keypad data into a Keypad_Buffer[5] Store password into a Password[5] Password has 4 digits Update the states every 1 s Display the current state on LEDs

Das könnte Ihnen auch gefallen