10 Key Code Lock Switch Circuit

3,625 views

In this tutorial, we are going to make a “10 Key Code Lock Switch Circuit”.

This code lock switch is an electronic circuit, to replace a conventional key switch. We do not need to carry a load key and do not worry about the keys being lost. Because of this circuit, you only need to press the number code instead of unlocking keys. But we just must remember the code. It is a simple digital circuit without a microcontroller. Thus, there is no programming, easy to use, and is cheaper.

CD4017-Decade-Counter

Hardware Components

The following components are required to make Code Lock Switch Circuit

S.no ComponentValue Qty
1.ICCD40171
2.Transistor2SC18151
3.Relay9V1
4.Electrolytic Capacitor 100uF1
5.Resistor1K,100K,10K1
6.Diodes1N4148,1N40025,1
7.LED any color 3mm1
8.Switch10
9.PCB1

CD4017 Pinout

cd4017 ic pinout

For a detailed description of pinout, dimension features, and specifications download the datasheet of CD4017

Code setting on button keys

When we need any code, can connect the code number to switch positions. The order of the codes is not necessarily in the order of switches. For example, we need code is 4675. We have to connect as follows.

  1. First, CODE 4 to Switch 1 (A) at pin 3 of IC1
  2. Second, CODE 6 to Switch 2 (B) at pin 2 of IC1
  3. Third, CODE 7 to Switch 3 (C) at pin 4 of IC1
  4. Fourth, CODE 5 to Switch 4 (D) at pin 7 of IC1
  5. Fifth, other CODEs to Switch 5 to 10, to connect to pins of IC1

Look at the code diagram below.

block-diagram-of-Code-setting

Code Lock Switch Circuit

key-code-lock-switch-circuit.png

Working Explanation

In This circuit, we have a 74HC4017 or CD4017 IC. It is a decode counter model, that serves to change the code. First, when we powered this circuit, there is a positive voltage at the output PIN3 of IC1. As you press S1 of switch A, the positive voltage from PIN3 goes to the input pin (PIN14) of IC1. Now, when IC1 has input a positive voltage, it will move the output from PIN3 to PIN2. So, the next switch that we must press is switch B of S2. Which causes the positive voltage at the input of IC1, in the next step. If we do not press switch B, it will not make any change in IC1. And if we push a wrong switch from one of six options on the left-hand side of this circuit. It will pass the positive voltage through this switch to the input PIN15, which is the reset pin of IC1. So IC1 will transfer the output positive voltage from PIN15 to PIN3. This resets switch A to start again.

If we press these switches in the correct order from A, B, C, and D, IC1 will move output to PIN10. It is connected with pin B of Q1-2SC1815 through a diode and R-10K. Then, Q1 conducts power to relay-RY1 and LED1, they are working together. the LED will light up. Relay-RY1 acts like SPDT switches (Single-Pole, Double-throw). We normally press this switch, right? But now we are feeding the current coil of the relay. It will become electromagnetic, and sucking or plugging the switch contacts instead of our fingers. So, it can control other loads. The 5 diodes that are connected to the out of IC1, protect a collision of the output. For example, the two same-digit in the code are 5385.

Applications

This circuit can be used in homes, malls, offices, and banks.