You are on page 1of 26

A

MINOR PROJECT REPORT

ON THE TOPIC
“PASSWORD BASED DOOR LOCK SYSTEM”

Submitted for partial fulfillment of requirement of

degree of bachelor of technology in

ELECTRICAL AND ELECTRONICS ENGINEERING

Submitted To– Submitted By-


Mr. Himanshu Tripathi Amisha
Assistant professor 1503021008

DEPARTMENT OF ELECTRICAL AND ELECTRONICS

INDERPRASTHA ENGINEERING COLLEGE, GHAZIABAD

2017-2018
Password Based Door Lock System

CERTIFICATE

This is to certify that AMISHA of B.tech 6th semester, Electronics and Electrical

Engineering has done a minor project on PASSWORD BASED DOOR LOCK


SYSTEM and submitted for the partial fulfilment for requirement of degree of
Bachelor of Technology .

Mr. Himanshu Tripathi Dr. Rambir Singh

(MP Guide) (HOD – EN

Inderprastha Engineering College Page 2


DECLARATION

I hereby declare that the project report entitled “PASSWORD BASED DOOR LOCK SYSTEM”
submitted to ELECTRICAL AND ELECTRONICS DEPARTMENT, INDERPRASTHA
ENGINEERING COLLEGE, SAHIBABAD, GHAZIABAD is prepared by me under the
supervision of Mr. Himanshu Tripathi (Assistant Professor). I solemnly declare that to the best of
my knowledge and belief, it contains no material previously published or written by another
person nor material which to a substantial extent has been accepted for the award of any other
degree of the university or other institute of higher learning, except where due acknowledgement
has been made in the text.

IPEC Signature of student


Amisha
Date:- 4 May 2018 (1503021008)
Password Based Door Lock System

ACKNOWLEDGEMENT

It is a pleasant task to express our gratitude to all those people who have
accompanied and helped us in our project work. First and foremost, we thank
Prof. Rambir Singh, HOD, Department of Electrical & Electronics Engineering,
Inderprastha Engineering College, Ghaziabad, APJ Abdul Kalam Technical
University, Lucknow to give us opportunity to carry out this project.

We express our deep sense of gratitude to our guide, Assistant Prof. Himanshu
Tripathi, for his invaluable guidance, suggestions and encouragement throughout
the project, which helped us a lot to improve this project work. It has been very
nice to be under his guidance. His appreciation during the good times has been
boosting our morals and confidence. Last, but not the least, we would like to
thank our batch-mates and seniors, who helped us directly or indirectly in this
work.

Inderprastha Engineering College Page 4


Password Based Door Lock System

PASSWORD BASED DOOR LOCK SYSTEM

Password Based Door Lock System using 8051 Microcontroller is a simple project where a secure
password will act as a door unlocking system. Traditional lock systems using mechanical lock and
key mechanism are being replaced by new advanced techniques of locking system. These
techniques are an integration of mechanical and electronic devices and are highly intelligent. One
of the prominent features of these innovative lock systems is their simplicity and high efficiency.

Such an automatic lock system consists of electronic control assembly, which controls the output
load through a password. This output load can be a motor or a lamp or any other
mechanical/electrical load.

Here, we developed an electronic code lock system using 8051 microcontroller (a Password based
Door Lock System using 8051 Microcontroller), which provides control to the actuating the load.
It is a simple embedded system with input from the keyboard and the output being actuated
accordingly.

This system demonstrates a Password based Door Lock System using 8051 Microcontroller,
wherein once the correct code or password is entered, the door is opened and the concerned person
is allowed access to the secured area. Again, if another person arrives, it will ask to enter the
password. If the password is wrong, then door would remain closed, denying access to the person.

Inderprastha Engineering College Page 5


Password Based Door Lock System

Keypad

A keypad is a set of buttons arranged in a block which bear digits, symbols or alphabetical letters
placed in order on a pad, which can be used as an efficient input device. Pads mostly containing
numbers are called a numeric keypad. Numeric keypads are found on alphanumeric
keyboards and on other devices which require mainly numeric input such as calculators, push-
button telephones, vending machines, ATMs, Point of Sale devices, combination locks, and digital
door locks.

Buzzer

A buzzer or beeper is an audio signaling device, which may be mechanical, electromechanical,


or piezoelectric (piezo for short). Typical uses of buzzers and beepers include alarm
devices, timers, and confirmation of user input such as a mouse click or keystroke.

Microcontroller

A microcontroller is a compact integrated circuit designed to govern a specific operation in an


embedded system. A typical microcontroller includes a processor, memory and input/output (I/O)
peripherals on a single chip.

Inderprastha Engineering College Page 6


Password Based Door Lock System

PIN Diagram of 8051 microcontroller

8051 microcontroller is used in this project with 8-bit memory. The architecture of 8051
microcontroller is based on the Harvard architecture. With a Harvard architecture, the data bus and
instruction are separate, allowing for simultaneous transfers.

The 8051 Microcontroller has two buses and two memory spaces of 64K X 8 size for program
and data units. It has an 8 bit processing unit and 8 bit accumulator units.

8051 Microcontroller Architecture

A 8051 Microcontroller consistsof-


Central Processor Unit (CPU)

Inderprastha Engineering College Page 7


Password Based Door Lock System

As we know that the CPU is the brain of any processing device of the microcontroller. It monitors
and controls all operations that are performed on the Microcontroller units. The User has no
control over the work of the CPU directly. It reads program written in ROM memory and executes
them and do the expected task of that application.

Interrupts

Interrupt is a subroutine call that interrupts of the microcontrollers main operations or work and
causes it to execute any other program, which is more important at the time of operation. An
Interrupts gives us a mechanism to put on hold the ongoing operations, execute a subroutine and
then again resumes to another type of operations.

The Microcontroller 8051 can be configured in such a way that it temporarily terminates or pause
the main program at the occurrence of interrupts. When a subroutine is completed, then the
execution of main program starts. Generally five interrupt sources are there in 8051
Microcontroller. There are 5 vectored interrupts are shown in below-

INTO

TFO

INT1

TF1

R1/T1

Out of these, (INT0) ̅ and (INT1) ̅ are external interrupts that could be negative edge triggered or
low level triggered. When All these interrupts are activated, set the corresponding flogs except for
serial interrupt. The interrupt flags are cleared when the processor branches to the interrupt service
routine (ISR). The external interrupt flags are cleared when the processor branches to the interrupt
service routine, provides the interrupt is a negative edge triggered whereas the timers and serial
port interrupts two of them are external interrupts, two of them are timer interrupts and one serial
port interrupt terminal in general.

Memory

Microcontroller requires a program which is a collection of instructions. This program tells


microcontroller to do specific tasks. These programs require a memory on which these can be
saved and read by Microcontroller to perform specific operations of a particular task. The memory
which is used to store the program of the microcontroller is known as code memory or Program
memory of applications. It is known as ROM memory of microcontroller also requires a memory
to store data or operands temporarily of the micro controller. The data memory of the 8051 is used
to store data temporarily for operation is known RAM memory. 8051 microcontroller has 4K of
code memory or program memory, it has 4KB ROM and also 128 bytes of data memory of RAM.

BUS
Basically Bus is a collection of wires which work as a communication channel or medium for
transfer of Data. These bus consists of 8, 16 or more wires of the microcontroller. Thus, these can
carry 8 bits, 16 bits simultaneously. Here two types of buses that are shown in below-

Address Bus

Inderprastha Engineering College Page 8


Password Based Door Lock System

Data Bus

Address Bus

Microcontroller 8051 has a 16 bit address bus for transferring the data. It is used to address
memory locations and to transfer the address from CPU to Memory of the microcontroller. It
has four addressing modes that are-

Immediate addressing modes.

Bank address (or) Register addressing mode.

Direct Addressing mode.

Register indirect addressing mode.

Data Bus

Microcontroller 8051 has 8 bits of the data bus, which is used to carry data of particular
applications.

Oscillator

Generally, we know that the microcontroller is a device, therefore it requires clock pulses for its
operation of microcontroller applications. For this purpose, microcontroller 8051 has an on-chip
oscillator which works as a clock source for Central Processing Unit of the microcontroller. The
output pulses of oscillator are stable. Therefore, it enables synchronized work of all parts of the
8051 Microcontroller.

Input/Output Port

Normally microcontroller is used in embedded systems to control the operation of machines in the
microcontroller. Therefore, to connect it to other machines, devices or peripherals we require I/O
interfacing ports in the microcontroller interface. For this purpose microcontroller 8051 has 4
input, output ports to connect it to the other peripherals

Timers/Counters

8051 microcontroller has two 16 bit timers and counters. These counters are again divided into a 8
bit register. The timers are used for measurement of intervals to determine the pulse width of
pulses.

LCD

LCD has materials which joins together the properties of both liquid and crystals. They have a
temperature range within the particles.
LCD are much more informative output device than a single LED. LCDs are specially designed
for specific applications to display graphic images. 16*2 LCD module is commonly used. For an
8-bit data bus, the display requires a +5V supply plus 11 I/O lines.

The three control lines are referred to as EN, RS, RW.

Inderprastha Engineering College Page 9


Password Based Door Lock System

1. The EN(Enable) control line is used to send the data to the LCD. A high to low transition
at this pin will enable the module.
2. When RS or Register Select is low, the data is to be treated as a command instruction.
When RS is high, the data being sent is displayed on the screen. For the instance, to
display any character on the screen, we set RS high.
3. When RW or Read/Write control line is low, the information on the data bus is being
written to the LCD. When RW is high, the program is effectively reading the LCD. RW
line will always be low.

16*2LCD
The data bus consists of 4 or 8 lines; it depends on the mode of operation selected by the user. The
lines of an 8-bit data bus are referred to as DB0, DB1, DB2, DB3, DB4, DB5, DB6, DB7.

Motor Drive

L293D is a typical Motor Driver IC which allows DC to drive on either direction. L293D is a 16-
pin IC which can control a set of two DC motors simultaneouly in any direction.

PIN Diagram of L293D Motor Driver IC

Inderprastha Engineering College Page 10


Password Based Door Lock System

Stepper Motor

Stepper motors are DC motors that move in discrete steps. They have multiple coils that are
organized in groups called "phases". By energizing each phase in sequence, the motor will
rotate, one step at a time.

Advantages-

Positioning – Since steppers move in precise repeatable steps, they excel in


applications requiring precise positioning such as 3D printers, CNC, Camera platforms
and X-Y Plotters. Some disk drives also use stepper motors to position the read/write
head.

Speed Control – Precise increments of movement also allow for excellent control of
rotational speed for process automation and robotics.

Low Speed Torque - Normal DC motors don't have very much torque at low speeds.
A Stepper motor has maximum torque at low speeds, so they are a good choice for
applications requiring low speed with high precision.

Limitations-
Low Efficiency – Unlike DC motors, stepper motor current consumption is
independent of load. They draw the most current when they are doing no work at all.
Because of this, they tend to run hot.

Limited High Speed Torque - In general, stepper motors have less torque at high
speeds than at low speeds. Some steppers are optimized for better high -speed
performance, but they need to be paired with an appropriate driver to achieve that
performance.

No Feedback – Unlike servo motors, most steppers do not have integral feedback for
position. Although great precision can be achieved running ‘open loop’. Limit
switches or ‘home’ detectors are typically required for safety and/or to establish a
reference position.

Inderprastha Engineering College Page 11


Password Based Door Lock System

Circuit Diagram Of Project

The circuit diagram of Password based Door Lock System has been shown. The circuit of Project
shows the connections between LCD, Keypad, Motor Drive and 8051 microcontroler.

Inderprastha Engineering College Page 12


Password Based Door Lock System

Conclusion

The password based door lock performed as expected. The project is able to open the door
successfully using the password keypad. The biggest hurdle in the project was to interface the
microcontroller with the hardware components. The project Password Based Door Lock System is
easy to use, comparatively inexpensive and highly reliable. The correct code must be entered in
order for the lock to deactivate. Combination lengths are usually between 4 and 6 digits long. This
door lock project using microcontroller can be enhanced by incorporating new means of
authentication. The users are to require them to link the system with some of their verified
identity. As linking phone numbers, email Ids are more prominent as a recognized means of
positive identification, their use in security systems increases. For more security purposes,
cameras can be most favorable option to detect the person’s identity whenever the wrong
password is inserted.

Future Scope

Future prospect of every project is dependent on variety of implementation. Modern age is about
of security of everything, from software security to our own room also. This project is about the
password protected door locking system, which actually helps to avoid the unnecessary people
whom we do not want and the programmable password system gives the promise of more secure
system, as it can be changed to keep it private.
This system can be implemented to protect bank locker, private room, meeting room in office,
data storage room and also in private car.

Annexure A

Code

main.c

#include<reg51.h>

#include"delay.h"

#include"lcd.h"

#include"keypad.h"

/******************

motor PIN

******************/

sbit a1 = P2^0;

Inderprastha Engineering College Page 13


Password Based Door Lock System

sbit a2 = P2^1;

void motor();

unsigned char ar[5];

unsigned char com[5]={"77777"};

unsigned int f,m=1,p;

/******************

main program

******************/

void main()

unsigned int i;

lcd_ini();

while(1)

cmd(0x01);

lcd_str(" ENTER YOUR");

cmd(0xc0);

lcd_str("PASSWORD");\

for(i=0;i<5;i++)

keypad1();

ar[i]=c;

if(i==0)

cmd(0x01);

lcd_display(' ');

Inderprastha Engineering College Page 14


Password Based Door Lock System

lcd_display('*');

//compare();

if(ar[0]==com[0] && ar[1]==com[1] && ar[2]==com[2] && ar[3]==com[3] && ar[4]==com[4])

m=1;

else

m=0;

if(m==1)

cmd(0x01);

lcd_str (" PASSSWORD MATCH");

cmd(0xc0);

lcd_str("ACCESS GRANTED");

motor();

p=0;

delay_fv(1000,100);

else if(m==0)

p++;

cmd(0x01);

lcd_str(" WRONG PASSWORD");

cmd(0xc0);

Inderprastha Engineering College Page 15


Password Based Door Lock System

lcd_str("ACCESS DENIED");

delay_fv(1000,100);

delay_fv(1000,100);

m=1;

if(p==3)

cmd(0x01);

lcd_str(" PLEASE TRY");

cmd(0xc0);

lcd_str("AGAIN LATER");

while(p==3);

void motor()

int i;

for(i=0;i<10;i++)

a2=0;

a1=1;

delay_ff();

a1=0;

a2=1;

delay_ff();

Inderprastha Engineering College Page 16


Password Based Door Lock System

delay_fv(1000,100);

for(i=0;i<10;i++)

a1=0;

a2=1;

delay_ff();

a2=0;

a1=1;

delay_ff();

}delay_fv(1000,100);

