This project is an alarm system built for my garage.
It uses the Parallax 4x4 membrane keypad in conjunction with a Microchip MCP23008 I2C I/O Expander chip for controlling the system.
A cog is started to monitor the keypad. It uses the Interrupt-On-Change feature of the MCP23008.
When a key on the keypad is pressed, the MCP23008 interrupt pin goes LOW and the propeller scans the rows and columns to determine which key is pressed.
Then it clears the interrupt as the key is released.
The main cog maintains a circular buffer to hold the last four keypad characters.
Another cog is used to generate various indciator tones with a piezo speaker.
The system may be in one of several states:
Exit Delay (45 sec delay)
Window trigger (immediate alarm)
Door trigger (60 sec delay before alarm)
Features of the system include:
1. 45 second exit-delay when arming the system
piezo buzzer beeps each second and changes to a double beep for the last 15 seconds
2. Alarm siren will be triggered immediately if the window is opened
3. When the side door is opened, there is a 60 second delay to allow a 4 character disarm code to be entered
4. The siren will sound for 3 minutes or until the disarm code is entered.
If disarm code is not entered within 3 minutes, the alarm will cease and the system will return to the armed state
if the door/windows are properly closed.
However, if door or window is still ajar, the alert siren will sound for an additional 3 minutes.
5. LCD backlight turns off after specified delay if no key is pressed or status change occurs. 6. The master (disarm) code is stored in the second 32k of the 64k EEPROM and can be modified by entering a fixed "system code"
To arm the system (from Not Armed state), press the "A" key and the piezo buzzer will beep for the 45 second exit-delay.
To cancel the arming during the exit-delay, press the "C" key and the system will return to the "not armed" state.
To skip the 45 second exit-delay, press the "A" key a second time to immediately arm the system.
While in the armed state, the system will constantly be monitoring the window and door sensors.
It will also be checking to see if the disarm code has been entered, after which it will return to the "not armed" state.