Maxim Dumitru-Bogdan
The purpose of this project is to develop a simple home security system that can give homeowners peace of mind
The goal of this project is to design a home security system that can protect households from intruders. The system utilizes a keypad, a buzzer, and a motion sensor to authenticate users' access. The primary objective is to allow access only to those individuals who enter the correct password. If an incorrect password is entered, the system sounds an alarm, alerting the homeowner to a possible breach. Additionally, if the motion sensor detects any movement before the correct password is entered, the system will also sound an alarm, ensuring that any unauthorized access attempt is met with a response.
Components:
For the below diagram red cables represent connections to 5V power supply (VCC), black cables represent connections to the ground (GND), the purple cable represents the connection between the PIR sensor output and Arduino digital pin, the green cables represent connections between the LCD and the micro-controller, the blue cables represent connections between the keypad and the Arduino UNO, it can be noticed that column 4 of the keypad is not connected to any pin this is because the physical keypad that I acquired is 4 by 3 and I'm just using a 4*4 in the diagram as a place holder.
Pin Configuration:
PIR motion sensor:
VCC to 5V pin GND to GND pin OUT to digital pin 2
Keypad:
ROW1 to digital pin 7 ROW2 to digital pin 6 ROW3 to digital pin 5 ROW4 to digital pin 4 COL1 to digital pin 3 COL2 to digital pin 9 COL3 to digital pin 8
LCD:
VCC to 5V pin GND to GND pin SDA to analog pin 4 SCL to analog pin 5
Buzzer:
Positive pin to digital pin 10 Negative pin to GND pin
Description: After pressing enter, the input will be checked against a pre-set password. The Arduino code will read input from the keypad and show the input on the LCD screen. Upon entering a valid password, the LCD screen will display a positive message (example: “Password Correct”) and turn off the system. A negative message (ex: “Wrong Password / Error”) will appear on the LCD screen if the password is entered incorrectly, and the system will then sound an alarm using the buzzer. If the PIR sensor picks up any movement before the proper password is entered, the code will also sound an alarm through the buzzer.
The system starts with a predefined 4-digit password from the code. Upon starting the system the user will be able to interact with it in the following way:
2) The LCD will display “Enter password:” as a prompt.
3) Use the keypad to enter the password. Each key press will be displayed on the LCD in a line, one after the other, without replacing each other.
4) Press the '#' key on the keypad to submit the entered password.
5) If the entered password is correct, the LCD will display “Access granted” and prompt the user to press the * key to restart the system. Upon pressing, the LCD will display “Restarting system” for 2 seconds and then the system will restart.
6) If the entered password is incorrect, the LCD will display “Wrong password” for 3 seconds, sound an alarm through the buzzer, and prompt the user to enter the password again (please note that the prompt to enter the password again is for testing purposes in real-world use the code can easily be adjusted to allow only for a certain number of mistakes).
The system also makes use of a PIR motion sensor in the following way. After entering a wrong password there is a 10 seconds period in which the message “Scanning for intruders” is displayed on the LCD, if in this period motion is detected the LCD switches to display “Motion Detected” and an alarm is sounded through the buzzer.
Images:
At Startup:
Displaying entered password:
After Entering the correct password:
After pressing * to restart:
After entering a wrong password:
Upon initiating the motion detection code:
If motion is detected:
This password-protected system offers a trustworthy and adaptable security solution. The system performs password verification, alarm triggering, and system restarting by integrating input devices, output devices, and programming logic. It provides a versatile framework for adding new sensors or functions, accommodating upgrades like biometric verification. The system offers a scalable solution for various security requirements because of its affordability, and user-friendly interface.
The experience of working on this project has proven to be really fulfilling and has given me the chance to actively pursue knowledge gain.
The code for the Arduino along with the datasheets and the I2C scanner code used can be found in the following .zip: project_ma.rar
https://playground.arduino.cc/Main/I2cScanner/
https://github.com/johnrickman/LiquidCrystal_I2C/tree/master/examples
https://www.arduinolibraries.info/libraries/liquid-crystal-i2-c
https://arduinogetstarted.com/tutorials/arduino-lcd-i2c
https://playground.arduino.cc/Code/Keypad/
https://github.com/Chris--A/Keypad