Pages

Home Security System

I. Introduction:
For our final project, we designed a home security system with three detection zones. We used magnetic sensors to detect for zone faults. The magnetic switches would trigger the alarm system when opened. A 4-digit security code armed and disarmed the system. The alarm system includes the following features:
  • Programmable 4-digit security code: (default code = "1234")
    • verify old security code
    • enter new security code
    • verify new security code
  • Zone 1 feature: 15 second delay in sounding alarm (for the front door—allows for the homeowner to enter the front door and disarm the system before the system goes off)
  • Sounding of alarm upon violation of a zone
  • Display to LCD which zones violated
  • Steady green LED = "Ready…" state
  • Steady red LED = "Armed!!!" state
  • Flashing green LED = warning—some zones currently in fault
II. Design and Testing Methods:
High level design
In the initial state, the system will be in a ready status. Any zone faults occurring in this state are displayed on the LCD, and a flashing green LED is use to signify a warning. This operating state accounts for when the homeowner is at home with windows or doors opened. The system cannot be armed unless all the zones are clear of violations.
Pressing the programming key "A" while in the ready state brings us into the programming stage. The old security code is requested to verify the user. If confirmed, the system prompts for a new security code. Then it prompts for the new code again for confirmation. If any verification fails, the system returns to the ready state with no changes to the alarm code.
When no zones are in fault, the system can be armed by entering the security code. If a zone fault occurs in this state, then the zone(s) in violation are displayed on the LCD panel, and an alarm is sounded. Entering the security code again will disarm the system. Also, Zone 1 has a 15 second delay in sounding the alarm to allow for the owner to enter the front door and disarm the alarm.

Program/hardware design
For the design of our home security system, we used the following hardware:
  • AT90S4414 MCU
  • LCD Screen—wired to Port D and powered by Pin B7 (Connected as in previous labs)
  • 4 x 4 KeyPad—wired to Port C (Connected as in previous labs)
  • Magnetic switches—connected to Port A for Zones (See Appendix II for schematic)
  • Magnets (for coupling the magnetic switches)
  • Green LED—wired to Pin B0 and ground (Port B)
  • Red LED—wired to Pin B1 and common ground with Green LED
  • Audio Jack and earphone—connected between Pin B6 and B8 (Connected similarly to previous labs)
  • Protype board
We spent a significant part of our time in trying to figure out how to implement both a NAPCO MA900 Security Panel and a RP1009 KeyPad (w/ status LEDs, 7 segment display, and keypad). The manufacturer only provided minimal documentation on the installation of the panel and no technical documentation on the actual keypad-panel interface. We tried to determine the specifics on how data was transferred to/from the KeyPanel by measuring signals outputted and by sending data signals to it. Another issue we ran into was implementing a level shift from the 5 Volt output on the Port pins to 12 Volts on the KeyPanel. A simple BJT circuit could be used to solve this issue. We would have needed 6 of these circuits for outputting to the Panel and 6 more circuits for receiving input from the Panel. With these roadblocks, we decided to design our own panel by reverting back to using the keypad and LCD display.
We used a polling method as in previous labs to decode which key was pressed on the keypad:
  1. Set PC0-PC3 to output & pulled low 
    Set PC4-PC7 to input & pulled high
    Read PC4-PC7
  2. Set PC4-PC7 to output & pulled low
    Set PC0-PC3 to input & pulled high
    Read PC0-PC3
If a button was pressed on the keypad, then exactly one bit in each of the following will equal 0.
  1. PC4-PC7
  2. PC0-PC3
In each of the alarm states described above, we used the polling method to test for zone faults and to check for keypresses.
In designing our program, we used Timer0 for sounding the alarm tones for our alarm (alternating notes between c4 @ 262 Hz and f4 @ 349 Hz). A prescalar of 64 was used on Timer0 to generate the correct frequencies for the alarm notes.
Timer1 was used primarily for
  1. Implementing our delay loops to debounce our keypad
  2. Delaying the sounding of alarm upon entry in zone 1
  3. Blinking the LED.
We used a prescalar of 256 for the debounce delay loop, which gave us 15ms of wait time, while a prescalar of 1024 gave us the .5s of wait time for controlling the blinking of LEDs and the 15s wait time for entry in zone 1.
For the alarm zones, we tried to use Pins A0,2,4 as output (5V) and to poll Pins A1,3,5 (set to input). However, we ran into the issue where we could not get our zones to trigger a fault because Pins A1,3,5 would not go low if a zone fault occurred when a magnetic switch was opened. So, we had to modify our circuit and code so that zone faults occur when Pins A1,3,5 go high. With normally closed switchs, the Pins get pulled low when the door/window is closed.
III . Analysis:
Results of Design
We were successful in implementing our home alarm system. We ran into a minor issue of requiring the zone faults to occur simultaneously in order be recognized. It is a minor issue because a zone violation has occurred whether it is one or more zones. This occurs only when the system is armed. In the ready state, zone status is current for all times. We were only able to implement three detection zones instead of eight as in our final project proposal. The limitation came from the number of ports we had available and the number of magnetic switches we were able to obtain. We also had some problems with the alarm tones where they would mysteriously stop sounding. We tried to debug this problem, but could find no problem with the code (a straight forward implementation from Lab 3) nor any other problems. This isn't too big an issue because, in all practicality, the Port would be connected to an external siren horn which would have a siren oscillator built in. The Napco MA900 panel doesn't even implement this feature; it simply provides power to the speaker pins for a siren oscillator. However, we implemented the siren tones for expository purposes.
Future Improvements
A limitation in our design is that zone faults must happen simultaneously (when the system is armed) to get displayed on the LCD screen. In the future, we would like to show multiple zone faults on the LCD panel when they occur in the armed state. Some other features that we may include are:
  • Ability to shunt certain zones—arm only the downstairs part of a house, so that windows in the upstairs bedrooms may be open for ventilation.
  • Include more zones—offers more flexibility in grouping different rooms, windows, and doors detection together and more coverage.
  • Telephone dialing—automatic contact of local authorities upon triggering of alarm.
  • RS232 Interface—ability to arm and disarm the alarm remotely; monitor system by local security agency; computer interface/uplinking.
  • Entry Buzz—implement a buzzer during the entry delay, after zone 1 has been tripped.
  • LED zones—use LEDs to pinpoint zone faults similar to system used in fire alarms for large buildings.
IV. Appendix I -- Source Code
V. Appendix II -- Zone Schematic
Zone Schematic

0 comments:

Post a Comment

Share your knowledge

Related Posts Plugin for WordPress, Blogger...

Popular Projects

program for Dual DAC 8051 Microcontroller Based DC Motor Control A Microcontroller Based Turbidity Meter A m -Controller Based Thermostat ASCII to BCD conversion in 8051 AT90LS8515 Digital Message Machine Audio Frequency Response Analyzer Audio Homing Robot Automated Juice Mixer Automated Pet Feeder Autonomous Car Autonomous Parallel Parking RC Car Autonomous Search Robot Autonomous Tank Autonomous Vehicle Contrast Following Rover Autonomous navigating robot BCD number to ASCII in 8051 Balance Bot Blind Bot Blood Pressure Monitor Bloodshed Dev-C++ 5 Compiler/IDE Breath Alcohol Tester Converters on TI MSP430 CrossStudio MSP430 IDE Design of a Real-Time Digital Guitar Tuner Digital Oscilloscope Digital Stethoscope Digital clock project using PIC16C54A microcontroller Digital thermometer ECG monitoring system GPS Data Logger with Wireless Trigger Handwriting Recognition Systm Home Security System Home energy managment IAR Embedded Workbench IDE INFRARED TRACKING SYSTEM IntelliBOT Laser Communications System Line following van MSP-EXP430FG4618 Development Tool and the eZ430 kits MSP430FG4618 device implement a Buzzer tone generator MSP430FG4618 device implement a Real Time Clock MSP430FG4618 device implement a voltage ramp generator MSP430FG4618 device present a message on the LCD Basic Microcontroller(8051) Lab Mivo- RFID based mobile payment system Multi-Zone Fire Alarm System PC based temperature control PIC 16f877 RPM Meter PIC16C54 dual dice electronic project circuit PIC16F84A digital thermometer microcontroller project PIC16F886 horn driver PWM motor contoller with MSP430 Program Block data transfer in 8051 Program to add two BCD numbers in 8051 Program to check whether a 4th bit of a byte is 1 Program to convert ASCII to hex in 8051 Program to count from 0-9 in 8051 Program to count number of 1's in a given data byte in 8051 Program to divide an 8 bit no by another 8 bit number in 8051 Program to find largest of n numbers in 8051 Program to find the LCM of two numbers in 8051 Program to find the square of an 8 bit number in 8051 Program to generate 50msec delay in 8051 Program to implement BCD counter to count from 0-99 in 8051 Program to implement BCD counter to count from 99-0 in 8051 Program to interchange two blocks of data in 8051 Program to multiply 16 bit number by 8 bit number in 8051 Program to search an element in an array in 8051 Program to sort an array of 10 elements in 8051 Programming the ez430 Proximity Security System RAMP wave in 8051 RC Car Controller RObo Dog Radio-controlled Truck Retina color tracker Robotic Arm Controller with GUI Robotic Car Traction Control Safety-sensor vehicle Security Entrance System Self-Powered Solar Data Logger Snake Arm Ultrasonic Positioning Control System Store FFh if 1 Super Train Controller TI MSP430 Microcontrollers Timers on the MSP430 TouchPad Drawing Board Ultra-Sonic Parking Assistant Ultrasonic Parking Controller Ultrasonic Range finder Voice Activated Alarm Clock Voice Recognition Robotic Car Voting Machine Weather Station Web-Monitored Thermostat Wireless Drawing Device Wireless Telemetry Wireless message Communicator Write a C program to display the code of the key pressed in 8051 Zigbee Wireless Relay Control and Power Monitoring System add two multibyte numbers in 8051 convert a decimal number to hex number in 8051 convert an 8bit Hex number to decimal number in 8051 convert hex number to ASCII number in 8051 eZ430-F2013 Development Tool use SD16_A ADC eZ430-RF2500 Development Tool use ADC10 else store 00 in the same location in 8051 find the GCF of two numbers in 8051 find the average of 10 numbers in 8051 generate Fibonacci series in 8051 metal detector project microcontroller using IAR Embedded Workbench program for Elevator Interface in 8051 program for Stepper motor interface in 8051 spectrum analyser square wave in 8051 triangle wave in 8051 voice recognition security system

Sites U missed

Hint

Open Pictures in new page by right click on it, if it is not shown full image.