PIC Microcontroller Based Electronic Lock (PIC16F877A) | Arrogance Gizmo

PIC Microcontroller Based Electronic Lock (PIC16F877A)

Friday, 2 March 2012
 Circuit Diagram

Security is a prime concern in our day-today life. Everyone wants to be as much secure as possible. An access control for doors forms a vital link in a security chain. The microcontroller based digital lock for Doors is an access control system that allows only authorized persons to access a restricted area.
An electronic lock or digital lock is a device which has an electronic control assembly attached to it. They are provided with an access control system. This system allows the user to unlock the device with a password. The password is entered by making use of a keypad. The user can also set his password to ensure better protection. The major components include a Keypad, LCD and the controller PIC16F877A. This article describes the making of an electronic code lock using the 16F877A microcontroller.

The system is fully controlled by the 8 bit microcontroller 16F877A which has a 8Kbytes of ROM for the program memory. The password is stored in the EPROM so that we can change it at any time. The system has a Keypad by which the password can be entered through it. When the entered password equals with the password stored in the memory then the relay gets on and so that the door is opened.

The code is built in a modular style to allow a user to find ways to modify  project. In start the D Lock programs loads with a default code of "2345" format is *2345# which can be enter to unlock the door, the code cam be change by entering the master code in the format *23455#new 4 digit code.  In this program i only display the result on LCD and lock will be  placed at   PORTA bit 0 where i put led for simulation. 



A 4x3 matrix keypad and a 16x2 LCD have been used here. Keypad and LCD are very commonly used input & output devices, respectively. The password is stored in the system EEPROM.
While unlocking, if the entered password from keypad matches with the stored password, then the lock opens and a message is displayed on LCD. Also an output pin is made high to be used for further purpose..

As the program starts, wait for 5sec and press * string ‘Enter Password’ is displayed on LCD. The keypad is scanned for pressed digits one by one. Every time, row and column of the key pressed is detected and is displayed on LCD. After the four digits are entered, the user should press # to Confirm Password and again the input is taken through LCD. If the passwords do not match, a message is displayed to indicate ‘Access Denied’ otherwise the ‘Access Granted’ message.

The default password is 2345 and master key to change password is 23455., entry begins with * and stops with #.

Update 28-8-2013

 1. Here two circuit are provided, the smaller one works only for 

simulation and the larger one works only    in real world( Problem

with Pull Down resistors)

2. Due to frequent Requests I have Uploaded the HEX(8Mhz Crystal) file of these project in Our Facebook Group-Click Here

Code 

 

  Discussion Group




Facebook Page                                                                                                                  Contents Page

 


Check Our New Blog: Embedded Projects-Tutorials-Arduino-Android-Raspberry PI- Gadgets News - Embedded Hackes - New Embedded Products Intro etc 

 (click the Image Below to Visit the Blog)

www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CCoQFjAA&url=http%3A%2F%2Farrogancegizmo.blogspot.com%2F&ei=SMaRUsGzCYj_rAfA-4GoDw&usg=AFQjCNEw6Pm6VepdEnZlm1evPy5f0N2NdA&sig2=sG5PkXDQilaUfIan6u2Wzw&bvm=bv.56988011,d.bmk
 

Comments

50 Comments

