Projects   /   LED Projects

Password Based Door Lock System using 8051 Microcontroller

Traditional lock systems using mechanical lock and key mechanism are being replaced by new advanced techniques of locking system.

Published

At a glance

CategoryLED Projects
IncludesProteus
Reading time~7 min
Jump to a section
  1. Password Based Door Locking System Circuit Operation
  2. Advantages of Password Based Door Lock System
  3. Applications of Password Based Door Lock System
  4. Limitations of Password Based Door Lock System
  5. Quick Solutions to Questions related to Password Based Door Lock System:
  6. Related projects

Summary of Password Based Door Lock System using 8051 Microcontroller

This article describes a password-based automatic door lock using an AT89C51 (8051) microcontroller, 4×3 keypad, LCD, relay, and DC motor. The system compares entered codes to a stored password, opens the door on a match (motor forward), waits, then reverses the motor to close; on mismatch it denies access. It covers hardware and software requirements, circuit design (power, reset, oscillator), coding and simulation steps, operation algorithm, advantages, applications, and limitations.

Parts used in the Password Based Door Lock System:

  • AT89C51 controller
  • 8051 programming board
  • Programming cable
  • DC battery or 12V,1A adaptor
  • 4×3 matrix keypad
  • 16×2 LCD
  • 5V Relay
  • DC motor
  • BC547 Transistor
  • 10k resistor (1/4 watt)
  • 330 Ω resistor (1/4 watt)
  • 10uF electrolytic capacitor
  • 33pF capacitors (2)
  • 12MHz Crystal
  • Pot 10k (1/4 watt)
  • Connecting wires

https://youtu.be/b-AO1Ra0DC4

Password Based Door Locking System Circuit Operation

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 the motor driver gets the input 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 10seconds, the microcontroller makes P0.0 LOW and P0.1 HIGH, so the motor driver 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 connections, make sure that there is no common connection between AC and DC supplies.

Buy Course along with Code: Password Based Door Lock System »

Password Based Door Lock System Algorithm

  1. 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.
  2. Then, display the message “enter password” on LCD.
  3. Now read the five digit password from the user.
  4. Compare the entered password with the stored password.
  5. 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.
  6. 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.
  7. If the password is wrong, then display “Wrong Password” on LCD.
  8. After some delay again ask to enter password.

[Also Read:Adjustable Timer With Relay Output]

Advantages of Password Based Door Lock System

  • This project provides security
  • Power consumption is less
  • Used commonly available components
  • Project is simple and easy

Applications of Password Based Door Lock System

  • This simple circuit can be used at residential places to ensure better safety.
  • It can be used at organizations to ensure authorized access to highly secured places.
  • With a slight modification this Project can be used to control the switching of loads through password.

Limitations of Password Based Door Lock System

  • It is a low range circuit, i.e. it is not possible to operate the circuit remotely.
  • If you forget the password it is not possible to open the door.
  • What microcontroller is used in the project?
    The AT89C51 8051 microcontroller is used.
  • How is the user input provided?
    User input is provided via a 4×3 matrix keypad.
  • How does the system indicate password entry on the LCD?
    It displays five stars on the LCD to indicate the controller read the password.
  • What happens when the entered password matches the stored password?
    The microcontroller makes P0.0 HIGH and P0.1 LOW to drive the motor forward to open the door, then reverses after a delay to close it.
  • What happens when the entered password is wrong?
    The microcontroller keeps P0.0 and P0.1 LOW so the door motor remains stationary and displays Wrong Password on the LCD.
  • What power supply is recommended for the controller?
    A regulated 5V DC supply is required, typically from a 7805 regulator fed by a 9V battery or 12V,1A adapter.
  • Which software tools are used for coding and simulation?
    Keil uVision is used to write and compile code, Flash Magic for programming, and Proteus for simulation.
  • How is the reset circuit designed for the 89C51?
    Reset uses an RC such that RC >= 100ms; the article selects a 10k resistor and 10uF capacitor.
  • What components form the oscillator circuit?
    A 12MHz crystal with two ceramic capacitors (20pF to 40pF range) connected between pins 18 and 19 form the oscillator.
  • What are the main advantages of this project?
    It provides security, low power consumption, uses commonly available components, and is simple to build.
Ibrar Ayyub

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough...