You are on page 1of 41

JIGJIGA UNIVERSITY

INSTITUTE OF TECHNOLOGY
SCHOOL OF ELECTRICAL AND COMPUTER
ENGINEERING
DEP’T ELECTRONICS AND COMMUNICATION
ENGINEERING
PASSWORD BASED DOOR LOCK SYSTEM

GROUP MEMBERS ID NO
1. Abdulahi gire R/0073/08
2. Beiment Berihun R/0200/08
3. Nimo Abdirashid R/0554/08
4. Yusuf Mumin R/04397/08

Advisor: Mr K.Purushotham
PASSWORD BASED DOOR LOCK SYSTEM

Declaration
We, the undersigned, declare that this semester project is our original work, on password based on door
lock system using microcontroller. This project work has not been presented for a project in this or any
other universities and all sources of materials that will be used for the project work will be fully
acknowledged.

Name of the student signature date

Abdilahi gire __________ __________

Beiment Berihun __________ __________


Nimo Abdirashid __________ __________

Yusuf Mumin __________ __________

Adviser Approval

This is to certify that the above statement made by the candidate is correct to the best of my knowledge
and belief. This project has been submitted for examination with my approval as a university advisor.

Project advisor signature date

Mr. k.Purushotham ______________ ____________

i
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

Acknowledgment
We praise our Almighty ALLAH who gave us the ability to finish this work. We would like to pay
special thankfulness, warmth and appreciation to the persons below who made our project successful
and assisted us at every point to cherish our goal.

First we would like to take this opportunity to express our profound gratitude, warmth and deep regard
to our advisor, Mr.k.Purushotham. for his exemplary guidance, valuable feedback and constant
encouragement throughout the duration of the project. His valuable suggestions were immense help
throughout our project work. His perspective criticism kept us working to make project in much better
way. Working under him was an extremely knowledgeable experience for us.

Finally, we would like to pay our sincere gratitude to all our friends, whom directly or indirectly, have
lent their helping hand in this project.

ii
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

Abstract
The purpose of this project is to provide security at house, ATM, office etc. in this system the user will
have to register a unique password. The information will be stored in Data Base. Whenever the right
password will be receive, the controller will accordingly give instruction to door . Dc motor will
perform the action on door unlocking. We want to utilize the electronic technology to build an
integrated and fully customized home security system at a reasonable cost.

Keywords: Motor, Microcontroller, LCD, Keypad

iii
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

Table of Contents
CHAPTER ONE................................................................................................................................... 1
1. Introduction ................................................................................................................................. 1
1.2. Motivation ................................................................................................................................ 1
1.3. Objectives and Goals ................................................................................................................ 2
1.4. General Objective ..................................................................................................................... 2
1.5. Specific Objective ..................................................................................................................... 3
1.6. Scope of the project................................................................................................................... 3
CHAPTER TWO.................................................................................................................................. 4
2. LITERATURE REVIEW............................................................................................................. 4
2.1. Theoretical overview................................................................................................................. 4
2.2. Main Components of Password Based Door Lock System Using Microcontroller..................... 4
2.3. 8051 Microcontroller ................................................................................................................ 5
2.4. Microcontroller applications..................................................................................................... 7
2.5. Pin definition and functions ...................................................................................................... 7
2.6. Basic Principle of Operation ................................................................................................... 11
2.6.1. Advantages of password door lock system ....................................................................... 11
CHAPTER THREE............................................................................................................................ 12
3. The Methodology and System Design ......................................................................................... 12
3.1. Circuit design and Procedure ................................................................................................. 12
3.1.1. Equipment required ........................................................................................................ 14
3.1.2. Power supply ................................................................................................................... 14
3.2. Principle Behind The Circuit:................................................................................................. 16
3.3. Circuit Description ................................................................................................................. 17
CHAPTER FOUR .............................................................................................................................. 18
4. RESULT AND SIMULATION ................................................................................................... 18
CHAPTER FIVE................................................................................................................................ 22
5. Conclusion and Recommendation............................................................................................... 22
5.1. Conclusion .............................................................................................................................. 22
5.2. Future scope ........................................................................................................................... 22
Reference............................................................................................................................................ 23
Appendix ............................................................................................................................................ 24