RSS
  1. Password should not be displayed on LCD. It is not secured. **** can be displayed instead.

    ReplyDelete
    Replies
    1. Thank you foe your advise. This project is designed as an academic project. Simplicity is for the ease of demonstration. And added a buzzer and some more features to it. If anybody enter wrong password more than three times, the buzzer sounds continuously and system should be restarted.

      Delete
  2. i have a problem. i designed a system using this code. but it cant simulate in real simulation

    ReplyDelete
  3. @Nayantha
    Its working no problem. I will send the whole project in proteus. You should use pull downs for all pins connected to keypad in a real design.

    ReplyDelete
    Replies
    1. nupsangel05@gmail.com
      really interested to kjnow the deatails of this project..so pls send me here..

      Delete
  4. thanks for this great idea
    but i need this programs in Mikrobasic can you get it for me??

    ReplyDelete
  5. is the code given full complete..?

    ReplyDelete
  6. can u pls send me the whole project in proteus? because it is my project now and i have a problem about the circuit. I don't know where do i put the oscillator, the resistor in keypad and its value? and where do i put the L7805 5V output to pic? I hope you send it to me immediately because the deadline of my project is on OCT.12(Friday). thank you for your electronic lock =)

    ReplyDelete
    Replies
    1. @ Raimar : Please check this link
      http://www.facebook.com/photo.php?fbid=367276126688130&set=a.258302774252133.62236.258274150921662&type=1&relevant_count=1

      Delete
  7. THANK YOU FOR THIS SUCH A GOOD COMPILATION OF PROJECTS. CAN YOU MAIL ME. THIS PROJECT CODING ON NOTEPAD.

    MY EMAIL ADDRESS IS

    cheez.wheelz@gmail.com

    ReplyDelete
  8. THANK YOU FOR YOUR QUICK REPLY. IF I WANT TO USE 4X4 KEYPAD WHAT CHANGES ARE EXPECTED.

    ReplyDelete
    Replies
    1. connect the 4th column to 4th(1,2,3,4) pin of the keypad port, and make required change in program.

      Delete
  9. greeting

    i am having a problem while compiling this code at mikroc version 8.2. it is giving an error char keypadPort at PORTD; on this line.

    i really want to compile it and need its hex file.

    please help

    ReplyDelete
  10. GREETINGS ONCE AGAIN

    I have tried your code many times to compile. please help me why it is not compiling my compiler is working fine.

    PLEASE REPLY AS SOON AS POSSIBLE

    ReplyDelete
  11. Make sure that you included the keypad library.

    ReplyDelete
  12. can you end to me the code please
    eng_ahmed_osama@hotmail.com

    ReplyDelete
  13. Please tell me the library file for keypad.. and what more header files are to be included.

    WAITING FOR YOUR REPLY. THANKS

    ReplyDelete
    Replies
    1. You can see Library Manager tab left of the project window. Check the check box of required libraries.

      Delete
  14. GREETINGS MY PROBLEM REGARDING ITS SIMULATION IS SOLVED THANKS FOR YOUR HELP. NOW SOME THING WHICH IS NOT SUPPOSED TO BE OCCURRED IS BEING OCCURRED.

    WHEN THE SIMULATION STARTS THE LED AT PORT A pin 0 starts glowing but instead it should glow when ACCESS is being granted. before it must not glow. If am right then please provide appropriate solution. else guide me what is the real logic behind it.

    PLEASE REPLY AS SOON AS POSSIBLE
    wait

    ReplyDelete
  15. proteus simulation code
    valisha.dcosta@gmail.com

    ReplyDelete
    Replies
    1. Hello,
      Sorry the file is missing, i will try to build a new one. Sorry for late reply.

      Delete
  16. sir can you also send me the proteus file?
    here's my email betoy.aguila@gmail.com

    thank you very much!!

    ReplyDelete
    Replies
    1. Hello,
      Sorry the file is missing, i will try to build a new one. Sorry for late reply.

      Delete
  17. my lcd is taking random data after "Enter Code" an after 3 attempts shows Access denied

    ReplyDelete
  18. Greetings,
    Please, can you mail me the pdf of the project, and if you do...would it be ok if I modify it while practicing?

    wi.turtlez@gmail.com

    Also, I've been given a project on
    "Microcontroller based electronic locking system module"
    ...and I'm not really sure how to go about it....can you help.
    Thanks,
    Chuck Konta

    ReplyDelete
    Replies
    1. I had written only this much of matter, so there is no PDF available. I hope the above explanation is enough. There is no problem for using the code or design, but if you post this project somewhere please add a reference.

      Delete
    2. Use the Discussion Group link please.

      Delete
  19. can you plz send me proteus file...i am having difficulty in making 1....
    what does the circuit U1 do thats on top right if the figure..
    aazib.gil@gmail.com

    ReplyDelete
  20. sir can you pls mail the code and proteus file

    my id is
    swap_k007@rediffmail.com

    ReplyDelete
  21. This comment has been removed by the author.

    ReplyDelete
  22. hello .... i tried your code and it compiles just fine but i can't seem to simulate it in proteus .... could you please send me the whole project(code and simulation ) on fasika47@gmail.com
    .i would be really great-full....

    ReplyDelete
  23. can you please send me proteus file at harshits996@gmail.com

    ReplyDelete
  24. kindly send me proteus file at focusme19@gmail.com...

    ReplyDelete
  25. can u sent to me the project 'code' to my email

    ir_student007@yahoo.com

    hope u can help me.. n_n

    ReplyDelete
  26. please send the project code in notepad and proteus file. thank you.
    julius_cimeni@yahoo.com

    ReplyDelete
  27. can u pls mail the program code my id is
    sukrut_goswami@yahoo.com

    ReplyDelete
  28. Hello,Sir

    Thanks for yr sharing.
    I already chosen this project as my school final project.
    Please send me this source in C (.txt) , other .pdf files and useful references links to my mail: paing.peace@gmail.com.

    Thanks for yr kindness.
    Paing Khant

    ReplyDelete
  29. There is a link posted at the end of the article, you can download HEX file and C file (From Facebook Group).

    ReplyDelete
  30. Sir, i can't download from http://www.scribd.com/doc/86640317/Electronic-Code-lock.
    i cannot purchase thus also cannot download because of our country. Can't do copy/paste. But i read and typed in Notepad and complied in mikroC Pro. when write, occur 4 data error. So please send me Source Code in C with Notepad.
    i downloaded HEX file from FB Group.
    Thanks a lot,sir

    ReplyDelete
  31. sir im really cant access the facebook link...can u send the source code to my emaIl (sunkgacrewz22@gmail.com) asap..please sir..im doing this project for my final year. hOpe u will help me.

    ReplyDelete
  32. Does it work well? Could it surely secure anyone's home?

    Master Keys Farmers Branch

    ReplyDelete
  33. Is the upper portion of the circuit given at the right corner of the application circuit
    necesary?Those who have worked with this circuit please help me.

    ReplyDelete
  34. please do you PIC code of conveyor belt project. if you have. please send me safdar.rasul@gmail.com

    ReplyDelete
  35. That's an awesome concept with microcontrollers. Security system is very essential in each and every technology nowadays. Password must be complex and should not be in an easy way to analyse by anyone. PIC microcontroller is used to perform various kinds of tasks which is used control a production line and microcontrollers are programmed as timers. It is used in control systems such as door lock mentioned in the blog, alarm system, phones,etc.

    ReplyDelete
  36. I have a problem with "FF", I received this message " Undeclared identifier 'FF' in expression

    ReplyDelete
  37. Check for FF in the program.
    I can identify it if you paste the code snippet here.

    ReplyDelete
  38. This comment has been removed by the author.

    ReplyDelete
  39. Can u send to me the PIC source code ...thanks
    Email: max_yong1994@hotmail.com

    ReplyDelete

