This is a key code lock switch circuit, type of electronic circuit. To replace a conventional normal key switch, without inserts keys. But you can press the number code instead of unlocking keys. We do not need to carry a load key, and do not worry about your keys are lost. We just must remember to commit to a code only.
The feature of this circuit
- Using a four numeric code number and can change one thousand numbers.
- The case of other people to know our original code. The code can be changed easily.
- It is a simple digital circuit that without a microcontroller. Thus it is no programming, easiest, and cheaper.
The circuit is designed to have the reset system, immediately enter the wrong code. So can prevent pressing a random numeric code. Because in this circuit the switches are set to the ten numbers, be the code switch 4 pcs. and be reset switches 6 pcs.
The advantages of having a system reset. Suppose we set the code number is 6583. If people do not know the code, they will press random from 0 to 9. It will have one correct number is 6.
But we press randomly in second, that is not 5. Then, the circuit will reset number 6 that last remember go away.
Thus, we will enter a correct code, just the first digit only. However, if it is without the reset system. Even those who do not know the code, it can press random in a fourth only.
When we hit 0-9 from the first round, we will correctly hit to the No.6. Then we hit the second round will correctly is one of No.5 as well. When the full four rounds, it will have a four code so the circuit is working.
This difference is quite obvious.
We have talked about its advantages and disadvantages for enough. Then to look at the circuit and how it works really well.
How it works
This circuit uses a 74HC4017 or CD4017 IC number that is DECODE Counter model. It serves to change the code.
In normal conditions, when we provide a power supply to this circuit. Then, there is a positive voltage at the output, pin 3 of IC1.
When you press the switch A, S1. The positive voltage from pin 3 via it to the pin 14 of IC1, input pin.
Key code lock switch circuit diagram
Next, when IC1 has the input is a positive voltage. It will move the output from pin 3 to pin 2.
So the next switch that we must press to be switch B, S2. It causes the positive voltage at the input of IC1, in next step.
As you can see, if we do not press the switch B, it will not change any more of IC.
And if we push a wrong switch in one of six options on the left-hand side of this circuit.
It is the positive voltage to pass through this switch to the input pin 15, reset pin of IC1. When the pin 15 is the positive voltage, IC1 will change the output to at pin 3.
Thus it is resetting switch A to restart new again.
If we press these switches in the correct ways from A, B, C and D in order. IC will move output to pin 10. Which it connects through a diode, and R-10K to pin B of the Q1-2SC1815.
Then, Q1 conducts a power to relay-RY1 and LED1, they work together. the LED lights up.
Let us know, for the 5 diodes that connected to the out of IC1. They protect a collision of the output. For example, the two codes are the same as 5385 code.
The connection of keys code
When we need any code, we can connect code number to switch positions.
For example, we need code is 5385. We have to connect as follows.
- First, CODE 5 to Switch 1 (A) at pin of IC
- Second, CODE 3 to Switch 2 (B) at pin of IC
- Third, CODE 8 to Switch 3 (C) at pin of IC
- Fourth, CODE 7 to Switch 4 (D) at pin of IC
- Fifth, others CODEs to Switch 5 to 10 to connect to pin of IC
IC1_74HC4017 or CD4017 —DECODE Counter model
Q1_2SC1815 or 2SC828 —45V 0.1A NPN Transistor
RY1_Relay 9V—One contact 5A
0.25W, 5% Resistor
D1-D5_1N4148—0.4A 200V Diodes
D6_1N4002—1A 200V Diode
LED1_LED any color 3mm.
S1-S10_Switch Tactile ON OFF Single Pole, Single Throw Round Button
How to builds
If you want to build this project, can assemble them on universal PCB. Because of fast and saving.
We test the circuit on a breadboard it working, as Figture 2
Watch video building and testing circuit on a breadboard.
Note: Q1 you can use a lot of numbers that is NPN transistors but the position legs are different.
Creation – Application
You should assemble include the parts to the correct place. The small first such as R, Diodes, IC Socket, etc. Then, followed by large parts.
When place parts ready, Check everything compete before, insert IC1 into a Socket. Next, connects a power supply, and pressing code. If the relay pulls in and LED glows, the circuit works well.
Up to $20 shipping discount on first order now: https://jlcpcb.com/quote