Thursday, March 1, 2012

PIC Microcontroller Based Electronic Lock

 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
 

55 comments:

rabbi-bd said...

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

Vishal K M said...

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.

Nayantha Hettiarachchi said...

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

Vishal K M said...

@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.

Mustafa said...

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

riya biswas said...

is the code given full complete..?

Arduino lover said...

if you like everything related to micro-controllers visit my blog:

All about Embedded Systems

nupur said...

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

Joselito Moraes said...

which compiler did you use?

Vishal Kottarathil said...

MikroC for PIC.

Raimar Austria said...

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 =)

Vishal Kottarathil said...

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

TEHMAAS HASAN said...

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

TEHMAAS HASAN said...

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

Vishal Kottarathil said...

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

TEHMAAS HASAN said...

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

TEHMAAS HASAN said...

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

Vishal Kottarathil said...

Make sure that you included the keypad library.

احمد اسامة said...

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

TEHMAAS HASAN said...

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

WAITING FOR YOUR REPLY. THANKS

Vishal Kottarathil said...

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

TEHMAAS HASAN said...

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

preksha said...

proteus simulation code
valisha.dcosta@gmail.com

charme leizl zepeda said...

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

thank you very much!!

Seema Waghulde said...

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

Vishal Kottarathil said...

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

Vishal Kottarathil said...

No problem in the code for taking random character, it works perfectly. Is that taking randomly always? check the keypad connection. the connections in come of the available keypads are not in order, check our keypad tutorial here.

Its code protected for THREE wrong entry, after that the device cannot be accessed, you need to reset it.

All of you are welcome to our group, get the link from the above blog post.

Regards,
Vishal

Chukwunonso Okonta said...

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

Vishal Kottarathil said...

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

Vishal Kottarathil said...

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.

Vishal Kottarathil said...

Use the Discussion Group link please.

Aazib Giani said...

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

स्वप्निल कर्डिले said...

sir can you pls mail the code and proteus file

my id is
swap_k007@rediffmail.com

Fas S said...
This comment has been removed by the author.
Fas S said...

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....

Harshit Sharma said...

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

tabish Malik said...

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

micheal owen owen said...

can u sent to me the project 'code' to my email

ir_student007@yahoo.com

hope u can help me.. n_n

julius cimeni said...

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

sukrut goswami said...

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

paing khant said...

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

Vishal Kottarathil said...

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

paing khant said...

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

Sank-Ga Crewz said...

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.

Richard Boisvert said...

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

Master Keys Farmers Branch

Md.Hasan Gazi said...

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.

Safdar Rasool said...

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

ella asley said...

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.

amra omar said...

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

Vishal Kottarathil said...

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

Zhi En Yong said...
This comment has been removed by the author.
Zhi En Yong said...

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

techjfh said...

Hi,I'm very interested on the electronic lock. I would really appreciate it if you could please email me the whole project(code and simulation(proteus)). My email is ecejfh@gmail.com. Continue with your great work. Thanks

Pawan Bahuguna said...

This is a very good microcontroller based project

mangesh said...

hie sir,
i need a c program and if possible a hex file so that i can run it on proteus. indeed i tried searching the program in ur fb lick but i wasn't able to find one. hope u can send me on my mail id nivishkamdar@gmail.com

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Embedded Projects Blog Tutorials | Projects - |