iv
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

List of table and figure

List of table

Table 3.1 Equipment Required


List of figure
Figure 2.1: Pin Diagram of 8051 Micro-Controller [1]

Fig -2.2: 16*2 LCD


Fig -2.3: 4*4 Keypad
Fig -2.4: Buzzer
Fig 3.1: bridge circuit
Fig 3.2: Power Supply Circuit
Fig 4.1: simulation
Fig 4.2: simulation result of access granted

Fig 4.3: simulation result of access denied

Fig 4.4: simulation result after 3 times entered wrong password

v
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

List of Acronyms

AC………………………………..Alternate Current
ALE……………………………....Address Latch Enable
EA……………………………….. External Access Enable
DC………………………………..Direct Current
HZ……………………………….Hertz
IC…………………………………Integrated Circuit
LCD………………………………Liquid Crystal Display
MCU……………………………...Microcontroller
ROM…………………………….. Read-only Memory
RAM……………………………... Random-access Memory

vi
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

CHAPTER ONE
1. Introduction
Many times, we forgot to carry the key of our home. On the other hand, sometimes we come out of our
home and door latch closes by mistake. In these cases, it is difficult to get inside the house. This project
is design to solve this purpose. Main concept behind this project is of a door-latch opening using a
password entered through keypad. As well as turning on the Buzzer when password is entered wrong
for multiple times. User can change this password anytime he/she wish using a keypad.

Today people are facing more problems about security in all over world, nowadays security is the most
essential issue everywhere in the world so security of everything gains higher and higher importance
in recent years. The main component in the circuit is 8051 microcontroller. Here, 4*4 keypad is use to
enter the password. The entered password is compare with the predefined password. If it is correct
password, the system opens the door by rotating door motor and displays the status of door on LCD. If
the password is wrong then door remains closed and displays ―password is wrong on LCD. It can be
use at organizations to ensure authorized access to highly secured places. With a slight modifica tio n
by replacing the motor driver with a relay driver, this circuit can be used to control the switching of
loads through code. This circuit can be also modify by using EEPROM chip interfaced to the
microcontroller and store the entered password in the chip. 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, a lamp, or any other mechanical/electrical load

1.2. Motivation
As an engineering student, a project is required to change theoretical idea to visible form work. The
project chosen is password based on door lock system. This technology is select because of
incorporating technology with the detection of home security system, which can be believed as the next
important steps to realize the home security. The comfort of being able to detect home security has
become imperative as it controls risky factors

Because of jobs make people busy and make to forget their key in home or office, this device he/she
need only to remember the password.

1
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

1.3. Objectives and Goals


The aim of the project is to develop and launch on up to date, reliable and user friendly security system
to automate home security using microcontroller circuitry synchronized with password module with an
objective to provide maximum possible security based on door lock system.

General objectives of the project are defined as;

 To know the situation of their home through keypad


 To effectively receive and transmit data via keypad
 The project (password detector) can be used to automate the door locking process, so the user
need not to carry the door lock keys along with him
 Minimize time and cost
 It offers a comfortable, convenient and safe environment for residents
 It replaces human works by technology

1.4. General Objective


The main aim of the design provided in this project is to develop a device to secure the door of home
or office. The device can be made sure to be available at a low cost so that everyone can afford it. This
device use to protect the home or office using password and the password will be store in the Data
Base.

The devices connected in the door of home, office, consume electrical power, and there is an absolute
necessity of saving of power as per present day situations. Therefore, it is necessary to control devices
more effectively and efficiently at any time. Therefore, this project is built for the sole purpose of
efficient.

