Password Based Door Lock System Using 8051 Microcontroller
Password Based Door Lock System Using 8051 Microcontroller
Project Report
Submitted in Partial Fullfilment of the Requirements for the
Degree of Bachelor of Technology
in
Electronics and Communication Engineering
under
Maulana Abul Kalam Azad University of Technology
By
Mou Chowdhury
Sushama Ganguly
Debosree Sahoo
Ranjabati Ghosh
Our Parents
CERTIFICATE OF APPROVAL
I hereby recommend that the work in preparing the seminar report entitled “PASSWORD BASED
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 – 700150
………………………………………………..
Prof. (Dr.) S. Ray. Chaudhuri
Director
Meghnad Saha Institute of Technology
Kolkata – 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 all 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 – Sushama Ganguly
Roll No- 14200316010 Roll No.- 14200316001
Reg. No- 161420120011 Reg. No.- 161420120020
................................................... ................................................
Name – Debosree Sahoo Name – Ranjabati Ghosh
Roll No.- 14200316011 Roll No.- 14200316009
Reg. No.- 161420120010 Reg. No.-161420120012
Page |i
ABSTRACT
Security is a prime concern in our day-today life. Everyone wants to be as much security as
possible. An access control for doors forms a vital link in a security chain. The
microcontroller based Door locker is an access control system that allows only authorized
persons to access restricted area. The system is fully controlled by the 8 bit microcontroller
AT89C2051 which has a 2Kbytes of RAM for the program memory. The password is stored
in the EPROM so that we can change it at any time. The system has a Keypad by which the
password can be entered through it. When they entered password equals with the password
stored in memory then the relay gets on and so that the door is opened. If we entered a wrong
for more then three times then the Alarm is switched on. When we go inside and come back
then the microcontroller will sense the person using the Laser light, the microcontroller will
automatically open the door for you.
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............................................... 4
2.3 Transistor............................................... 5
CHAPER 3. HARDWARE AND
3.1.7. DC Motor............................................................ 12
LIST OF FIGURES
1.2 Block Diagram of Password Based Door Lock System ………. 2
INTRODUCTION
In day of day life security of any object or place is plays a major role. This project has
considered about that and created a secure access for a door which needs a password to open
the door. Using keypad it enters a password to the system and if it is entered correctly door is
open by motor which is used to rotated the handle of the door lock. It will give three attempts
to enter the password when it is entered incorrectly at the first time. Some features like
adding new users and changing old password are configure by the keypad. LCD module is
used to display messages to the user. Now a day’s most of the system are automated in order
to face new challenges and present day requirements to achieve good result. Automated
systems have less manual operation, so that the flexibility, reliabilities are high and accurate.
Hence every field prefers automated control systems, especially in the field of electronics.
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.
Page |1
1.2 Principle behind the Circuit
The main component is the circuit is 8051 controller. In this project a 4*4 Matrix
Keypad is used to enter the password. The password which is entered is compared
with the predefined password.
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 closed and
displays “PWD is wrong” on LCD.
Page |2
CHAPTER 2
HARDWARE COMPONENTES
2.1 Resistor
A resistor is a passive two-terminal electrical component that implements electrical
resistance as a circuit element. In electronic circuits, resistors are used to reduce
current flow, adjust signal levels, to divide voltages, bias active elements, and
terminate transmission lines, among other uses. High-power resistors that can
dissipate 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 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.
Resistors are common elements of electrical networks and electronic circuits and are
ubiquitous in electronic equipment. Practical resistors as discrete components can be
composed of various compounds and forms. Resistors are also implemented
within integrated circuits.
Page |3
2.2 Capacitor
A capacitor is a passive two-terminal electronic component that stores electrical
energy in an electric field. The effect of a capacitor is known as capacitance. While
some capacitance exists between any two electrical conductors in proximity in
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 used
in many languages, but not in English.
The physical form and construction of practical capacitors vary widely and
many capacitor types are in common use. Most capacitors contain at least
two electrical conductors often in the form of metallic plates or surfaces separated by
a dielectric medium. A conductor may be a foil, thin film, sintered bead of metal, or
an electrolyte. The non conducting dielectric acts to increase the capacitor's charge
capacity. Materials commonly used as dielectrics include glass, ceramic, plastic
film, paper, mica, and oxide layers. Capacitors are widely used as parts of electrical
circuits in many common electrical devices. Unlike a resistor, an ideal capacitor does
not dissipate energy.
The transistor is the fundamental building block of modern electronic devices, and is
ubiquitous in modern electronic systems. Julius Edgar Lilienfeld patented a field-effect
transistor in 1926 but it was not possible to actually construct a working device at that time.
The first practically implemented device was a point-contact transistor invented in 1947 by
American physicists John Bardeen, Walter Brattain, and William Shockley. The transistor
revolutionized the field of electronics, and paved the way for smaller and
cheaper radios, calculators, and computers, among other things. The transistor is on the list of
IEEE milestones in electronics, and Bardeen, Brattain, and Shockley shared the 1956 Nobel
Prize in Physics for their achievement.
Most transistors are made from very pure silicon or germanium, but certain
other semiconductor materials can also be used. A transistor may have only one kind of
charge carrier, in a field effect transistor, or may have two kinds of charge carriers in bipolar
junction transistor devices. Compared with the vacuum tube, transistors are generally 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
Page |5
CHAPTER 3
● 8051 Microcontroller
● 8051 Programmer
● 16*2 LCD
● DC Motor
● 10KΩ Potentiometer
● Connecting Wires
● Power Supply
● If 8051 Development Board is not used, then the following components are needed
● Push Button
Page |6
3.1.1 8051 Microcontroller
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 together through the system bus.
Page |7
3.1.2 8051 Development Board
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 bridge rectifier allow this board to be powered
with both AC and DC power supply adapters.
MAIN FEATURES:
I/O Features
Page |8
3.1.3 8051 Programmer
The microcontroller program comprises a set of instructions written by the program designer.
There are four classes of instructions:
1. Arithmetic operations
2. Logic operations
4. Branch operations.
In computing, logical operations are necessary because they can be used to model the way
that information flows through electrical circuits, such as the circuits inside a CPU. These
types of operations are called Boolean operations.
The elements in a circuit which behave according to Boolean logic are called logic gates.
Page | 9
3.1.3.3. Data transfer operations
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.
Page | 10
3.1.5. 16*2 LCD
We come across LCD displays everywhere around us. Computers, calculators, television sets,
mobile phones, digital watches use some kind of display to display 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 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.
Features
Page | 11
3.1.6.1 Image of L293D Motor Drive Board
3.1.7 DC Motor
A DC motor is any of a class of rotary electrical machines that converts direct current
electrical energy into mechanical energy. The most common types rely on the forces
produced by magnetic fields. Nearly all types of DC motors have some internal mechanism,
either electromechanical or electronic, to periodically change the direction of current flow in
part of the motor.
DC motors were the first type widely used, since they could be powered from existing direct-
current lighting power distribution systems. A DC motor's speed can be controlled over a
wide range, using either a variable supply voltage or by changing the strength of current in its
field windings. Small DC motors are used in tools, toys, and appliances. The universal
motor can operate on direct current but is a lightweight brushed motor used for portable
power tools and appliances. Larger DC motors are used in propulsion of electric vehicles,
elevator and hoists, or in drives for steel rolling mills. The advent of power electronics has
made replacement of DC motors with AC motors possible in many applications.
Page | 12
3.1.7.1 Image of DC Motor
The measuring instrument called a potentiometer is essentially a voltage divider used for
measuring electric potential (voltage); the component is an implementation of the same
principle, hence its name.
Potentiometers are commonly used to control electrical devices such as volume controls on
audio equipment. Potentiometers operated by a mechanism can be used as
position transducers, for example, in a joystick. Potentiometers are rarely used to directly
control significant power (more than a watt), since the power dissipated in the potentiometer
would be comparable to the power in the controlled load.
Page | 13
3.2 Software Requirements
● Willar Programmer
The µVision Debugger provides a single environment in which you may test, verify, and
optimize your application code. The debugger includes traditional features like simple and
complex breakpoints, watch windows, and execution control and provides full visibility to
device peripherals
Page | 14
CHAPTER 4
PROPOSE DESIGN
Password based door lock system using 8051 microcontroller circuit design uses five major
components- a Microcontroller, an L293D Motor Drive, a DC Motor, a 4*4 Matrix Keypad
and a 16*2 LCD. Here, an AT89C52 Microcontroller is used and it is an 8-bit controller. This
controller required a supply voltage of +5V DC. In order of 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.
Page | 15
4.1.3 Interfacing LCD, Keypad and Motor Driver
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.
Page | 16
CHAPTER 5
Once the circuit is powered ON, microcontroller sends commands to the LCD to display
“enter 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 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, the Door motor rotates in reverse direction 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.
Page | 17
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.
► If password is correct, then make P0.0 pin HIGH and P0.1 pin LOW to open the
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
after this display “Door closing” on LCD.
P a g e | 18
CHAPTER 7
7.1 Advantages
▪ Pick-proof: Because there is no place for a key with these locks, the prevent break-ins
because burglars are unable to pick or ‘bump’ the lock. Criminals methods of breaking and
entering are improving and the majority of criminals can pick an ordinary key lock.
▪ No More Keys: You won’t have to carry around a large set of 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 of anything getting stolen. It is
incredibly easy to change the PIN code whenever you like. The combination door locks from
The Workplace Depot have over 8,000 possible code combinations with a simple code
change facility.
▪ Aesthetically Pleasing: Door locks can come in a range of stylish colours that look smart
and professional. At The Workplace Depot, we sell mechanical digital door locks in a choice
of 3 colours, brass, chrome and satin chrome.
▪ Perfect for the elderly or disabled: The extra investment into a door lock 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 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!
▪ 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!
▪ Power Failure: Some digital door locks are powered by electricity, if your house or
building has a power failure, then the door lock will not work which restricts you from
entering the building. Buying a mechanical or battery powered lock will not affect you if
there is a power failure.
▪ Limit the PIN Code Length: Some digital door locks have a PIN code length up to 10
digits – 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
● 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
through password
CHAPTER 9
● It is a low range circuit, i.e. it is not possible to operate the circuit remotely.
P a g e | 21
CHAPTER 10
► 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 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 “0” key and
giving user id user can change his password.
► If user wants to add more people to the system after opening the door pressing “#” key,
user can add more users. System will give user id to each password.
► When it make any mistake while entering the password user can delete it by using “*” k
P a g e | 22
CHAPTER 11
CONCLUTION
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.
P a g e | 23
References
[ 1] Technology Intelligent Home: SMS Based Home Security System with Immediate Feedback International
Journal Of Advance Research In Science And Engineering http://www.ijarse.com 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. 1080-1083, 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-Arizona, 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 Engineering, Volume 2,
Issue 10, October 2012.
[ 8] Mukesh Kumar Thakur, Ravi Shankar Kumar, Mohit Kumar, Raju Kumar ―Wireless Fingerprint Based
Security System using Zigbee‖ , International Journal of Inventive Engineering and Sciences (IJIES) ISSN:
2319–9598, Volume-1, 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.
P a g e | 24