Digital code lock

Description.
This is a simple but effective code lock circuit that has an automatic reset facility. The circuit is made around the dual flip-flop IC CD4013.Two CD 4013 ICs are used here. Push button switches are used for entering the code number. One side of all the push button switches are connected to +12V DC. The remaining end of push buttons 2,3,6,8 is connected to clock input pins of the filp-flops. The remaining end of other push button switches are shorted and connected to the set pin of the filp-flops.
The relay coil will be activated only if the code is entered in correct sequence and if there is any variation, the lock will be resetted. Here is correct code is 2368.When you press 2 the first flip flop(IC1a) will be triggered and the value at the data in (pin9) will be transferred to the Q output (pin13).Since pin 9 is grounded the value is “0” and so the pin 13 becomes low. For the subsequent pressing of the remaining code digits in the correct sequence the “0” will reach the Q output (pin1) of the last flip flop (IC2b).This makes the transistor ON and the relay is energised.The automatic reset facility is achieved by the resistor R11 and capacitor C2.The positive end of capacitor C2 is connected to the set pin of the filp-flops.When the transistor is switched ON, the capacitor C2 begins to charge and when the voltage across it becomes sufficient the flip-flops are resetted. This makes the lock open for a fixed amount of time and then it locks automatically. The time delay can be adjusted by varying the values of R11 and C2.

Circuit diagram with Parts list.



Notes.

  • Assemble the circuit on a good quality PCB.
  • The circuit can be powered from 12V DC.
  • Mount the ICs on holders.
  • The L1 can be a 12V, 200 Ohm SPDT relay.
  • Capacitor C1 should be tantalum type.
  • The C1 and C2 must be rated at least 25V.
Show Comments

52 thoughts on “Digital code lock

  1. kid desperate

    good day. i have a project digital combination code lock due tomorrow, pls help me. someone made fun of my schematic diagram and swtiched the pins intended for the LCD and for the keypad. now im having a very hard time programming the PIC and header since the pin configurations are all messed up. pls help… look at my name. I am using a PIC16F877 with 2X16 4-bit LCD based display. and 3X4 4 bit keypad with decoder. God speed!

    Reply
  2. rost

    sir i hav been working on this project for 1 week, without the reset circuit its working fine, but once it is included the relay is not being energised,pls help sir

    Reply
  3. shally

    Sir, I have been working on this project for two days. All connections are
    made accordingly to your diagram. I also implemente it on multisim. Its working fine on that.But when I implementing on breadboard even the IC doesnt support output is constant and not varying with changing the clock cycles.
    Please help

    Reply
  4. shally

    Could you please submit a simulation of this circuit using multisim .
    I am facing this problem but i am simulating the exact circuit what is given Please Help!!

    Reply
  5. swapna

    plz can u tell whats the function of relay coil in this circuit.. and where the output have to be seen……….its very inportant for me.if possible plz upload the breadboard connetion. thanku

    Reply
  6. POOJA

    Sir,
    I tried simulating in Multisim, but i have no idea what to use as the spdt relay and what difference would i see once the simulation is complete
    pls help
    Thank u

    Reply
  7. rahul

    thank you sir.
    my circuit worked i have raised the holding time by about 7sec. i have used
    a 3300Mfd capacitor and a 2.2k resistance.

    Reply
  8. Seetharaman

    Hi Rahul to increase the holding time, raise the value of R11, C2 or both. Please read last two lines of the description. may be 1000uF or R11 to 2.2K ohms.

    Reply
  9. rahul

    sir
    when i activate my lock the relay activates only for a fraction of time and again deactivates I could not find the error .
    rahul

    Reply
  10. rahul

    sir
    sorry to bother u again but the circuit is still not working when i activate the lock it the out put is only for small moment the out put still not proper
    rahul

    Reply
  11. seetharaman

    Hi rahul open circuit voltage will be full. once you connect the transistor it will fall down to 0.7 volts when on.

    Reply
  12. rahul

    sir
    u r correct E&C of the transistor i have connected are interchanged.
    sir the data sheet says V EB should be maximum 5v. Initially when the lock is off it is about 0.07 v but when the lock is turned on it raises to about 11v .Sir will it damage the transistor ?? I have checked it without connecting the transistor i.e between the 1.5k resistor and emmiter of Q1, or it will be different when i connect the transistor..
    rahul

    Reply
  13. seetharaman

    Hi Rahul check EBC of Q1. this transistor is different from normal small signal TO92 transistors. Since you have indicated that vbe is 9.51v. cannot be when transistor is forward biased, it can be at a maximum of 0.7volts only. it looks your emitter and collector are interchanged please refer the datasheet.
    http://www.fairchildsemi.com/ds/2N/2N3906.pdf

    Reply
  14. POOJA

    Sir,
    I tried simulating in Multisim, but i have no idea what to use as the spdt relay and what difference would i see once the simulation is complete
    pls help
    Thank u

    Reply
  15. rahul

    sir
    I have corrected my circuit.. but my relay is still not energised . But the voltage between the base of Q1 & gnd is 10.8v (initially) wen i activate the lock it drops to around 1.8 v. which sows my circuit is working.
    The EC & EB voltages of Q1 are as follows.

    initial EB 0.32v when the lock is on EB 9.51v
    EC 8.68v EC 8.68v
    I could not understand whats going on..

    sir please reply as soon as possible.
    rahul

    Reply
    • ajin

      hi rahul bro can u send the correct circuit to me even me to having the same problem in that 9 pin is data pin then how this will reset the whole circuit so please send me the correct circuit bro

      Reply
  16. rahul

    I am still confused about pin 9 its still grounded . Pin 9 is the data line of D flip flop.where should it go .
    please correct the circuit as soon as possible.
    rahul

    Reply
  17. rahul

    hi
    can any one help me with this circuit . Is this circuit working??I have assembled it for my project but it didn’t work.

    rahul

    Reply
  18. labtec

    Pin 9 should not be grounded, it is a mistake. Gentleman who made this drawing was too much excited and in a hurry to share so he left two mistakes in the schematic for people to wonder. Never mindm search the pin configuration on the net and use only IC CD4013 (not CD4049). Cheers….

    Reply
  19. hammedshekoni

    pls if dere isn’t a grounded pin 9 in ic1a which pin is den grounded, and wld it be at d relay that there wld be an output after entering the code or pushing d right buttons

    Reply
  20. seetharaman

    Hi Chianmy sorry it was on the same frame this circuit was drawn so please leave those words CD4049 use CD4013 instead.

    Reply
  21. seetharaman

    Hi Ilija you are correct IC1 pin no9 shown as going to ground is wrong. delete that line other wise the circuit is correct.

    Reply
  22. ap

    Can you please tell me what will happen when the relay is energised? Where do you put the motor? Thanks!!

    Reply
  23. mehatb

    plz give its state diagram to understand its working….plz plz …i have just 2 hrs to submit this project and perform in viva

    Reply
  24. naufan

    sory i want to ask again,, i have been made it, but why it doesn’t work?? i gave it suplay 12 v and i use relay hrs4h and connect it to DC motor,, but the DC motor doesn’t work..

    Reply
  25. Seetharaman

    Hi Naufan L1 can be the solenod coil of the latch or through this relay’s contact you can operate the locks solenoid.

    Reply
  26. manish kumar

    it is a very good projects but there is not information of realy and how to control motor.you have to use your mind to control the motor.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>