So as technology is increasing so vastly now a days, everything in the world is being automated and
wireless for the comfort of man. So here, we are building a device based on the Microcontroller to lock
or unlock the door by password.

2
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

1.5. Specific Objective


The specific objectives of the project are:
 To protect door of home or office using password
 To co-ordinate device through the MCU.
 To eliminate the door key.
 To minimize time and cost.
1.6. Scope of the project

The main scope of the project is to protect home or office using password. The future implications of
the project are very great considering the amount of time and resources it saves. The project we have
undertaken can be used as a reference or as a base for realizing a scheme to be implemented in other
projects of greater level. The project itself can be modified to achieve a complete

3
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

CHAPTER TWO

2. LITERATURE REVIEW

2.1. Theoretical overview


An electronic lock allows activation of an electric appliance only on entering the correct password
Here we have presented such an electronic locking system in which a PIC18F452 microcontro lle r
Plays the role of the processing unit. The MCU is interfaced with a 4*4 matrix keypad and a
16*2 LCD to the user interface. Using this circuit ,one can make any electrical applia nce
password protected.it can be used as an electronic door lock by interfacing the output of the
circuit with an electrically actuated door lock. The system turns on the appliance on entering a
three digit password entire

2.2. Main Components of Password Based Door Lock System Using Microcontroller
Micro Controller 8051:Here in this project we are using an 8-bit Micro-Controller which acts as a brain
of our circuit or we can say that it is the Central Processing Unit (C.P.U) of our circuit. We are using
Micro-Controller 8051 which has a Program Memory of 2Kbytes (EPROM).This memory is used to
store the Predetermined password during the time of installation, which is taken into consideratio n
during the operation to compare the input password with the predetermined password.

Followings are the functions of the Micro-Controller in our project:

a. To sense/take the input from the input Keyboard in digital signal form.
b. To show the input numbers from the input device (Keyboard) on the output device, i.e. on L.C.D
screen in our case.
c. To check whether the entered number from the keyboard is right or wrong by comparing with the
Predetermined password stored in the EPROM
d. To drive the D.C motor drive in either direction by giving the signal to the correct relay. Here two
Relays are used.Relay-1 is used to drive the motor in such direction with which the door can be
open, this operate when entered password is Correct, whereas Relay-2 is used to block the direction
of D.C motor drive or to rotate the Drive in opposite direction to remain the door close state, and
this done during the wrong password is encountered.

4
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

To send the data status of the entered password to the alarm circuit, to give the indication of the
encountered password whether it is Correct or Incorrect.
2.3. 8051 Microcontroller
At whatever point we are learning about new machine we need to think about the machine capacity we
are utilizing and we can do it by studying the internal hardware design (device building design), and
additionally to think about the size, number and the extent of the registers.
A microcontroller is a single chip that contains the processor, the ROM, the RAM, a clock and an input
output control unit. It is additionally called a "workstation on a chip"(small computer). Now a days
billions of microcontrollers units are inserted every year in a different item from toys to spaceships.
Case in point, a single vehicle utilizes 70 or more microcontrollers [4]. The below figure port rays a
general block diagram of microcontroller.

U1
19 39
XTAL1 P0.0/AD0
38
P0.1/AD1
37
P0.2/AD2
18 36
XTAL2 P0.3/AD3
35
P0.4/AD4
34
P0.5/AD5
33
P0.6/AD6
9 32
RST P0.7/AD7
21
P2.0/A8
22
P2.1/A9
23
P2.2/A10
29 24
PSEN P2.3/A11
30 25
ALE P2.4/A12
31 26
EA P2.5/A13
27
P2.6/A14
28
P2.7/A15
1 10
P1.0 P3.0/RXD
2 11
P1.1 P3.1/TXD
3 12
P1.2 P3.2/INT0
4 13
P1.3 P3.3/INT1
5 14
P1.4 P3.4/T0
6 15
P1.5 P3.5/T1
7 16
P1.6 P3.6/WR
8 17
P1.7 P3.7/RD
8051

