Академический Документы
Профессиональный Документы
Культура Документы
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 .
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.
ACKNOWLEDGEMENT
I take this opportunity to express my profound gratitude and deep regards to our guide Mr. Himanshu
Tripathi , Department of Electrical and Electronics Engineering , Inderprastha Engineering College ,
Ghaziabad for him exemplary guidance , monitoring and constant encouragement throughout this project.
I would also like to extend our deep sense of gratitude towards, Dr. RAMBIR SINGH our head of the
department.
Acknowledgement is something which really comes from the bottom of the heart of every writer.
I also wish to express my indebtedness to my parents as well as my family members whose blessing and
support always helped me to face the challanges ahead. At the end i would like to express our sincere
thanks to all my friends and others who helped me directly or indirectly during this project work.
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.
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
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.
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
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
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.
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.
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.
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.
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
Annexure A
Code
main.c
#include<reg51.h>
#include"delay.h"
#include"lcd.h"
#include"keypad.h"
/******************
motor PIN
******************/
sbit a1 = P2^0;
sbit a2 = P2^1;
void motor();
/******************
main program
******************/
void main()
unsigned int i;
lcd_ini();
while(1)
cmd(0x01);
cmd(0xc0);
lcd_str("PASSWORD");\
for(i=0;i<5;i++)
keypad1();
ar[i]=c;
if(i==0)
cmd(0x01);
lcd_display(' ');
lcd_display('*');
//compare();
m=1;
else
m=0;
if(m==1)
cmd(0x01);
cmd(0xc0);
lcd_str("ACCESS GRANTED");
motor();
p=0;
delay_fv(1000,100);
else if(m==0)
p++;
cmd(0x01);
cmd(0xc0);
lcd_str("ACCESS DENIED");
delay_fv(1000,100);
delay_fv(1000,100);
m=1;
if(p==3)
cmd(0x01);
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();
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
for(i=0;i<200;i++)
for(j=0;j<200;j++);
for(i=0;i<x;i++)
for(j=0;j<50;j++);
for(i=0;i<x;i++)
for(j=0;j<y;j++);
keypad
unsigned int c;
char keypad1()
P1=0xff;
while(1)
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;
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;
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;
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;
lcd.h
sbit rs=P2^4;
sbit rw=P2^5;
sbit en=P2^6;
sfr lcd=0xB0;
unsigned int i;
lcd=x;
rs=1;
rw=0;
en=1;
for(i=0;i<100;i++);
en=0;
unsigned int i;
lcd=m;
rs=0;
rw=0;
en=1;
for(i=0;i<10;i++);
en=0;
cmd(0x38);
cmd(0x0e);
cmd(0x01);
cmd(0x06);
cmd(0x90);
while(*str!='\0')
lcd_display(*str);
str++;
Flowchart
Annexure B
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