Electronic lock using pic microcontroller (original) (raw)

Electronic lock using pic microcontroller and keypad. In this article, you will learn how to design electronic lock using pic16f877a microcontroller based embedded system? What are its applications? How to write its program? How to use it in any project? It is very useful for mechatronics engineering students.

What is a microcontroller based electronic lock?

This project used a password to open any lock. It can be used to make any device password protected. For example, speed control of a dc motor, home automation system, automatic doors, and Measurements systems can be made password protected, the electronic bell of school can also be made password protected using the electronic lock. So you can use microcontroller based electronic lock to make any device password protected. While working on microcontrollers based embedded system project, you may come across situation where you want an electronic device to protect from random users inputs. In such situation, you can use electronics lock. You must be wondering what is microcontroller based embedded system? Actually two types of embedded systems are used now a days; microcontroller based embedded systems and Linux-based embedded systems. But the explanation of these topics is beyond the scope of this article. I will try to write a separate article on it.

Working of Electronic lock

circuit diagram of electronics lock is shown below. Electronic lock takes inputs from the user with the help of 4X4 keypad. PIC16F877A microcontroller reads these inputs and compared it with a already stored password. Default password 1234 is stored in EEPROM of PIC microcontroller. After taking inputs from a user, these inputs are stored in array. After that microcontroller compares these arrays values with already stored valued of a default password. If both the values are equal microcontroller opens the electronic lock. Liquid crystal display is interfaced with PIC16F877A. LCD is used to display the status of password protected secured system. If user input password is equal to EEPROM stored password. Status of “access has been granted” Displayed on LCD. PIC provides instructions to LCD about what to display and what not to display. Use of LCD is optional. It is not necessary to use it. You can use a light emitting diode to display status of electronic lock. For example LED remains off when lock is closed and LED remains on when lock is open. So it’s up to you whatever you want to use. For example in **home devices control system **project, you can use password to provide access to control of devices to only specific persons.

Components used in Electronic lock

Followings are the list of components used in while it’s designing.

I can say with 100 percent confident that after learning a use of above-mentioned components, you will be able to design intelligent lock very easily.

Circuit diagram of electronics lock

It’s complete circuit diagram is shown below. As you can see all the components which I have explained above is used. There is only one extra component that is LED. LED is connected just as an option. It will turn on when locker is open and it will remain turn off otherwise.

Electronic lock using pic microcontrollers-min

I think, I have already explained each and everything of this circuit above. Nothing is left to explain. But I have also included a video lecture below. In video lecture, I have explained circuit in more details. I have also shown its real time working. I also provide details of programming in this video. Subscribe my channels on YouTube or daily motion for more video tutorials.

Program of electronic lock

Code is written using c language, because, it is easy to write code in c language. Also it is less time consuming. One of the main feature of c language is that it is portable means c code written for one microcontroller of microchip can be used for others also by making little bit changes. But in case of assembly language, one have to write complete code again and assembly code takes too much time and it is very tedious. I have tried my level best to provide you complete guide on electronic lock through this article and video tutorial. I hope you can able to write c code yourself after reading this article. But if you need code, you can contact me on my email address: microcontrollerslabhub@gmail.com. Note: contact me only, if you want to purchase code. It is not free of cost. Thanks J