for(i=0;i<10;i++)

a1=0;

a2=0;

delay_ff();

a2=0;

a1=0;

delay_ff();

}delay_fv(1000,100);

delay.h

void delay_ff() // fully fixed delay

unsigned int i,j;

for(i=0;i<200;i++)

for(j=0;j<200;j++);

Inderprastha Engineering College Page 17


Password Based Door Lock System

void delay_pf(unsigned int x) // partial variable delay

unsigned int i,j;

for(i=0;i<x;i++)

for(j=0;j<50;j++);

void delay_fv(unsigned int x,y) // fully variable delay

unsigned int i,j;

for(i=0;i<x;i++)

for(j=0;j<y;j++);

keypad

sbit r1=P1^0; // row 1

sbit r2=P1^1; // row 2

sbit r3=P1^2; // row 3

sbit r4=P1^3; // row 4

sbit c1=P1^4; // column 1

sbit c2=P1^5; // column 2

sbit c3=P1^6; // column 3

sbit c4=P1^7; // column 4

unsigned int c;

char keypad1()

P1=0xff;

while(1)

Inderprastha Engineering College Page 18


Password Based Door Lock System

r1=0;

r4=1;

if(c1==0)

c='7';

delay_pf(500);

return c;

else if(c2==0)

c='8';