Figure 2.1: Pin Diagram of 8051 Micro-Controller

5
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

The 8051 structure consists of the following specific characteristics:


 16 bit PC & data pointer (DPTR)
 8 bit program status word (PSW)
 8 bit stack pointer (SP)
 Internal ROM of 4kb
 Internal RAM of 128 bytes
 4 register banks each containing of 8 registers
 80 bits of general purpose data memory
 30 I/O pins arranged as 48 bit ports (P0-P3)
 Two 16 bit timer/counter (T0-T1)
 Two external and three internal interrupt sources Oscillator and clock circuits.
Features of AT89C52 Microcontroller
 Compatible with MCS-51 Products
 8K Bytes of In system Programmable (ISP) Flash Memory
 Endurance: 1000Write/Erase Cycles
 4.0V to 5.5V Operating Range
 Fully Static Operation:0Hz to 33 MHz
 Three-level Program Memory Lock
 256x8 bit Internal RAM
 32 Programmable I/O Lines
 Three 16-bit Timer/Counters
 Eight Interrupt Sources
 Full Duplex UART Serial Channel
 Low-power Idle and Power-down Modes
 Interrupt Recovery from Power-down Mode
 Watch dog Timer
 Dual Data Pointer
 Power-off Flag

6
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

2.4. Microcontroller applications


The microcontroller applications are mainly categorized as audio, automotive, communicatio n,
computers, peripherals, consumer, industrial, imaging and video, medical, Military or aerospace,
mobile or wireless, motor control, security and general purposes

2.5. Pin definition and functions


The capability to interface external memory has an impact on pin organization. In general, there
Exist two types of microcontrollers. The first is the microcontroller, which has on chip program
Memory and is not capable of to use external memory and the second is microcontroller likes the
8051, which can interface external memory.
Port 0: can be used either as a general-purpose port or to access external memory. When external
Memory is used, Port0 forms the low order byte of the external memory address (A0 - A7). Next,
the byte being written or read is transferred through Port 0. External pull-ups resisters are required
when Port 0 loaded.
Port 1: is a general purpose port with internal pull-ups resister and does not possess any other
special function.
Port 2: can be used either as a general-purpose port or to emit the high-order address (A8- A16) or also
with internal pull-ups resister.
Port 3: is an 8-bit bi-directional input or output port with internal pull-ups resister

Alternate Functions of Port pins

P3.0R XD (serial input port)


P3.1TXD (serial output port)
P3.2 INT0 (external interrupt0)
P3.3 INT1 (external interrupt 1)
P3.4T0 (timer 0 external input)
P3.5T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)

7
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

RST
 Reset input. A high on this pin for two machine cycles while the oscillator is running resets the
device. This pin drives High for 96 oscillator periods after the Watchdog times out. The DISR
TO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of bit
DISR TO, the RESET HIGH out feature is enabled.
ALE/PROG
 Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during
accesses to external memory. This pin is also the program pulse input (PROG) during Flash
programming.
 In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be
used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped
during each access to external data memory.
 If desired, ALE operation can be disabled by setting bit0of SFR location8EH. With the bit set,
ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled
high. Setting the ALE disable bit has no effect if the microcontroller is in external execution
mode.
PSEN
 Program Store Enable (PSEN) is the read strobe to external program memory.
 When the AT89C52 is executing code from external program memory, PSEN is activated twice
each machine cycle, except that two PSEN activations are skipped during each access to external
data memory.
EA/VPP
 External Access Enable. EA must be strapped to GND in order to enable the device to fetch
code from external program memory locations starting at0000H up to FFFFH.
 Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA
should be strapped to VCC for internal program executions. This pin also receives the 12-volt
programming enable voltage (VPP) during Flash programming.
XTAL1
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2
Output from the inverting oscillator amplifier

8
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

Other components

