Password Based Door Lock System using 8051 Microcontroller
The Password Based Door Lock System with the 8051 Microcontroller is a simple project that uses a secure password to unlock the door. Traditional lock systems that use a mechanical lock and key mechanism are being phased out in favour of more modern locking mechanisms. These approaches are highly clever and combine mechanical and electronic devices. The simplicity and high efficiency of these unique lock systems are two of its most obvious advantages.
An electronic control assembly controls the output load via a password in such an automatic lock system. A motor, a lamp, or any other mechanical or electrical load can be used as the output load.
We created an electronic code lock system with an 8051 microcontroller (a Password based Door Lock System with an 8051 Microcontroller), which controls the load actuation. It’s a straightforward embedded system that takes input from the keyboard and acts on it.
This system uses an 8051 microcontroller to illustrate a password-based door lock system, in which the door is unlocked and the concerned individual is granted entrance to the secured area once the correct code or password is entered. If another individual arrives, it will once again prompt you to input the password. If the password is incorrect, the door will remain closed, denying the person access.
- Construction and Output Video
- Principle Behind the Circuit
- Circuit Diagram of Password Based Door Lock System
- Components Required
- Hardware Requirements
- Software Requirements
- How to Design Circuit of Password based Door Lock System?
- Password Based Door Lock System Circuit Simulation Video
- DOWNLOAD PROJECT CODE
- Password Based Door Locking System Circuit Operation
- Password Based Door Lock System Algorithm
- Advantages of Password Based Door Lock System
- Applications of Password Based Door Lock System
- Limitations of Password Based Door Lock System
Construction and Output Video
Principle Behind the Circuit
The 8051 controller is the circuit’s most important component. The password is entered using a 44 Matrix Keypad in this project. The entered password is compared to a list of predetermined passwords.
If the password is correct, the system rotates the door motor to open the door and displays the state of the door on the LCD. If the password is incorrect, the door remains closed and the LCD reads “PWD is incorrect.”
Circuit Diagram of Password Based Door Lock System
- 8051 Microcontroller
- 8051 Development Board
- 8051 Programmer
- 4×4 Matrix Keypad
- 16×2 LCD
- L293D Motor Driver Board
- DC Motor
- 10KΩ Potentiometer
- Connecting wires
- Power Supply
- If 8051 Development Board is not used, then the following components are needed.
- 11.0592 MHz Quartz Crystal
- 2 x 33pF Ceramic Capacitors
- 2 x 10 KΩ Resistor (1/4 Watt)
- 10 µF Capacitor (Polarized)
- Push Button
- 2 x 1 KΩ Resistors (for pull up)
- Keil µVision IDE
- Willar Programmer
- Proteus (for circuit diagram and simulation)
How to Design Circuit of Password based Door Lock System?
A Microcontroller, an L293D Motor Driver, a DC Motor, a 44 Matrix Keypad, and a 162 LCD are used in a password-based door lock system employing an 8051 microcontroller circuit architecture. An AT89C52 Microcontroller is utilised in this project, which is an 8-bit controller. A supply voltage of +5V DC is required for this controller. The 7805 power supply circuit is used to provide regulated 5V DC electricity to the controller. As a power source, we can utilise a 9V DC battery or a 12V 1A converter.
Reset Circuit Design:The microcontroller’s reset pin is kept active until the power supply falls within the prescribed range and a minimum oscillation level is achieved. To ensure that the supply voltage does not fall below the 1.2V threshold level and that the reset pulse width is more than 100ms (as recommended for the 89C52), we must choose resistor and capacitor values so that RC >=100ms. As a result, a 10K resistor and a 10F electrolytic capacitor were chosen.
Oscillator Circuit Design:The external clock signal for the microcontroller is provided by an 11.0592MHz crystal oscillator. Two ceramic capacitors in the 30pF to 40pF range must be connected to ensure smooth functioning. The crystal oscillator is attached to the microcontroller’s pins 18 and 19. We utilised two 33pF capacitors in this example.
Interfacing LCD, Keypad and Motor Driver:
To begin, attach a 10K potentiometer to the LCD Display’s Contrast Adjust Pin (Pin 3). P3.0, GND, and P3.2 pins are used to link the LCD’s RS, RW, and E. The LCD’s eight data lines are attached to PORT1.
The Keypad’s four ROW pins are attached to P2.0 to P2.3, while the Keypad’s four COLUMN pins are connected to P2.4 to P2.7, respectively. IN1 and IN2 of the L293D Motor Driver (1A and 2A) are linked to PORT0 pins P0.0 and P0.1. The motor is linked to the L293D’s OUT1 and OUT2 (1Y and 2Y) pins.
Compilation of Microcontroller Code:
The next stage is to write and build the code after the circuit has been developed and drawn on paper. To write the application in C language, we used the Keil Vision package.
General tasks such as creating a new project and selecting the target device or needed microcontroller must be followed before writing the code. We need to save the code with a.c extension and then add it to the source file group beneath the target folder once it’s finished. By pressing the F7 key, the code is then compiled.
A hex file is created once the code has been compiled. The circuit is then drawn using Proteus software in the next stage. An external device is used to dump the code into the microcontrollerWillar Software and programmer.
Password Based Door Lock System Circuit Simulation Video
Before reading about how this circuit works, watch the simulation video below to gain a better understanding of how it works.
Password Based Door Locking System Circuit Operation
When the circuit is turned on, the microcontroller sends orders to the LCD, which causes the LCD to show “enter password.” Now we must use the keypad to input the password. When the password is input, the LCD shows 5 stars, indicating that the controller has successfully read the password.
The controller now compares the entered password to the password that was previously set. If the password is correct, the microcontroller sets P0.0 to HIGH and P0.1 to LOW, allowing the motor driver to receive input signals for forward motion.
As a result, to open the door, the Door Motor rotates in a forward motion. The microprocessor makes P0.0 LOW and P0.1 HIGH after a 10-second delay, allowing the motor driver to receive input signals for reverse motion. As a result, the Door motor closes the door by rotating in the opposite direction.
If the password is not entered correctly, the microcontroller keeps both P0.0 and P0.1 low. As a result, the door motor remains stationary, allowing the door to remain closed.
NOTE: Make sure there are no common connections between the AC and DC supplies while making the connections.
Password Based Door Lock System Algorithm
- Declare the PORT1 to be LCD data pins and the control pins (RS and E) to be P3.0 and P3.2 at first. Declare PORT2 on the keypad as well. P0.0 and P0.1 can also be used for the motor driver.
- Then, on the LCD, display the message “input password.”
- Now take the user’s five-digit password.
- Compare the password you entered with the password you saved.
- Make P0.0 pin HIGH and P0.1 pin LOW to open the door if the password is right. Display “Door opening” on the LCD during this moment.
- Make P0.0 pin LOW and P0.1 pin HIGH to close the door when some time has passed, and then show “Door closing” on the LCD.
- If the password is incorrect, the LCD will display “Wrong Password.”
- After some time has passed, you will be asked to enter your password once more.
Advantages of Password Based Door Lock System
- This project ensures safety.
- The amount of energy used is reduced.
- Components that were readily accessible
- The project is basic and straightforward.
Applications of Password Based Door Lock System
- This basic circuit can be used to improve safety in residential areas.
- It can be used in businesses to ensure that only authorised people have access to extremely guarded areas.
- With a little tweaking, this project may be used to control load switching through password.
Limitations of Password Based Door Lock System
- It is a low-range circuit, which means it cannot be controlled remotely.
- It is impossible to open the door if you forget the password.