Tuesday, December 21, 2010

Electronic Combination Lock Using PIC16F628A

This electronic combination lock can be use with an outdoor gate. The functionality is implemented in software. It turns on a relay (usually to open a door) for a few seconds if someone enters the valid code. The relay can operate a power to open type electric strike with a shorting contact or a power-to-hold type electromagnetic lock with a breaking contact (we need the relay because these locks usually work with AC, not DC). The code can be changed any time after entering the current code.

Current consumption of the circuit is low, because the PIC sleeps most of the time, and wakes up only for processing key presses. The 16F628A already contains an internal RC oscillator, so no crystal is needed.
  • Type in the correct code and use # as 'enter'. The initial code is 623342. You can change the length of code as well.
  • * is used to change the code. Type in the actual code then press *. If you didn't miss the actual code, the code change indicator LED will light up. Then type in the new code twice.
I am using 3x3 keypad you can also use 3x4 keypad(connect col4 with pin13) to complicate your password.

Downloads: Code files

Schematic:
Combination Lock using PIC16F628A
Components Required:
U1,                  PIC16F628A
U2,                  74HCT164
R1,                  330 ohm
R2,                  1k ohm
D1,                  Red LED
D2,                  1N4148
RL1,                 9/12v relay
Q1,                  BC547
LCD,                16x2 LCD
keypad,            3x3 / 3x4 
BUZ1,              5v buzzer  

27 comments:

  1. what about pin 13 of the pic16F628A ??
    is it connected to the line between R2 & transistor Q1? or what ??

    ReplyDelete
  2. i did all the design as the Schematic shown and upload hex to it ...

    plez can u help me about this error in protues said
    " no model specified for buz1" this is first??

    sec. hwo can i connect the relay into design and what i'll connect to it into protues to show me that the project is working well ?

    plez help me with my great thanks 4 u

    ReplyDelete
    Replies
    1. try to use 'sounder', there are lots of problems with buzzer, sounder libraries in proteus. just connect load and supply with NO, and COM terminals of the relay.

      Delete
  3. hye..i am doing a project as alike as this project.but i cant understand the program that is used in the project..can anyone help me?

    ReplyDelete
    Replies
    1. in short; a code is stored in the eeprom of pic if want to unlock or access your door or something you have to enter the exact code using keypad. also you can also change the code aswell.

      Delete
  4. please give a description about the program logic.

    ReplyDelete
    Replies
    1. are you kidding?? just read the Administrator reply; above your comment.

      Delete
  5. hello malik.... for pic it is necessory to connect crystal across pin no 15 and 16...if yes plz give the value of crystal...

    ReplyDelete
  6. crystal are used to provide clock or pulses and they are necessary to use. in this circuit me using internal oscillator of pic16f628a.

    ReplyDelete
  7. Hello i did exactly what was on the schematics, it works but when i enter the code initial "623342" with no response, likewise i tried changing the code but no response as well. Please what do you think the problem is?

    ReplyDelete
    Replies
    1. code is fine i just tested it again. try to use led and remove relay also use 4digit code for testing.

      Delete
  8. Assalamualikum Zohaib

    Plz email me the code at zfaizanz@gmail.com
    as the code download link is showing error

    ReplyDelete
    Replies
    1. link is updated, if you find error in other posts link please do inform me.
      Regards.

      Delete
  9. how to change the rar format of your source code

    ReplyDelete
  10. I used sn74hc164n ic.it will display black all the lcd display.

    ReplyDelete
  11. please email the source code..i cant view the code as the circuit simulation works juz fine using the hex file given
    gob1214@gmail.com

    ReplyDelete
    Replies
    1. Asm code is in the same folder where you found the hex file.

      Delete
  12. can u tell me plz which lcd i have 2 use?

    ReplyDelete
  13. actually i want 2 write this code in c....Can u send me code in c for same task..plz
    my email id-ankurvishwari@gmail.com

    ReplyDelete
  14. It's amazing how technology is incorporated in lock systems. We'll see how far this technology goes in the near future. Anyway, glad you've posted such information. Please keep sharing your thoughts.

    ReplyDelete
  15. It was wondering if I could use this write-up on my other website, I will link it back to your website though.Great Thanks. electronic keypad

    ReplyDelete
  16. Im no expert, but I believe you just made an excellent point. You certainly fully understand what youre speaking about, and I can truly get behind that. locksmith Leeds

    ReplyDelete