L.C.D:- Here we are using a 16x2 LCD, which is a dot matrix Liquid Crystal Display. Its function is
to display the alphanumeric symbols to indicate the status message of the circuit. This L.C.D can
display the two lines and each line contains 16 characters. This L.C.D contains an internal oscillato r
circuit to work in synchronization with the controller.

Fig -2.2: 16*2 LCD

D.C Motor Drive: It is a machine used to convert the electrical energy into mechanical energy. This
D.C motor uses a 9V battery as an input through a Switching Relay and rotate to open the door or to
lock the door. To interface this D.C motor drive with the Micro Controller we use an L293D I.C.

The Actuator's are those devices which actually gives the movement or to do a task like motor's. In the
real world there are various types of motors available which works on different voltages. So we need
motor driver for running them through the controller. To get interface between motor and
microcontroller

4x4 Matrix Keyboard: This keyboard contains a numbers of switches arranged in a matrix format.
Each rows and each column are connected to the pins of micro controller. This keyboard contains
numbers from 0 to 9, alphabets from A to D, an Enter button and an Escape buttons. These switches
are generally a numbers of push buttons. With the help of this Keyboard an individual can enter the
password to unlock the door.
9
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

Fig -2.3: 4*4 Keypad


Buzzer or any Alarming Circuit: This is a piezoelectric material which converts the electrical signals
into the mechanical Vibrations. This vibration amplified into a Buzzing sound which will indicate that
the entered password is incorrect. Instead of buzzer we can use many different way of indication, such
as notification on mobile phone or smart phone at remote location using a G.S.M technology.

Fig -2.4: Buzzer

10
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

2.6. Basic Principle of Operation


At the time of installation, the individual user enters a desired password, which is also known as pre-
determined password. Microcontroller stores this password into its program memory. Now after the
implementation of this security system at the area of interest, if someone enters a password via
keyboard the micro controller will compare the entered password with stored password if it matches
with it, then the door will unlock, and if the entered password doesn't match with stored password the
door will remain unopened. And if the wrong password is entered above the prescribe limit then an
alarm will generate by the alarming circuit.

2.6.1. Advantages of password door lock system


 No keys to be lost, stolen or occupied.
 Can be lock using keypad.
 Automatic door opening.
 Indication for unauthorized entry.
 No need of any complex components, because it uses common available components.

11
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

CHAPTER THREE
3. The Methodology and System Design
3.1. Circuit design and Procedure
Password Based Door Locking System design uses five major components a Microcontroller, an L293D Motor
Driver, a DC motor, a 4×4 matrix keypad and an LCD. Here AT89C52 Microcontroller is used and it is an 8-bit
controller. This controller requires a supply voltage of +5V DC. In order to provide regulated 5V DC voltage to
the controller we need to use 7805 power supply circuit. We can use 9V DC battery or 12V, 1A adaptor as a
power source.

Reset Circuit Design: The reset pin of the microcontroller is kept active till the power supply is in the
specified range and a minimum oscillation level is maintained. In other words to ensure the supply
voltage does not falls below the threshold level of 1.2V and the reset pulse width is greater than 100ms
(recommended for 89C51), we select the values of resistor and capacitor such that RC >=100ms. Here
we select a 10K resistor and a 10uF electrolyte capacitor.

Compilation of Microcontroller Code: Once the circuit is designed and drawn on a piece of paper,
the next step is to write and compile the code. Here we select the Kiel µVision software to write the
program in C language. Prior to writing the code, general steps needs to be followed like creating a
new project and selecting the target device or the required microcontroller. Once the code is written,
we saved it with .c extension and then added it to the source file group under the target folder. The
code is then compiled by pressing compile. Once the code is compiled, a hex file is created. In the
next step, we use Proteus software to draw the circuit. The code is dumped into the microcontroller by
right clicking on the IC and then adding the hex file.

A. Hardware Requirement:
 8051 Microcontroller (AT89S52)
 Stepper Motor
 Capacitor 10uf ,33pf (for filter supply to pure DC)
 Resister
 Respack-8 Resistor
 Voltage regulator 7805
 16×2 LCD

