This electronic lock is designed to work with a keyboard with 10 switches being controlled (operated / off) using a four digit code.
Forming code keys are in the scheme S1-S4. Each is connected to a flip-flop of IC1. Connections are made such that the pressing S1 will switch to "1" SET input of the first flip-flop (pin 4).
Its associated output Q (pin 2) is also "1". When these was obtained, cause shift in S2 pressing "1" input of the second flip-flop (pin 6) and associated output Q (pin 9), continued pressing the S3 and S4 leads to similar results.
This means that if the keys are pressed in the correct sequence, there is a logic level "1" at output Q of the fourth flip-flop (pin 1). If, during this process,
press one of the other keys (S5-S10) resets flip-flops set by R9 (to make the code more difficult to crack).
If the code was not fully inserted, it should be reintroduced. Reset time required can be increased by increasing the value of capacitor C1.
You can also use a keyboard with more keys, or less.
The code can be extended to eight digits by connecting a second series of IC1 4043. Pin 1 is tied then the S5 key and connects these three keys at the second 4043 in the same way that relate S2 - S4 to IC1. There is however a downside that must be considered: when keys are pressed simultaneously S1 - S4, the lock opens. This can prevent by (a) establishing one of the keys S5 - S10 as reset switch, and (b) S1 S4 not choosing adjacent keys.
In stand by, the circuit consumes approximately 10 mA. Relay must be 12 V and its coil current not exceeding 100 mA