Image may be NSFW. Clik here to view. ![]() |
Electronic Combination lock PIC Mircocontroller |
Electronic locks are extremely useful in protecting our precious possessions and can be installed anywhere with bit of engineering in it. We are widely familiar with the Password based e-locks and might have installed in our house. But we are going for Electronic locks made by any company when you can make one by your own.
This project demonstrates you how to make a PIC microcontroller based simple digital lock and also explains the programming behind it.
WHAT YOU NEED:
- PIC 16F877 Microcontroller
- 4x3 Keypad - Key Input
- 16x2 LCD - Status Indicator
- 5V Relay - Activator
Additionally you need a POT which is used to adjust the contrast of the LCD, A transistor to drive the relay since the current obtained from a Pin of Microcontroller is very less. A diode to prevent the reverse flow of current which might damage the controller.
DESIGN:
The design of the above Embedded Project is pretty straight forward, you need to interface a LCD to PORT B and Keypad to the PORT D of the Controller. If you are not familiar with it then i suggest you to go through this Interfacing LCD and Keypad with PIC Microcontroller. Now lets see how the system is designed to work as a Locker.
- "*" Key - This key is meant to initialize the system, when the system is turned ON the Controller will scan only this key and pressing this key will enable you to enter the password for your locker.
- "#" Key - When you are done with your locker , you should press this key which will turn off the system and turning off the relay as well.
The remaining keys are meant to feed the character values to the Microcontroller and in turn the Microcontroller will analyze the characters. Based on the Pre defined password in the Controller it will compare the input with it. Thereby it will recognize the correct or incorrect password input.
CODE:
The below code was built using CCS compiler for the PIC Microcontroller
|
NOTE:
- You can add additional security by adding trial above code.
- It can be done by making the trial value to increase for every wrong password input and checking the condition whether it exceeds the desired trial value.
- Once it exceeds the desired trial value disable the keypad scan and display message "No more trials" in the LCD.
- You can also add speaker to sound a alarm once the trial exceeds to alert the people nearby.
Like this project? Share this with others through social sites and don't forget to follow us there for more of these projects.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.![]()
Image may be NSFW.Clik here to view.
Clik here to view.
Clik here to view.
Clik here to view.
Clik here to view.
Clik here to view.