Electronic digital lock using the 8051 microcontroller and keypad

electronic lock using 8051

In this article, we will make an electronic digital lock using the 4×3 keypad and 8051 microcontroller, basically, an electronic lock is password protected lock and it is an application of a keypad.
Door lock system is an example of the electronic lock and its protected by a password, which only unlocks with a specific password and operated by electricity with the help of assessing control system (MCU).

Project Description

Here I have created an electronic lock using the 8051 microcontroller and 4×3 keypad.
In this project keypad use as the input device and a 16×2 alphanumeric LCD use as the output device. When the user presses the keys of keypad then microcontroller read the value of the pressed key and display it on LCD.
Here I have already saved the password in the program when the user enters the value from the keypad, then we simply store these entered value into a buffer and compare it with the stored password.
If they are matched together then we display a “WELCOME” message on LCD and move the motor to unlock the electronic lock. Instead of, if user entered value does not match with stored password then display “WRONG PASSWORD” message on LCD.

Suppose in the program I have stored the password value “12345”. So when the user wants to unlock the electronic lock, then he has to enter the value “1234” from the keypad. However, if the user does not enter the value “12345”, then he will be unable to unlock the electronic lock.

Required components for electronic lock

1.Microcontroller (AT89s52)
2.LCD 16×2
3.Keypad 4×3
4.Oscillator (12 MHz)
5.Ceramic capacitor (22 PF – 2)
6.Cell (power supply)
7.ULN 2003A
9.Stepper motor
10.Connecting wire
11.Resistor(10,1.2  k-ohm)

Circuit connection of digital electronic lock

In below image, I have described the simple connection of numeric keypad, LCD and stepper motor with the 8051 micro-controller.

Connection of lcd and keypad

If you want to learn more about the c language, here 10 Free days (up to 200 minutes) C video course for you.

Your free trial is waiting

Sample program for electronic lock using the 8051 microcontroller

Working of electronic lock

Check out the below video to understand the working of the electronic lock.

Your opinion matters

Here I have tried to explain the interfacing of keypad and LCD and tried to create a sample project.I would like to know your thought about the above-discussed topic, so please don’t forget to write the comment in a comment box.


Leave a Reply