Keypad Security System

Team Members: Kat Copeland, Corey Zhou

Purpose/Goal: Our project will be to implement a security system via a keypad in order to enter a room. The setup is outside of a room you will have a keypad with an LCD screen next to it. On the inside of the room, there is a infrared emitter and receiver that are directly across each other (the receiver is receiving infrared light) and a buzzer next to those. An alternative to the emitter and receiver is a motion sensor. You must enter the correct code in order to enter the room. If the correct code is inputted, then you have 10 seconds to enter the room without any alarms going off. If you do not enter the correct code, or don't enter a code at all, then once the receiver stops receiving (ie, you walk in between the sensors) a buzzer will sound. The buzzer can only be turned off if you go back and put the correct code in. Another addition to this is to use the HC-05 Bluetooth sensor so that those in the vicinity will receive an update that the wire was tripped.

Responsibility list:

  • Parts are already purchased

  • Coding for motion sensor to set off buzzer when wire is "tripped" (Corey)

  • Coding for keypad to show up on the LCD screen (Kat)

  • Coding for Bluetooth (referring to lab 3) (Corey)

  • Coding for Keypad to turn off alarm if alarm had already been tripped (Kat)

Software Structure:

  • Initialize all the pins to receive/give information from our peripherals

  • Program interrupts for the keypad and the sensor

Week 6 Original idea for project


Week 8 modification for project

  • Using I2C LCD in order to see code that is being entered into keypad

Week 9 modification for project

  • Using Gyroscope in order to detect motion (will be attatching to door)

  • Not using I2C LCD due to lack of pins

Week 10 modification for project

  • Not using motion sensor since it doesn't serve a purpose after adding in Gyroscope

Final Summary

We used the gyroscope that was attatched to the discovery board and used that as a sense of motion for opening the door. Someone using our "product" would attatch the discovery board, buzzer and bluetooth (attatched to a breadboard) to the inside of the door (in your home). The keypad would ideally be routed through the door and attatched to the front of the door (outside). There are two cases that can occur:

  • You enter in the correct code:

        • When you enter the correct code in and press the "*" key, this will officially record your code. When you open the door, nothing will happen (no alarms will go off).

  • You do not enter in the correct code:

        • When you enter in an incorrect code, opening the door will set off the gyroscope motion, and the buzzer will sound. You can still enter in the correct code and it will turn off the buzzer.

Our final video shows these cases.

One thing that we would have done to improve this project is including an LCD next to the keypad so you can see what you are entering in for the code. "#" on the keypad resets the code so if you saw that you entered in the wrong number through the LCD, you could press "#" to restart. We tried using interrupts with the keypad, but the keypad generates multiple rising edges, which was difficult to work with. Columns need to be manually set high and pushing a button connects the column from the row (completing the circuit). The only way to see which column is the one pressed is to turn them off one by one, but you have to turn the columns back on at the end of the interrupts, causing another rising edge. We weren't sure how to get around this, so we used polling instead for the keypad.