12
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

 L293D Motor Driver board


 4x4 Keypad
B. Software Requirements:
 Kiel compiler
 Proteus

The block diagram of the project as shown below

4x4
KEYPAD
LCD
M
I
C
R MOTOR
C DRIVER
O
N
T
R
O
L
L
STEPPER
E
MOTOR
R

13
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

3.1.1. Equipment required

Sr. Equipment Device Quantity


no
1 Microcontroller AT89C51RB2 1

2 L.C.D LM016L 1

3 D.C Motor Drive ULN20003A 1

4 Keypad KEYPAD 1

5 Buzzer BUZZER 1

6 Resistors RESPACK-8 1
Table 3.1 Equipment Required

In addition to these a door lock system is required which has to be connected to the device to receive
the code from the user’s. The resistors are to be selected according to the ratings of these equipment
selected and also for the efficient performance of the device.
The software required for the programming of the 8051 microcontroller is Keil µ Vision, in which we
program the microcontroller to do the required work as desired, and finally all the basic things like the
breadboard, input pins, sockets, soldering gun etc.
3.1.2. Power supply
Basically any electronic circuit runs with a power supply. Here we are giving a 5v supply to the various
IC’s used in the design presented here. We get a 240V supply in our house at any instant. So in order
to provide our circuit appropriate supply voltage a different power circuit is to be made based on our
requirement. The various steps included in the circuit are explained below stepwise. And also various
precautions are to be taken for the safety of the electronic circuit designed. The different stages of the
design of the circuit is given below.
 Transformer
We need a step down transformer of output to supply all the electronics involved. Here in home
appliance device all the equipment require a DC input of 5v and since the regular input to the houses
is 220v we need a transformer to step down voltages.

14
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

 Bridge Rectifier
The equipment needs a DC supply, so the output from the transformer is connected to a bridge rectifier
to make it DC. A bridge rectifier basically has four diodes connected as shown below to provide
rectification. This configuration is a widely used, both with individual diodes wired as shown and with
single component bridges where the diode bridge is wired internally.

BR1
AC

BRIDGE

Fig 3.1: bridge circuit

 Filter Circuit
The filter circuit is simply a capacitor associated in parallel to the power circuit. It goes about as a filter
that seems to be, it filters outs the ripples present in the circuit brought on throughout the rectificatio n
from the diodes in the bridge circuit. Regardless of the amount consideration is taken there are still
ripples in the output voltage of the circuit, which is destructive for the IC's utilized. So filter capacitor
evokes them, along these lines helping keeping up security in the outlined circuit.

15
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

 Voltage Regulator
Then at last voltage controllers are associated over the circuit to secure the supplies from any kind of
voltage variances. All the gadgets we utilize are delicate and sensitive, so protection from any kind of
variances is very important. A voltage controller is intended to naturally keep up a consistent voltage
level.

1 3
VI VO

GND
2
Fig 3.2: Power Supply Circuit

3.2. Principle Behind The Circuit:


The main component in the circuit is 8051 microcontroller. Here, 4×4 keypad is used to enter the
password. The entered password is compared with the predefined password. If it is correct password,
the system opens the door by rotating door motor and displays the status of door on LCD.

If the password is wrong then door remains closed and displays ―pwd is wrong‖ on LCD Its design
and working are very interesting and easy to implement. If you are interested to get detailed informa tio n
about its design, working and applications, read the post Electronic Code Lock System using 8051
Microcontroller. 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 highly intelligent. One of the prominent features of these
innovative lock systems is their simplicity and high efficiency.

16
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

3.3. Circuit Description