delay_pf(500);

return c;

else if(c3==0)

c='9';

delay_pf(500);

return c;

else if(c4==0)

c='/';

delay_pf(500);

return c;

Inderprastha Engineering College Page 19


Password Based Door Lock System

r1=1;

r2=0;

if(c1==0)

c='4';

delay_pf(500);

return c;

else if(c2==0)

c='5';

delay_pf(500);

return c;

else if(c3==0)

c='6';

delay_pf(500);

return c;

else if(c4==0)

c='*';

delay_pf(500);

return c;

Inderprastha Engineering College Page 20


Password Based Door Lock System

r2=1;

r3=0;

if(c1==0)

c='1';

delay_pf(500);

return c;

else if(c2==0)

c='2';

delay_pf(500);

return c;

else if(c3==0)

c='3';

delay_pf(500);

return c;

else if(c4==0)

c='-';

delay_pf(500);

return c;

Inderprastha Engineering College Page 21


Password Based Door Lock System

r3=1;

r4=0;

if(c1==0)

delay_pf(500);

cmd(0x01);

else if(c2==0)

c='0';

delay_pf(500);

return c;

else if(c3==0)

c='=';

delay_pf(500);

return c;

else if(c4==0)

c='+';

delay_pf(500);

return c;

Inderprastha Engineering College Page 22


