14 Password Based Door Lock System Using 8051 Microcontroller - Compress
14 Password Based Door Lock System Using 8051 Microcontroller - Compress
By
Mou Chowdhury
Sushama Ganguly
Debosree Sahoo
Ranjabati Ghosh
Dedicated to:
Our Parents
CERTIFICATE OF APPROVAL
I hereby recommend that the work in preparing the seminar report entitled “PASSWORD BASED
MICRPCONTROLLER ”
DOOR LOCK SYSTEM USING 8051 MICRPCONTROLLER
…………………………………………
…………………………………………
Mr. Anirban Chatterjee
Assistant Professor, Dept of ECE
Meghnad Saha Institute of Technology
Kolkata-700150
Countersigned,
……………………………………………..
……………………………………………..
Dr. Sudip Dogra
HOD, Dept of ECE
Meghnad Saha Institute of Technology
Kolkata –
Kolkata – 700150
700150
………………………………………………..
Prof. (Dr.) S. Ray. Chaudhuri
Director
Meghnad Saha Institute of Technology
Kolkata –
Kolkata – 700150
700150
ACKNOWLEDGEMENTS
We would like to express our sincere regards to Mr. Anirban Chatterjee Assistant Professor of the
Department of Electronics and Communication Engineering, Meghnad Saha Institute of
Technology for his guidance, valuable advice and constructive suggestions for carrying out this
seminar.
We would like to record our indebtedness to Dr.Sudip Dogra, HOD, Department of Electronics and
Communication Engineering and Prof. Sukumar Roy Chaudhury Director, Meghnad Saha Institute
of Technology for providing us with all the support that were needed.
We would also like to thank a ll the faculty members of ECE department, MSIT for their valuable
suggestions during the course of our work
Finally, our sincere thanks go to our parents for their encouragement and support during this
project.
............................................... ...............................................
Name- Mou Chowdhury Name –
Name – Sushama
Sushama Ganguly
Roll No- 14200316010 Roll No.- 14200316001
Reg. No- 161420120011 Reg. No.- 161420120020
................................................... ................................................
Name –
Name – Debosree Sahoo Name –
Name – Ranjabati
Ranjabati Ghosh
Roll No.-
No.- 14200316011 Roll No.-
No.- 14200316009
Reg. No.- 161420120010 Reg. No.-161420120012
P a g e | i
ABSTRACT
P a g e | ii
TABLE OF CONTENTS
Acknowledgments.................................................... i
Abstract..................................................................... ii
List of Figures
CHAPTER 1. INTRODUCTION.......................................... 1-2
1.1 Password Based Door Lock System
2.1 Resistor ………………………………
……………………………… 3
2.2 Capacitor.......
Capacitor...................
........................
........................
................
.... 4
2.3 Transistor.........
Transistor.....................
........................
.........................
............... 5
LIST OF FIGURES
1.2 Block Diagram of Password Based
Based Door Lock System ………
Lock ……….. 2
Potentiometer................................................................
3.1.8.1 10KΩ Potentiometer 13
CHAPTER 1
INTRODUCTION
This system demonstrates a Password based Door Lock System using 8051
Microcontroller, where in 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 close, denying access to the person.
P a g e | 1
If the entered password is correct, then the system opens the door by rotating door
motor and display the status of door on LCD. If the password is remains
remai ns closed and
displays “PWD is is wrong” on LCD.
1.2 Block Diagram of Password B
Based
ased Door Lock System
P a g e | 2
CHAPTER 2
HARDWARE COMPONENTES
2.1 Resistor
A resistor is a passive
a passive two-terminal
two-terminal electrical
electrical component that implements electrical
implements electrical
resistance as a circuit element. In electronic circuits, resistors are used to reduce
current flow, adjust signal levels, to divide voltages, bias
voltages, bias active elements, and
terminate transmission
terminate transmission lines, among
lines, among other uses. High-power resistors that can
dissipate many watts
many watts of electrical power as heat, may be used as part of motor
controls, in power distribution systems, or as test loads for generators. Fixed
generators. Fixed resistors
have resistances that only change slightly with temperature, time or operating voltage.
Variable resistors can be used to adjust circuit elements (such as a volume control or a
lamp dimmer), or as sensing devices for heat, light, humidity, force, or chemical
activity.
P a g e | 3
2.2 Capacitor
A capacitor is a passive
a passive two-terminal
two-terminal electronic
electronic component that stores electrical
stores electrical
energy in an electric
an electric field. The
field. The effect of a capacitor is known as
as capacitance.
capacitance. While
While
some capacitance exists between any an y two electrical conductors in proximity in
a circuit, a
circuit, a capacitor is a component designed to add capacitance to a circuit. The
capacitor was originally known as a condenser. The original name is still widely
still widely used
in many languages, but
languages, but not in English.
P a g e |
| 4
2.3 Transistor
A transistor is a semiconductor
a semiconductor device used to amplify
to amplify or switch electronic
switch electronic signals
and electrical
and electrical power. It
power. It is composed of semiconductor
semiconductor material usually with at least
three terminals
three terminals for connection to an external circuit. A voltage
A voltage or current
current applied to one pair
of the transistor's terminals controls the current through another pair of terminals. Because
the controlled (output) power
(output) power can be higher than the controlling (input) power, a transistor
can amplify
can amplify a signal. Today, some transistors are packaged individually, but many more are
found embedded in integrated
in integrated circuits.
circuits.
charge carrier,
junction in a field
transistora field effect
devices. transistor, or
transistor,
Compared with or the vacuum
may
the have two
vacuum kinds of charge
tube, transistors
tube, transistors arecarriers iin
generally n bipolar
smaller,
and require less power to operate. Certain vacuum tubes have advantages over transistors at
very high operating frequencies or high operating voltages. Many types of transistors are
made to standardized specifications by multiple manufacturers
P a g e | 5
CHAPTER 3
HAEDW
HAE DWARE
ARE AND SOFT
SOFTWWARE REQU
REQUIRE
IRED
D
● 8051 Microcontroller
● 8051 Programmer
● 16*2 LCD
● DC Motor
● 10KΩ Potentiometer
● Connecting Wires
Wires
● Power Supply
● If 8051 Development Board is not used, then the following components are needed
● 11.0592 MHz Quartz Crystal
● Push Button
Button
P a g e | 6
3.1.1 8051 Microcont
Microcontroller
roller
In the following diagram, the system bus connects all the support devices to the CPU. The
system bus consists of an 8-bit data bus, a 16-bit address bus and bus control signals. All
other devices like program memory, ports, data memory, serial interface, interrupt control,
timers, and the CPU are all interfaced
i nterfaced together through the system bus.
P a g e | 7
INTRODUCTION:
With this board you can develop and prototype with any of 8051 40 pin microcontrollers. The
RS232 driver on board allows easy connection with PC or other embedded hardware . The
board have User buttons and status LEDs. The
The bridge rectifier allow this board to be powered
with both AC and DC power supply adapters.
MAIN FEATURES:
I/O Features
2. Logic operations
4. Branch operations.
A logical operation is a special symbol or word which connects two or more phrases of
information. It is most often used to test whether a certain relationship between the phrases is
true or false.
Data transfer instructions move the content of one register to another. The register the content
of which is moved remains unchanged. If they have the suffix “X” (MOVX), the data is
exchanged with external memory.
memory.
There are two kinds of branch instructions: Unconditional jump instructions: upon their
execution a jump to a new location from where the program continues execution is executed.
Conditional jump instructions: a jump to a new program location is executed only if a
specified condition is met. Otherwise, the program normally proceeds with the next
instruction.
instruction.
Before we interface the keypad with microcontroller, first we need to understand how it
works. Matrix keypad consists of set of Push buttons, which are interconnected. Like in our
case we are using 4X4 matrix keypad,
ke ypad, in which there are 4 push buttons in each of four rows.
And the terminals of the push buttons are connected according to diagram. In first row, one
terminal of all the 4 push buttons are connected together
to gether and another terminal of 4 push
buttons are representing each of 4 columns, same goes for each row. So we are getting 8
terminals to connect with a microcontroller
3.1.4.1 Image of Matrix keypad
P a g e |
| 1 0
We come across LCD
across LCD displays everywhere around us. Computers, calculators, television sets,
mobile phones, digital watches use some kind of display to display
displa y the time. An LCD is an
electronic display module which uses liquid crystal to produce a visible image. The 16×2
LCD display is a very basic module commonly used in DIYs
in DIYs and circuits. The
16×2 translates o a display 16 characters per line in 2 such lines. In this LCD each character
is displayed in a 5×7 pixel matrix.
This
driverMotor Driver Board
IC designed is designed
to provide to Work
bidirectional with
drive L293DofIC.
currents upThe L293D at
to 600-mA is voltages
a popularfrom
motor
4.5 V to 36 V. With Terminal Blocks for connecting motors & power supply and Berg Sticks
for control signals from microcontroller. This can control 2 DC Motors, their
thei r direction using
control lines and their speed using PWM.
Features
P a g e |
| 1 1
3.1.6.1 Image of L293D Motor Drive Board
3.1.7 DC Motor
P a g e |
| 1 2
P a g e |
| 1 3
3.2 Software
Sof tware Requirem
Requirements
ents
● Willar Programmer
● Proteus (for circuit diagram and simulation)
3.2.1 Keil µ Vision IDE
The µVision IDE combines project management, run-time environment, build facilities,
source code editing, and program debugging in a single powerful environment. µVision is
easy-to-use and accelerates your embedded software development. µVision supports multiple
screens and allows you to create individual window layouts anywhere on the visual surface.
surfa ce.
The µVision
The µVision Debugger provides
Debugger provides a single environment in which yoyouu may test, verify, and
optimize your application code. The debugger includes traditional features like simple
s imple and
complex breakpoints, watch windows, and execution control and provides full visibility
visibilit y to
device peripherals
P a g e |
| 1 4
CHAPTER 4
PROPOSE DESIGN
P a g e |
| 1 5
First, a 10KΩ Potentiometer is connected to the LCD Display’s Contrast Adjust Pin(Pin 3).
RS, RW and E of LCD are connected to P3.0, GND and P3.2 pins respectively. The eight
data lines of the LCD are connected to PORT1.
The four ROW pins of the keypad are connected to P2.0 to P2.3 and the four COLUMN pins
of the Keypad are connected to P2.4 to P2.7 pins respectively. The IN1 and IN2 of (1A and
2A) of the L293D Motor Driver are connected to PORT0 pins P0.0 and P0.1 Motor is
connected between OUT1 and OUT2 (1Y and 2Y) pins of L293D.
Once the circuit is designed and drawn on a piece of paper, the next step is to write and
compile the code. Here, we used the keli µ Vision software to write 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 need
to save it with c extension and then add it to the source file group under the target folder. The
code is then complied by pressing F9 key.
Once the code complied a hex file is created. In the next step, we use proteus software to
drew the circuit. The code is dumped into the microcontroller using an external programmer
and Willar Sofware.
P a g e |
| 1 6
CHAPTER 5
Once the circuit is powered ON, microcontroller sends commands to the LCD to display
“enter password” on
password” on LCD. Now we need to enter the password using the keypad. Once
password is entered, it displays 5 stars on LCD to indicate that controller read password
successfully.
Now the controller compares the entered password with predefined password. If the
password is matched, then the microcontroller makes P0.0 HIGH
HIGH and P0.1 LOW, so motor
drive gets the inputs signals for forward motion of the motor.
As a result, the Door Motor rotates in forward direction to open the door. After a delay of 10
seconds, the microcontroller makes P0.0 LOW and P0.1 HIGH, so the motor drive gets the
input signals for reverse motion. As a result,
r esult, the Door motor rotates in reverse directi
direction
on to
close the door.
If the password is not matched, then microcontroller maintains both P0.0 and P0.1 LOW.
Hence, the door motor is stationary so that door remains closed.
NOTE: While giving the connection, make sure that there is no common connection between
AC and DC supplies.
P a g e |
| 1 7
CHAPTER 6
► Initially, declare the PORT1 to LCD data pins and control pins (RS and E) to P3.0
and P3.2. Also, declare PORT2 to keypad. Also use P0.0 and P0.1 for motor driver.
driver.
► If password is correct, then make P0.0 pin HIGH and P0.1 pin LOW to open the
LCD.
door. During this time, display “Door opening” on LCD.
► After some time, make P0.0 pin LOW and P0.1 pin HIGH to close the door and
LCD.
after this display “Door closing” on LCD.
P a g e | 18
CHAPTER 7
ADVANTG
ADVANTGES
ES AN
ANDD DIS
DISADV
ADVANTAGES
ANTAGES
7.1 Advantages
▪ No More Keys: You won’t have to carry around a large set of keys keys and they will be less
likely to be lost or stolen. Also, if you are a landlord, you don’t have to give residents keys or
replace them if they lose them.
▪ Control: In a company building, you can control and restrict who goes into what part of
the building. Also residents and landlords of apartments and flat, can control who can enter
their room with one PIN code and it reduces the risk
ris k of anything getting stolen. It is
incredibly easy to change the PIN code whenever you like. The combination
The combination door locks from
The Workplace Depot have over 8,000 possible code combinations with a simple code
change facility.
▪ Perfect for the elderly or disabled: The extra investment into a door lock could
could bring
massive advantages to those who are unable to get to the door quickly and/or who struggle
with keys.
P a g e | 19
7.2 Disadvantages
▪ Forgetful: You may be the one to forget your keys now and then, and it can be easy
eas y to
forget you PIN code for the lock and when your in a rush to get into the room or building or it
is night time and dark, you don’t want to be changing the code in the middle of the night or
when it’s raining!
raining!
▪ Keep the PIN code safe and the lock clean: Only tell the code to people who you trust, as
you don’t want a code to your property to be local news. When the lock has been used a few
too many times, the coating may start to come away or mucky fingerprints may start to occur
on the buttons. Keep the lock maintained and clean to stop unwanted people finding out the
code!
▪ Limit the PIN Code Length: Some digital door locks have a PIN code length up to 10
digits –
digits – this
this is not what you want! Digital Door Locks will be much more secure if they are
only 4 digits long. Purchase a quality lock that you can change the PIN code on, don’t buy
locks that are provided with a PIN code because people can find out the code.
P a g e | 20
CHAPTER 8
safety.
● This simple circuit can be used at residential places to ensure better safety.
● With a slight modification this Project can be used to control the switching of loads
password
through password
CHAPTER 9
P a g e | 21
CHAPTER 10
RESUL
RESU LT AND AN
ANAL
ALYSIS
YSIS
► When it is entered a 4 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 “Well come” and the
t he door will be
opened.
► If it is a wrong password user received another 3attempts to enter the correct one. If he
couldn’t enter password correctly by these attempts he have to wait 3 minutes time more to re
logged in to the system.
► After opening the door if user wants to change his password, after pressing
press ing “0” key and
giving user id user can change his password.