The total functioning of the―CODE LOCK SYSTEM is based on the software program which is burn
inside the microcontroller IC 8051.The at89c51 IC is heart of the given circuitry because this IC is
programmable 40pin dip IC in which we burn the program in rom. This IC has a 32 input lines through
which we take the output pin no 9 is used for reset the microcontroller and make it in a initial condition
pin no 31 is enable pin, it required low pulse for activating the microcontroller depends on the crystal
connected to the xtal1 & xtal2. pin no 18&19 is used for providing the VCC of +5v pin 20 is grounded.

The operating frequency of the controller is set by the external oscillator of crystal oscillator of crystal
having frequency of 12MHZ. Capacitor having 33pF in parallel connection with ground is for the
proper undammed frequency. Reset for the controller is normally ground and 10uf 10v electrolytic
capacitor is also connected on reset for the slowly on and off to the controller during the supply is
turning on and off. The keypad used to give input signal is been interfaced with microcontroller are
port0 (p0.1- p0.7).The controller fetches the hex code according to the instruction. The LCD is used
for display device it is a 16 slots device usually used to show output status from the microcontroller .
The output signal which be fetched by relay status followed by on/off status of electronic lock.

17
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

CHAPTER FOUR
4. RESULT AND SIMULATION

Fig 4.1: simulation

When it is entered a 5 digit password by the user it will display on LCD as *****.Therefore anyone
else can’t see what the user enters. If it is the correct password, LCD displaying a message password
matched access granted and the door will be opened. After few second the door is locked automatica lly.
If he is entered password incorrectly LCD displaying ACCESS GRANTED, if he is entered wrong
password 3 times the LCD display ‘please contact your HOD’.

Simulation of project is performed on PROTEUS and the code was written Kiel software. Code for the
microcontroller to run DC motors IC (L293D) is written. In the simulation the relevant data to the
Microcontroller is send through keypad.

The Microcontroller processed the data and sent the information to the Actuator IC (L293D). The
Actuator IC upon receiving information showed response by driving the DC motors

18
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

Here we are discussing the result in different cases as once when wrong password is entered the LCD
displays “wrong password” entered and when correct password is entered the LCD shows the
“password matched access granted” and the motor rotates to open the door

Case 1: When correct password is entered, the door does not open.

Fig 4.2: simulation result of access granted

19
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

Case 2: When wrong password is entered the door, get open.

Fig 4.3: simulation result of access denied

20
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

Case 3: When wrong password entered three times

Fig 4.4: simulation result after 3 times entered wrong password

21
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

CHAPTER FIVE

5. Conclusion and Recommendation


5.1. Conclusion
The work was done successfully. It is evidence that the use of keypad with the right circuitry can be
used to operate a security system. These systems have the ability to accesses a secure place (house,
ATM, industries, office etc.).A password based recognition system can easily perform variation. In
variation the system compare an input password to the enrolled password of a specific user to
determine, if they are form the same password. Now the security of our home, office etc.

5.2. Future scope


 We can send this data to a remote location using mobile or internet.
 We can add fingerprint sensor so entry will be allowed for the authorized person using their
fingerprints.
 We can add fire, wind and LPG sensors so that, the doors will automatically open.

22
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

Reference
[1]. Technology Intelligent Home: SMS Based Home Security System with Immediate Feedback
International Journal Of Advance Research In Science And Engineering http://www.ijarse.co m
IJARSE, Vol. No.2, Issue No.5, May, 2013 ISSN-2319-8354(E).

[2]. Liu, T., Guo, H., and Wang, Y., A new approach for color-based object recognition with fusion of
color models‖, Congress on Image and Signal Processing Conference, Sanya-China, vol. 3, pp. 456-
460, May 2008.

[3]. Wang, B., and Yuan, T., Traffic Police Gesture Recognition using Accelerometer‖, IEEE
SENSORS Conference, Lecce-Italy,pp. 10801083, Oct. 2008.

[4]. Lalanne, T., and Lempereur, C., Color recognition with a camera: a supervised algorithm for
classification‖, IEEE Southwest Symposium on Image Analysis and Interpretation, Tucson-Arizo na,
pp. 198-204, April 1998.

