Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

21311A04R9,22315A0420

Password based doorlock system in 8051


microprocessor

ABSTRACT:
Safety is the most crucial concern of human. We always try to keep our things
between ourselves. For this reason, we still use various methods to lock our precious
items like a locked diary. And when it comes to our daily life, we are more serious.
In the modern age, there are so many ways to lock the door; one of them is password-
based lock system—a system where you are the only one to know how to access it.
It saves our daily life from the various malicious problem like a thief. This system
will give us the security that we want. To make our life more secure, we are going
to build the password-based door lock system. This system is easy to assemble and
very easy to use in our daily life. Anyone can use it to secure themselves.

AIM:
The aim of the project is to perform Password based doorlock system in 8051
microprocessor.

THEORY:
The Digital Door Lock in general is a password-based electronic code lock.
In this project, we have designed the digital door lock using an 8051 microcontroller,
a keypad, and a 12-volt dc relay. In this article, we have designed a simple digital
door lock using 8051 -which can be used as a security checking system to limit
access to an area/room only for certain individuals with the password. So our digital

1
21311A04R9,22315A0420

door lock project can be called with a very wide range of names like a digital
combination lock using 8051 or a digital security code lock using 8051
microcontrollers or a password security system using 8051 or an electronic code lock
or a digital code lock using 8051. People call this kind of a “security system” with
different names, though all of them mean to build a basic password-based security
system using a microcontroller like 8051 or AVR or PIC or Arduino (a controller of
choice) with extra features like automatic door lock/opening facility, sound alarm,
GSM based SMS alert, etc.

SOFTWARE REQUIREMENTS:

• Proteus (for circuit diagram and simulation)

• Keil uVision5 IDE (for c code)

Hardware requirements:

• 8051 microcontroller (80C51)

• Phone keypad

• LCD – LM016L

• DC Motor (re-present as a door-lock motor)

BLOCK DIAGRAM:
2
21311A04R9,22315A0420

WORKING PRINCIPLE:
1. The main component in the circuit is 8051 microcontrollers. This control
everything in the device.
2. We connect the 4x3 keypad with the microcontroller. In the keypad there is 4
rows which is indicated the letters (A-D) and the 3 columns which is indicated
the number (1-3).
3. In the 8051 controller, pin P2.0 to P2.3 are connected to the keypad rows and
pin P3.0 to P3.2 are connected to the keypad columns.
4. Then we connect the door lock motor pins in the P3.3 and P3.4. This motor
only work when the password is right.
5. LCD’s points are connected with P3.5 to P3.7 in 8051. LCD help us to show
the inputs and error messages.

3
21311A04R9,22315A0420

6. All devices are connected with each other. In the simulation we use the hex
code to run the program. The hex code is generated from the embedded C
code. This code only works on any 8051-microcontroller system.
7. To run the simulation, we set the clock frequency at 11.0592 MHZ for 8051.
This is allowed us to run the simulation without getting any errors.
8. We pre-define the password 12345 for the program.
9. If user input wrong password it will give another chance to input the password
again with an error message. When the password is right it will show the
welcome message and lock motor will move to open the door.

CODE:
#include<reg51.h> void display(char *lcd)

#include<string.h> {while(*lcd != '\0')

sbit RS = P3^0; {

sbit EN = P3^1; dat(*lcd);

sbit IN1 =P3^2; lcd++;

sbit IN2 = P3^3; }

void delay(int a) }

{ void lcdint()

int i,j; { cmd(0x01);

for(i=0;i<a;i++) cmd(0x38);

for(j=0;j<255;j++); cmd(0x0E);

} cmd(0x80);

4
21311A04R9,22315A0420

void cmd(char cm) }

{ void main()

P2 = cm; { char pass[5] = "5678";

RS = 0; char pass2[5];

EN = 1; int i=0;

delay(1); char *ptr;

EN = 0;} ptr = pass2;lcdint();

display("Password-"); else if(P1==0xBE)

pass2[4]='\0'; {

*(ptr+i)='9';

while(1) dat('9');

{ delay(200);

while(i<4) cmd(0x06);

{ i++;

P1=0xFE; }

if(P1==0xEE) else if(P1==0x7E)

{ {

*(ptr+i)='7'; *(ptr+i)='/';

dat('7'); dat('/');

delay(200); delay(200);

cmd(0x06); cmd(0x06);

5
21311A04R9,22315A0420

i++;

i++; }

P1=0xFD;

} if(P1==0xED)

else if(P1==0xDE) {

{ *(ptr+i)='4';

*(ptr+i)='8'; dat('4');

dat('8'); delay(200);

delay(200); cmd(0x06);

cmd(0x06);i++;} i++;}

else if(P1==0xDD) P1=0xFB;

{ if(P1==0xEB)

*(ptr+i)='5'; {

dat('5'); *(ptr+i)='1';

delay(200); dat('1');

cmd(0x06); delay(200);

cmd(0x06);

i++; i++;

} }

else if(P1==0xBD) else if(P1==0xDB)

{ {

6
21311A04R9,22315A0420

*(ptr+i)='6'; *(ptr+i)='2';

dat('6'); dat('2');

delay(200); delay(200);

cmd(0x06); cmd(0x06);

i++; i++;

} }

else if (P1==0x7D) else if(P1==0xBB)

{ {

*(ptr+i)='*'; *(ptr+i)='3';

dat('*'); dat('3');

delay(200); delay(200);

cmd(0x06); cmd(0x06);

i++;} i++;}

else if(P1==0x7B) else if(P1==0xB7)

{ {

*(ptr+i)='-'; *(ptr+i)='=';

dat('-'); dat('=');

delay(200); delay(200);

cmd(0x06); cmd(0x06);

i++;

i++; }

7
21311A04R9,22315A0420

} else if(P1==0x77)

P1=0xF7; {

if(P1==0xE7) *(ptr+i)='+';

{ dat('+');

*(ptr+i)='C'; delay(200);

dat('C'); cmd(0x06);

delay(200); i++;

cmd(0x06); }

i++; }

} while(i==4)

else if(P1==0xD7) {

{*(ptr+i)='0'; if ((strcmp(pass, pass2)) == 0)

dat('0'); {

delay(200); cmd(0xC0);

cmd(0x06); display("Correct");

i++; IN1 = 1;IN2 = 0;

delay(100);

else

8
21311A04R9,22315A0420

cmd(0xC0);

display(" wrong password");

IN1 = 0;

IN2 = 0;

delay(100);

CIRCUIT DIAGRAM:

9
21311A04R9,22315A0420

APPLICATIONS:
The password-based lock system can install any door of any rooms. This system also
can be integrated with the existing system. This electric combination lock system
uses a five-digit password. The system collects five-digit user input and compares
the user input with the preset password inside the program. If the password matches,
access will be granted, and if not match the entry will be denied. The system can be
used at residential places to ensure better safety. It can be used at organizations to
ensure authorized access to highly secured places.

CONCLUSION:
So that’s all about the Password-based Security System using 8051. If you would
like to learn more interesting and similar projects like this electronic password
lock,here are some:

RFID-based security system using 8051

Digital code lock advanced using arduino

10
21311A04R9,22315A0420

RESULTS:

REFERENCES:
• GitHub - kmhmubin/Password-based-doorlock-system-in-8051-
microprocessor: Password-based door lock system using 8051/PIC
microcontroller
• Password Based Door Lock System using 8051 Microcontroller
(electronicshub.org)
• Digital Door Lock-Password Security Code Lock using 8051
(circuitstoday.com)

11

You might also like