Copyright @ 2013 Arrogance Gizmo |

Follow Us On Facebook

Labels

.Net (2) 1 KM Range Wireless (1) 16x2 Character LCD (9) 2 UART (1) 4x3 Keypad (1) 4x4 keypad (1) 8051 (5) 8051 Project (2) 8051 Projects (1) 8051 Tutorial (3) 89C51 (4) 89C51 Project (2) 89S51 (1) 89S52 (1) Additional UART (1) Android (3) Android AVD (1) Android Programming Tutorial (1) Android Tutorial (2) Arduino Board (1) ARM Projects (1) Atiny (1) Atmega8 (1) AVR (5) AVR Projects (1) Build From Scratch (1) C# (1) C# Serial Port (2) C# serial Terminal (1) C# Voltmeter (1) Camera (1) Clock (1) Digital Voltmeter (2) Digital watch (1) DIY (2) EEPROM (2) Electronic code lock (1) Embedded (16) Embedded Project (9) Embedded Projects (2) Embedded Tutorial (12) Embeded (4) Extra UART (1) Flutter (1) Getting Started With Android (2) Home Security (1) Internet Based Device Control (1) Java of Things (1) Keypad (1) Keypad Tutorial (1) LCD (6) LCD Tutorial (4) Linux (1) Lock (1) LPG Sensor (1) MAX232 (3) Microcontroller (14) Microcontroller generates sound (1) Microcontroller Interrupt (1) Microcontroller Project (5) Microcontroller Tutorial (11) Microcontroller Tutorial. 8051 Tutorial (1) Mikoc 4 Bit LCD (3) MikroC (14) MikroC AVR (3) MikroC AVR Tutorial (3) MikroC EEPROM (2) MikroC for 8051 (4) MikroC Getting Started (1) MikroC PIC Tutorial (6) MikroC Tutorial (3) Motor Control (1) NETMF (1) New Embedded Boards (2) Optical Mouse (1) Optical Mouse To Camera (1) Password Lock (1) PC Based Voltmeter (1) PIC (7) PIC Based Electronic Lock (1) PIC 12F629 (1) PIC ADC (2) pic interrupt (1) PIC Music (1) pic project (1) PIC Projects (1) PIC sound melody (1) PIC Tutorial (3) PIC UART (1) PIC Voltmeter (2) Project (8) Quadcopter (1) Real Time Monitoring (1) RF (1) Robotic Projects (1) RS 232 (1) Run Android On PC (1) Security System (1) Serial Communication (3) Single Bord Computer (1) Smart home (1) Smart Home Project (1) STM32 (4) STM32F4 (3) STM32F4 Discovery (3) STM32F4 Project (1) STM32F4 Tutorials (3) STMicroelectronics (1) Temperature Sensor (2) Timer (1) Tutorial (8) UART (6) Udoo (1) USB (1) USB to RS 232 (1) USB to UART (1) VISUAL STUDIO (1) Water Level Control (1) WiFi (1)

Search This Blog

Popular Posts