[5]. Signals, Systems and Computers, 2004 Conference Record of the Thirty-Eighth Asilomar
Conference on Publication 7-Nov-2004 Volume: 1, on page(s): 577-581 Vol.1.

[6]. International Journal of Advanced Research in Computer Science and Software Engineer ing,
Volume 2, Issue 10, October 2012.

[7]. International Journals of Biometric and Bioinformatics, Volume (3): Issue (1).

[8]. Mukesh Kumar Thakur, Ravi Shankar Kumar, Mohit Kumar, Raju Kumar Wireless Fingerpr int
Based Security System using Zigbee‖ , International Journal of Inventive Engineering and Sciences
(IJIES) ISSN: 2319–9598, Volume1, Issue-5, April 2013.

[9]. Mary Lourde R and Dushyant Khosla, Fingerprint Identification in Biometric Security Systems‖,
International Journal of Computer and Electrical Engineering, Vol. 2, No. 5, October, 2010.

[10]. Song, M., Kim, B., Ryu, Y., Kim, Y., and Kim, S., A design of real time control robot system
using android Smartphone‖ The 7th International Conference on Ubiquitous Robots and Ambient
Intelligence (URAI), BusanKorea, Nov. 2010.

[11]. International Journal of Electrical, Electronics and Data Communication, ISSN: 2320-2084

23
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

Appendix
#include<reg51.h>

#include"delay.h"

#include"lcd.h"

#include"keypad.h"

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

motor PIN

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

sbit a1=P2^0;

sbit a2=P2^1;

sbit a3=P2^2;

sbit a4=P2^3;

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");
24
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

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

keypad1();

ar[i]=c;

if(i==0)

cmd(0x01);

lcd_display(' ');

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(" PASSWORD MATCHED");

cmd(0xc0);

lcd_str(" ACCESS GRANTED");

motor();
p=0;
25
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

delay_fv(1000,100);

else if(m==0)

p++;

cmd(0x01);

lcd_str(" WRONG PASSWORD");

cmd(0xc0);

lcd_str(" ACCESS DENIED");

delay_fv(1000,100);

delay_fv(1000,100);

m=1;

if(p==3)

cmd(0x01);

lcd_str(" PLEASE CONTACT");

cmd(0xc0);

lcd_str(" YOUR HOD....");

while(p==3);

void motor()

unsigned int i;

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

{
a2=a3=a4=0;
26
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

a1=1;

delay_ff();

a1=a3=a4=0;

a2=1;

delay_ff();

a1=a2=a4=0;

a3=1;

delay_ff();

a1=a2=a3=0;

a4=1;

delay_ff();

delay_fv(1000,100);

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

a2=a3=a1=0;

a4=1;

delay_ff();

a1=a2=a4=0;

a3=1;

delay_ff();

a1=a3=a4=0;

a2=1;

delay_ff();

a4=a2=a3=0;

a1=1;

delay_ff();

}
}
27
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

sbit rs=P3^0;

sbit rw=P3^1;

sbit en=P3^2;

sfr lcd=0x90;

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;

void lcd_ini() // lcd initilize


{
28
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

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++;

sbit r1=P0^0; // row 1

sbit r2=P0^1; // row 2

sbit r3=P0^2; // row 3

sbit r4=P0^3; // row 4

sbit c1=P0^4; // column 1

sbit c2=P0^5; // column 2

sbit c3=P0^6; // column 3

sbit c4=P0^7; // column 4

unsigned int c;

char keypad1()

P2=0xff;

while(1)

{
r1=0;
29
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

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)
{
30
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

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);
31
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

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)
32
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

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;

void delay_ff() // fully fixed delay

unsigned int i,j;

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

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

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

{
unsigned int i,j;
33
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering
PASSWORD BASED DOOR LOCK SYSTEM

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++);

34
JJU, JJIT, SCHOOL OF ECE electronics & communication engineering

You might also like