DOWNLOAD FILE IS AVAILABLE AT END OF THE POST
DESCRIPTION
this prototype makes use of the 20pin At89c2051 microcontroller. This home security system burnt a program inside the microcontroller to perform the following capabilities.
The user is required to enter 5 digit pin to activate or deactivate the door lock security. The “ # ” serves as an enter key and The backspace by pressing “ * ” is implemented so that when the user enters a wrong password, these keys can be used to delete the previously entered pin. Windows and doors are monitored by the laser beam and magnetic door sensor. If the beam and the magnetic door sensor get interrupted for a possible break-in, hence an alarm will sound and an array of light will blink.
This project is capable of light-sensing using a Light-dependent resistor (LDR) and uses digital input-output logic and analog information process. The LDR is attached to a voltage divider circuitry. By using Kirchhoff’s law the voltage obtained and which we can use to measure the level of light. As result, the system will automatically trigger the lights on during the night and off during the daytime.
I.
Introduction
1.1 Background of the Study
The home security system is the best burglar deterrent you can have. Many people don't
think about security at home until it is too late and they have become victims.
The prime concern of this project is to provide total security. This
microcontroller based home security with password door lock system feature can
also perform day and night detection, laser beam monitoring system for windows,
and magnetic monitoring for doors. Aside from providing total security, this
project aims to utilize homemade circuitry and build a low cost integrated
home security system.
The system includes an alarm system. Hence the security system will sound an alert
when there is an attempt at a break-in. The system is digital. It also
incorporated a 7 segment display with a 4x3 keypad.
1.2 Statement of the Problem
Commercial the available security system is too expensive. Thus, this project aims to develop
the same functionality with affordability and accuracy in terms of security
monitoring.
1.3 Objectives of The Study
1.2.1 General
Objective
The
proponents aim to implement the following:
·
To provide total security
in-home environment as well as the business environment
·
To reduce the burglary rate.
·
To develop homemade and low
cost security system
1.3
Scope,
Limitations and recommendations
This project incorporates the use of 8051 a microcontroller as a central processing unit. Specifically, the prototype makes use of the
20pin At89c2051 microcontroller. This home security system burnt a program
inside the microcontroller to perform the following capabilities.
The user is required to enter 5 digit pin
to activate or deactivate the door lock security. The “ # ” serves as an enter key
and The backspace by pressing “ * ” is implemented so that when the user
enters a wrong password, these keys can be used to delete the previously entered
pin. Windows and doors are monitored by the laser beam and magnetic door sensor. If
the beam and the magnetic door sensor get interrupted for a possible break-in,
hence an alarm will sound and an array of light will blink.
This project is capable of light-sensing
using a Light-dependent resistor (LDR) and uses digital input-output logic and
analog information process. The LDR is attached to a voltage divider circuitry.
By using Kirchhoff’s law the voltage obtained and which we can use to measure
the level of light. As result, the system will automatically trigger the lights
on during the night and off during day time.
Some modifications, enhancements and
additions must be made to the prototype home security system to
develop it into a general security system that would enhance its ultimate
impact. The 7segment display must be replaced with an LCD to have a custom
display and some additional sensors must be added like fire/smoke detector and
biometric scanner.
The password system of this project is fixed and the user cannot create a custom password. A little modification to this system will do. These include such necessary modifications as providing backup power to the system and auto reset function in case of power failure.
2
Research
and Methodology
The
researchers gathered information from different sources that give appropriate
ideas or what parts to be used in every circuitry involved in this project.
Keypad interfacing to the microcontroller using embedded C was the hardest part
ever encountered during the development stage. From a step by step process,
researchers started from writing simple code to more complex. After everything
is fixed and tested in a virtual simulation, the researchers soldered everything
for the implementation stage. Researchers faced many problems on hardware such as fine-tuning every sensor to work simultaneously with the burnt program inside the microcontroller.
By eliminating those problems gives a good and accurate anticipated result.
CIRCUIT DIAGRAM
CODE OF MCU1
#include <AT892051.H>
sbit laser = P3^7;
void delay(int k)
{
int i;
TR0=0;
for(i=0; i<k; i++)
{
TH0=0x3c;
TL0=0xb0;
TF0=0;
TR0=1;
while (TF0==0);
TR0=0;
}
}
void main()
{
char v,d,z=0;
P1=0x3f;
P3=0x00;
while(1)
{
switch(P1)
{
case 25: P3=0x01; //day monitoring mode
v=0;
delay(90);
break;
case 27: P3=0x0c;
delay(60);
P3=0x08;
delay(60);
break;
break;
case 31: P3=0x0e;
delay(60); // 3 seconds
P3=0x08;
delay(60); // 3 seconds
P3=0x0a;
delay(60); // 3 seconds
P3=0x0c;
delay(60); // 3 seconds
break;
case 17: P3=0x0c;
delay(6000); // 5 minutes
break;
case 21: P3=0x0e;
delay(6000); // 5 minutes
break;
case 29: P3=0x07; //night monitoring mode
v=0;
break;
case 45: P3=0x07;
delay(40);
v=1;
break;
case 41: P3=0x05;
v=1;
break;
break;
case 37: P3=0x07;
break;
case 11: P3=0x0c;
delay(60);
P3=0x08;
delay(60);
break;
case 15: P3=0x0e;
delay(60); // 3 seconds
P3=0x08;
delay(60); // 3 seconds
P3=0x0a;
delay(60); // 3 seconds
P3=0x0c;
delay(60); // 3 seconds
break;
case 9: if(v==1)
P3=0x05;
else
{
for(d=0; d<70; d++)
{
P3=0x0e;
delay(60); // 3 seconds
P3=0x08;
delay(60); // 3 seconds
P3=0x0a;
delay(60); // 3 seconds
P3=0x0c;
delay(60); // 3 seconds
}
}
break;
case 57: v=1;
break;
case 13: if(v==1)
P3=0x07;
else
{
for(d=0; d<70; d++)
{
P3=0x0e;
delay(60); // 3 seconds
P3=0x08;
delay(60); // 3 seconds
P3=0x0a;
delay(60); // 3 seconds
P3=0x0c;
delay(60); // 3 seconds
}
}
break;
case 61: P3=0x07;
v=1;
delay(90);
default: v=0;
P3=0x00; // enable/disable security system Manualy
laser=1;
}
}
}
CODE OF MCU2
#include <REG51.h>
#define display P3
#define KEYPAD P1
sbit doorclose = P1^7;
sbit correct = P3^5;
sbit wrong= P3^4;
sbit key = P3^7;
void DelayMs(unsigned int);
void save (unsigned char);
void compare (void);
unsigned char keypad[4][3]= { '1', '2', '3',
'4', '5', '6',
'7', '8', '9',
'*', '0', '#'};
unsigned char displayb[4][3]= { 1 , 2 , 3 ,
4 , 5 , 6 ,
7 , 8 , 9 ,
0, 0 , 0};
unsigned char code password[5]= "12345";
unsigned char user[30]; //user is allowed to press 30 keys without entering
unsigned char q,a=0,z=0;
char t=1;
bit true;
char d;
void main(void)
{
unsigned char colloc,rowloc;
while(1)
{
do
{
KEYPAD=0xF0;
colloc=KEYPAD & 0xF0;
}
while(colloc ==0xF0); // if any key pressed
DelayMs(1); // some delay
do
{
colloc=KEYPAD;
colloc &=0xF0;
}while(colloc==0xF0); // to verify is really key pressed
KEYPAD=0xFE;
colloc=KEYPAD & 0xF0;
if(colloc !=0xF0)
{
rowloc=0;
goto next;
}
KEYPAD=0xFD;
colloc=KEYPAD & 0xF0;
if(colloc !=0xF0)
{
rowloc=1;
goto next;
}
KEYPAD=0xFB;
colloc=KEYPAD & 0xF0;
if(colloc !=0xF0)
{
rowloc=2;
goto next;
}
KEYPAD=0xF7;
colloc=KEYPAD & 0xF0;
rowloc=3;
goto next;
next:
if (colloc==0xE0)
{
key=0; // verifying that key is pressed
DelayMs(145);
key=1;
display=((display & 0xf0) | (displayb[rowloc][0])); // display to 7 seg
save(keypad[rowloc][0]);
}
else if(colloc==0xD0)
{
key=0; // verifying that key is pressed
DelayMs(145);
key=1;
display=((display & 0xf0) | (displayb[rowloc][1]));
save(keypad[rowloc][1]);
}
else if(colloc==0xb0)
{
key=0; // verifying that key is pressed
DelayMs(145);
key=1;
display=((display & 0xf0) | (displayb[rowloc][2]));
save(keypad[rowloc][2]);
}
DelayMs(100); // here this delay is important if this is less than 100ms then
// controller understand 1 key as press 2 or 3 times becoz that
//is fast as compaer o our pressing if u want to remove delay from here
// then increse the above 1ms to 100 ms
}
}
void save (unsigned char c)
{
if(c=='*')
{
if(a!=0)
a--;
return;
}
if(a==5 && c=='#')
{
a=0;
compare();
if(t==1)
{
if(true==1) // if match ok
{
DelayMs(800);
correct=0;
t=2;
for(d=0; d<7; d++) // on and after 10 sec off nw keypad can't get data
DelayMs(1000); // max delay u can get is DelayMs(65535) otherwise need looping for big delay
correct=1;
z=0;
a=0; // start agian from 0 location of array
}
else if(true==0)
goto error;
}
else if(t==2)
{
DelayMs(800);
doorclose=0;
t=1;
for(d=0; d<5; d++)
DelayMs(1000);
doorclose=1;
}
}
else if((a>5 && c=='#') || (a<5 && c=='#'))
{
error:
for(q=0; q<5; q++)
{
wrong=0;
DelayMs(420);
wrong=1;
DelayMs(420);
a=0;
}
z=z+1;
if(z==4)
{
for(q=0; q<10; q++)
{
wrong=0;
DelayMs(20000);
wrong=1;
z=0;
DelayMs(420);
}
}
a=0;
}
else
{
user[a]=c;
a++;
if(a==30) // if the user press 31 keys without entering it will automatically indicate an error
{
display=((display & 0xf0) | (displayb[3][1])); //brings a zero display on the seven segment
goto error; //redirect to error code
}
}
} //end of save
void compare (void)
{
unsigned char b;
for(b=0;b<5;b++)
{
if(user[b]==password[b])
true=1;
else
{
true=0;
break;
}
}
}
//---------------------------------------
// Delay mS function
//---------------------------------------
void DelayMs(unsigned int count)
{ // mSec Delay 11.0592 Mhz
unsigned int i;
while(count) {
i = 115;
while(i>0) i--;
count--;
}
}
DOWNLOAD PROJECT REPORT WITH PROTEUS AND CODE FILES:
Post a Comment