Password Based Door Lock System

lcd.h

sbit rs=P2^4;

sbit rw=P2^5;

sbit en=P2^6;

sfr lcd=0xB0;

void lcd_display(unsigned int x) // lcd display fuction

unsigned int i;

lcd=x;

rs=1;

rw=0;

en=1;

for(i=0;i<100;i++);

en=0;

void cmd(unsigned char m) // lcd command fuction

unsigned int i;

lcd=m;

rs=0;

rw=0;

en=1;

for(i=0;i<10;i++);

en=0;

Inderprastha Engineering College Page 23


Password Based Door Lock System

void lcd_ini() // lcd initilize

cmd(0x38);

cmd(0x0e);

cmd(0x01);

cmd(0x06);

cmd(0x90);

void lcd_str(unsigned char *str) // display string on lcd

while(*str!='\0')

lcd_display(*str);

str++;

Inderprastha Engineering College Page 24


Password Based Door Lock System

Flowchart B
Annexure

S. No. Components Rating Quantity Price/Unit


1. 4*3 keypad 1 20

2. 16*2 LCD 1 100

3. 8051 1 300
microcontroller
4. breadboard 1 10

5. DC motor 1 10

6. Potentiometer 1 5

7. Programmer 1 150

8. Connecting wires 50

Inderprastha Engineering College Page 26


25

You might also like