• Electronic combination lock. DIY combination lock


    Three schemes of the simplest combination locks.

    I will present to your invaluable attention a few simple schemes to protect your peace of mind. Currently, the amateur radio market is firmly flooded with devices that are used in warning and alarm systems. These devices, from the simplest to the most complex, are assembled, as a rule, according to standard classical schemes. All the devices under consideration are available for repetition by novice radio amateurs - designers who do not have deep theoretical knowledge in electronics, and can be used to protect objects such as apartments, offices, dachas, etc. from unauthorized access.
    A combination lock is generally a very convenient and practical thing. You don’t need to constantly carry a bunch of metal keys in your pocket to open this or that shed; to do this, you just need to remember the code written into your brain or in your book mobile phone, in general, combination locks can be divided into several groups according to their characteristics, but only two remain the most popular - mechanical and electronic. It’s up to you to decide which of these technological wonders to use; we will consider only some designs with electronic filling. Most electronic combination locks made on microcircuits of the well-known K561TM2, KT3 triggers or on microcircuits specialized just for this purpose; especially sophisticated designs appear in our time on microcontrollers and sensors.

    So, our first peacekeeper is a combination lock on the 4017 chip.
    Yes, friends, the microcircuit is called 4017, there are many companies that produce these products based on this, the letters in front of the numbers may change slightly, for example, my microcircuit comes from China, but the descendants of Confucius boldly and unceremoniously stuck the PHILIPS logo on the black case in white and, therefore, the marking is as follows : HEF4017BP. But closer to the body.
    The proposed diagram will help you assemble a simple combination lock with high encryption strength. To find a code that you forgot due to drunkenness or for other reasons, you will have to go through 10,000 options. In this case, the lock code consists of 4 digits pressed in a certain sequence. So, the diagram itself:

    In my opinion, nothing complicated, soldered and hung. The operating principle of this device is no different from the operating principle of other electronic combination locks on microcircuits. Who for a long time delving into the country of electronics, he’s already rummaging around in this, but for beginners I’ll explain.
    The S6-S9 buttons in the diagram indicate the “correct” code numbers, the S1-S5 buttons indicate numbers that are not needed in the code at all.
    Initially, there is voltage at the 3 ms pin (logical "1"). When the "S6" button is pressed, a logic "1" appears at the input of counter 14, and a logic "1" appears at pin 2. In the same way, after pressing the "S7" button, a logic "1" appears at output 4, and after pressing the button "S8" - at output 7. After pressing the last correct digit - "S9" - logical "1" appears at output 10, transistor VT2 opens, the relay is activated and connects the load with its contacts. Relay activation is indicated by an LED.
    If you press any of the “incorrect” numbers (S1-S5), logical “1” will go to pin 15 (“Reset” - reset to initial state), and you will have to start selecting the code all over again. This is such a harmful dirty trick.

    The next lock is on the K561IE9 chip and field effect transistor KP501A.
    There are few fundamental differences in complexity from the previous scheme, in general, see for yourself:

    In general, the chip itself is a four-digit Johnson counter. The principle of operation of this circuit is similar to the circuit described above, although there are more buttons on it.

    Works electrical diagram as follows. At the initial moment, when power is applied, the circuit of capacitor C1 and resistor R1 generates a pulse to reset the triggers (there will be a log “0” at outputs 1 and 13 of the microcircuits). When you press the button of the first digit of the code (in the diagram - SB4), the moment it is released, trigger D1.1 will switch, i.e. a log will appear at output D1/1. "1", since there is a pog at input D1/5. "1". When you press the next button, if there is a log at input 0 of the corresponding trigger. "1", i.e. the previous one worked, then pog. "1" will also appear at its output. The last one to fire is trigger D2.2, and so that the circuit does not remain in this state for a long time, transistor VT1 is used. It provides a delay in resetting triggers. The delay is made due to the charging circuit of capacitor C2 through resistor R6. For this reason, at output D2/13 the signal is logic. "1" will be present for no more than 1 second. This time is quite enough for relay K1 or electromagnet to operate. The time, if desired, can easily be made significantly longer by using capacitor C2 of a larger capacity.
    While dialing the code, pressing any wrong digit resets all triggers.
    Well, that's basically all.

    If you want to install a combination lock on your door yourself, it is important to understand its structure. Depending on which model is used, its connection diagram and operating principle may differ. It is important to distinguish between these features, so this issue should be considered in more detail.

    Combination locks are either electronic or mechanical

    Types of castles

    Each entrance door must be equipped with a lock. With a properly selected locking mechanism, home safety requirements will be met. Important criteria when choosing a device are:

    • degree of burglary resistance;
    • type of mechanism and lock scheme;
    • reliability;
    • privacy level.

    Today the range of products is so huge that you can find a good lock in any price category. Complex mechanisms deserve special attention. Some people don't find best solution for your home, except to make a combination lock at the entrance.

    • Mechanical. A standard mechanism based on the use of physical force to activate the locking bolts.
    • Electronic and magnetic. Powered by mains or battery. Operation requires a radio signal or a magnetic key.
    • Combined. They can work as electromagnetic models, and in the event of a lack of power, they switch to the mode of a regular lock with a key.
    • Mortise. They are installed on the door leaf from the outside of the door and have a visible end plate.
    • Nested. They are mounted at the door manufacturing stage directly inside the door leaf.

    Types of door combination locks depending on the principle of operation

    Based on the type of locking device, combination locks are classified in the same way as regular ones.

    Features of mechanical devices

    Previously, mechanical combination locks were used almost everywhere. They were actively installed on front door entrances in apartment buildings. Also, the scope of their application extended to the entrance area to utility and industrial premises. The principle of operation of the mechanics is based on the introduction of a code combination of several numbers, which set the crossbars in motion and unlocked the door when the necessary buttons were held.

    The design of a modern mechanical combination lock is somewhat complicated, since older models turned out to be not very reliable due to the ease of selecting a combination based on pressed-in operating buttons. Today, their scheme is more often based on the sequential introduction of numbers, but the mechanism itself has remained approximately the same.

    The advantage of mechanical models is that their connection diagram is extremely simple. They do not require connection to batteries, and therefore it is enough to just embed the product into the canvas and attach the mating part to the box.

    Reprogramming a mechanical lock with your own hands also does not pose any particular difficulties. To do this, you need to do the following: disassemble the case and change the access code to a new combination, connecting the buttons with the crossbars.

    The advantage of a mechanical combination lock is its ease of connection.

    Electromagnetic models

    Of course, purchasing a mechanical lock is a good budget option, however, electromagnetic models are more reliable and efficient; they are installed on the front door in apartments, private houses, offices, etc. Such locks have the main difference - they operate on electricity. Energy consumption is small, and therefore you don’t need to worry about extra kilowatts on the meter. In addition, you can use rechargeable batteries so as not to lay a cable to the nearest network.

    • Electronic. The basic model is an electronic lock that you can program yourself. It can work according to different principles. In some products, the combination reception scheme is based on its manual input on the keyboard. Other locks operate by receiving a radio signal, which sends a special key programmed for storage the required code. In order for the system to work, it is necessary to provide the lock with power. For convenience, some models are equipped with a display. Buttons can be either regular push buttons or touch buttons, as in more expensive and modern products.
    • Magnetic. They also require power from batteries or mains, but the principle of operation of the magnetic lock is based on a slightly different approach. The main element is the magnetic key, which is the carrier of the code. It can be in the form of a tablet, key fob or card. In order to open the door using a magnetic lock, you need to attach the key to the receiving plate. After processing the signal, the mechanism is activated and the door opens. The device of a magnetic door lock is clearly demonstrated by the intercom.

    Electromagnetic door locks are considered the most reliable for security

    A magnetic and electromagnetic lock are essentially the same device. The main condition is the use of a magnetized key to enter the code and unlock the mechanism. In exclusively electronic models, the circuit is based on the delivery of an electrical impulse.

    Installation Rules

    The diagram for installing a combination lock on a door with your own hands for mechanical models is quite simple. The idea is to attach a digital panel with a secret mechanism to the canvas, and insert a counter plate into the canvas. The simplest models contain crossbars that inside can be moved manually thanks to a special lever or button.

    Installing a mechanical combination lock is quite simple and does not require special skills

    But how to install an electromagnetic lock on a door with your own hands? Here you need to have basic skills in working with power-powered devices. Also for specific model magnetic or electronic product must be accompanied by instructions with step by step description technologies for connecting block elements. Ideal option– when the connection diagram is displayed not only in text form, but also schematically.

    The technology for installing an electric lock with your own hands is as follows:

    1. Determine the position of the lock panel on the door.
    2. Mark the exact location where the panel will be inserted.
    3. Drill holes in the canvas according to the marks.
    4. Cut a hole of appropriate size to accommodate the lock block and locking mechanism.
    5. Next you need to connect the code panel to the lock drive.
    6. For an electric lock, you need to make access to the power supply.
    7. Then you need to program the lock by setting an access code on the device and check that the mechanism is working correctly.

    Installing a combination electric lock on your front door will allow you to increase reliability and security. If you do everything correctly, you will not regret the decision you made and will prevent damage to the device during long-term use.

    The circuit of a simple electronic combination lock. The circuit is not complicated, you only need to flash the PIC microcontroller. For this circuit you need PIC 12F675 (629) - it won’t work.

    The diagram itself is very simple and contains a minimum of details.
    Lock diagram:


    advertise for free
    Keyboard layout:


    The principle of operation is very simple: all buttons are connected through a chain of series-connected resistors. And each button has its own resistance (if button No. 1-1k, then button No. 2-2k, and so on). All these values ​​are written into the microcontroller when programmed, after which it responds only to them.

    Programming the code is very simple: press the CODE button and hold it until the LED lights up, then enter the code on the keyboard. All the new code is programmed (for those who don’t understand, watch the video of the operation at the bottom of the article)

    The actuator (M) can be anything, in my case it is a low-power electric motor that will rotate the gearbox: so I connected it to the same power source as the circuit itself. If you have a powerful actuator: then it should connect from an additional power source.

    I found only a matrix keyboard, here it is in the photo

    The problem was that. its connection looks like this:

    I had to redo it, cut the tracks and soldered in the resistors as in the diagram, this is what happened:


    I did not connect one row of buttons (these are the letters A, B, C, D)
    Only the letter (D) is connected as a power button (that is, the circuit only works if you hold down the button (D)) This reduces the probability of selecting the code to zero.
    And the combination lock itself does not consume any current in standby mode.

    I want to put this lock in the locker at work, which I often break into, and I don’t want to take out a bunch of keys every time. Since the standard lock will remain in place, I made a power supply from batteries (so that there would be no wires to the box), well, once every few months you can open the door with the keys and change the batteries.

    First assembly of the circuit on the circuit board (to check its functionality)


    Everything worked great. Next, I selected a suitable case, etched the board and connected everything. Due to the small number of parts, the board turned out to be quite compact and fit into a small case.


    Regular mechanical locks have a low degree of protection due to the limited number of combinations. It is also possible that the key may be lost or an impression may be taken from it. Electronic combination locks allow you to provide individual or collective access to premises, equipment, safes and other objects without the use of traditional mechanical locks and keys.

    In electronic combination locks, as in mechanical ones, the principle of matching features is often used. Obviously, the simplest and, accordingly, extremely reliable coincidence scheme is the user-specified sequence of switching elements.

    In Fig. Figure 22.1 shows one of the simplest combination lock schemes using an electromagnetic locking device [Рл 9/99-24]. The power supply circuit of the electromagnetic lock and its design are not given. To turn on the actuator (electromagnetic lock), relay K1 is intended, and relay K2 turns on the bell, a specific diagram of which is also not given. Dial field buttons SB1 - SBn, as well as button SB0 “Bell” are installed on the front door.

    SBm buttons are installed indoors in different places, which allows the owner to open the door without approaching it. Buttons SB1 - SB4 are active for dialing a code combination. Their number can be increased or decreased at the user's discretion.

    The device works as follows: when power is applied, capacitors C1 and C2 are charged in 10 seconds, and the electronic lock is ready for operation. Relay K1 is activated during the discharge of capacitor C1 through the winding (for 2...3 sec) only when buttons SB1 - SB4 are pressed simultaneously, and, accordingly, does not respond to their sequential pressing. If any of the buttons SB5 - SBn is pressed by mistake, capacitor C1 will be instantly discharged through resistor R2, and the device will return to operating condition only after 10 seconds (after capacitor C1 is charged). At this time, even the correct code entry will not be able to open the lock.

    The power supply circuit for relay K2 of the bell circuit also uses a timing circuit - R3, C2. This eliminates frequent signaling (more than every 10 seconds and lasting more than 2...3 seconds), which does not create unnecessary noise and does not allow the bell winding to burn out.

    The bell button SB0 is connected through diode VD1 and resistor R2 to capacitor C1 of the combination lock. When trying to enter a room, attackers often check for the presence of owners - they press the bell button and then try to open the door. Pressing the bell button SB0 leads to the discharge of capacitor C1, which makes it impossible to open the lock during the delay even when the correct combination is dialed.

    In Fig. Figure 22.2 shows a diagram of a combination lock using a different method of protection: the lock is activated only when buttons SB1 - SB4 and button SB0 “Bell” are pressed simultaneously [Рл 9/99-24]. If the SB0 button is pressed before simultaneously pressing the SB1 - SB4 buttons, the bell is turned on, which allows you to attract the attention of the owners (if they are at home) or third parties.

    As in the previous case, pressing any of the buttons SB5 - SBm will cause the timing capacitor C1 to discharge. Repeated dialing will be possible only after 10 seconds, when the voltage on the capacitor plates exceeds the breakdown voltage of the zener diode VD3, connected to the base circuit of the composite transistor VT1, VT2. Relay K1 (electromagnetic lock control) is the load of the composite transistor, and relay K2 (“Bell”) is the load of transistor VT3.

    If the correct code is dialed and relay K1 is activated, transistor VT3 is closed, and relay K2 (bell circuit control) is de-energized, pressing the SBO “Bell” button will trigger relay K1 (lock electromagnet control). As an option, a different connection of relays K1, K2 can be used (Fig. 22.3). SBm buttons are designed for remote opening of the lock from inside the room. When you press the SB0 (“Call”) button, capacitor C1 will be discharged.

    A combination of the circuits shown in Fig. 22.1 - 22.3, another version of the circuit can be obtained (Fig. 22.4).

    According to the diagram in Fig. 22.5, an electronic combination lock of a different operating principle can be implemented [Rl 9/99-24]. A special feature of the lock is the strictly defined sequence of button presses. As a result of this, the capacitor S3 is first charged, and then it is connected in series with the charged capacitor C2. The double voltage of this “voltage source” is supplied through the zener diode VD3 to the base of the composite transistor VT1, VT2, which controls relay K2 (electromagnet).

    To operate this device, you must: simultaneously press the SB2 and SB4 buttons, then, releasing these buttons, simultaneously press the SB1 and SB3 buttons. When you press any of the SB5 - SBm or SB0 “Call” buttons, capacitor C2 will be discharged and the dialing attempt will be delayed by 10 seconds. To complicate the conditions for typing the code, a chain of elements (Fig. 22.6) can be used instead of the SZ capacitor. This chain sets the time (duration) of pressing the buttons during charging and determines the self-discharge time of the SZ capacitor.

    The above schemes work when several buttons are pressed simultaneously. The number of possible combinations with a four-button code dial and a 3x3 code field (9 buttons) is 3024, with a 4x4 code field - 43680, with a 5x5 code field - 303600.

    The location of the buttons in the type field is determined by the user. It is recommended to change the dialing code periodically. This reduces the likelihood of code selection by strangers by sequentially searching through combinations. When the code remains unchanged, the most frequently used buttons become dirty and unmask themselves. The buttons should turn on without a click so that the number of presses cannot be determined by ear. When entering the code for locks made according to the diagrams in Fig. 22.1 - 22.4, it is recommended to simulate sequential pressing of buttons. In any case, the buttons being pressed should not be visible to others.

    The electronic lock should be placed in a metal closed case both to reduce the influence of network interference on the operation of the lock and to limit or eliminate the possibility of visually identifying the lock code (when removing the device cover). To increase the reliability of the device, it is advisable to provide redundant battery power.

    Extremely simple combination locks and their elements are shown in Fig. 22.7 and 22.8. The operation of the lock is based on consistent and unique correct connection switches. In Fig. Figure 22.7 shows one of the elements of the combination lock, which is a double multi-position switch. Similar devices used in storage rooms at railway stations. In another type of combination lock, a sequence of such elements is used (Fig. 22.8), Than larger number elements, the higher the degree of secrecy of the lock: it increases in proportion to the number of switch positions SA2 (SA1) to the power of n, where n is the number of typical elements of the combination lock.

    Internal (hidden from prying eyes) switches SA2 (a chain of standard elements) set the required digital and/or alphabetic code. After this, the cell door is slammed and the device goes into security mode. In order for the door to be opened, it is necessary to set the “correct” code on the external switches SA1 and press the power supply button to the actuator. If an incorrect code is entered, an alarm will sound. We specifically do not provide details of the implementation of this version of the scheme, relying on the fact that the reader will be able to solve this problem independently or with the help of a mentor.

    To configure and experiment with circuits, generators can be used as device loads instead of relay windings audio frequencies or light-emitting diodes (with a current-limiting resistor of 330...560 Ohms). So, instead of a relay (“Bell”) in all circuits, you can turn on a sound signal generator, see, for example, the circuits in Chapter 11. Low-power high-frequency generators can also be used as a load, which will allow remote control various devices or signal attempts to enter the premises.

    When used in relay circuits, they should be selected based on the operating voltage below the supply voltage, and the operating current of the relay should be such that the time-limiting capacitors connected in parallel with the relay winding can be completely discharged in 2...3 seconds.

    To further increase the reliability of combination locks, it is promising to use magnetically controlled contacts (reed switches) - sealed contacts enclosed in a sealed glass ampoule. The contact is triggered when a permanent magnet is brought to it, even through a plate of non-magnetic material separating them. This will significantly increase the durability and secrecy of the lock.

    The design of combination locks is useful not only due to their practical significance, but mainly in terms of the development of creative initiative, the limitless improvement of devices with different, sometimes unique, operating principles.

    The diagrams below show variants of combination lock circuits using thyristors and /SHO/7 switches [Rk 5/00-21, Rl 9/99-24].

    In Fig. Figure 22.9 shows a typical combination lock element used for these schemes (Fig. 22.10 - 22.13). Such elements can be installed in attaché cases, individual safes, storage lockers, and control systems for complex technical equipment designed to perform critical work.

    After dialing the internal code (setting the SA2 switches to a user-defined position), the door is slammed. The lock automatically latches. Number possible options code combinations is equal to the number of positions of switches SA1 and SA2, raised to a power equal to the number of standard typesetting elements.

    In order to open the lock, you need to dial the required code on standard dial elements of a combination lock. The sequence of typical lock elements represents the simplest matching scheme.

    If the correct code is entered, the control transition of transistor VT1 (Fig. 22.10) turns out to be closed. As a result, when you press the SB1 “Open” button associated with the door handle, the electromagnetic relay K1 (lock control element) is connected to the power source. The relay will work, its contacts K1.1 will turn on the lock electromagnet, and the lock will open.

    If you enter the code incorrectly and twitch the door handle (press the SB1 “Open” button), the voltage through the winding of relay K1 will flow to the base of transistor VT1, and it will open. At the same time, an unlocking signal will be sent from resistor R4 to the control electrode of thyristor VS1, which will turn it on, which will cause relay K2 to operate. The relay contacts will open the code dialing circuit and turn on the alarm circuit for an attempt at unauthorized entry into a protected object (Cs bell, warning light, electronic siren or a combination thereof; turn on another actuator).

    Re-dialing the code will be possible only after pressing the SB2 “Reset” button. Since the current through the winding of relay K1 in the event of an incorrect code entry is small (limited by resistor R1 and other circuit elements), relay K1 does not operate. Thus, the user is given only one attempt to open the lock, which sharply limits the possibility of unauthorized persons guessing the code.

    Diodes VD1, VD2 connected in parallel to the relay windings prevent the development of oscillatory processes when switching an inductive load (relay windings). Capacitor C1 eliminates the possibility of false operation of the device due to interference and transient processes.

    As with other critical devices that are subject to increased reliability requirements, in the case of practical use It is advisable to provide electronic combination locks backup power battery-powered devices in case of a planned or emergency power outage.

    Modified versions of the circuit described above, demonstrating the possibility of powering the device from a voltage source of a different polarity, are presented in Fig. 22.11, 22.12. The principle of their operation remains the same: the circuits contain a sequence of dial-up elements, a kind of matching circuit, as well as a thyristor switch, relays and alarm elements.

    Compared to the previous circuit, the device (Fig. 22.11) has reduced sensitivity and therefore requires individual selection of the value of resistor R1 connected to the thyristor control circuit. When choosing the type of relay K1, it is necessary to take into account that its operation current should significantly exceed the control current of the thyristor. This will prevent false triggering of the device.

    A variant of a combination lock made on a transistor analogue of a thyristor is shown in Fig. 22.12. A response delay element is introduced into the circuit - capacitor C1 large capacity. In this case, the blocking device is activated a few moments later. This allows the user to make sure that the door is slammed and the lock is closed.

    A slightly different principle of operation is used in the combination lock circuit shown in Fig. 22.13.

    As in previous cases, if the code is entered correctly, the sequentially connected standard elements of the combination lock will provide supply voltage to the coil of relay K1 when the SB1 “Open” button is pressed. At the same time, the Cs bell turns on briefly and sounds beep, warning about the opening of the lock. In this case, the operation of the sound alarm is not blocked.

    In the initial state, the resistance of the source-drain channel of the field-effect transistor is small, the control electrode of the thyristor is “shorted” to the common wire, and the thyristor is closed.

    If you enter the code incorrectly and press the SB1 “Open” button a beep also sounds. Since the winding of relay K1 is connected in series with resistor R1 (100 kOhm), the current through its winding is small and the relay does not operate. At the same time, the supply voltage is supplied through the relay winding K1 and resistor R2 to capacitor C2 and charges it in about 5 seconds.

    If button SB1 “Open” pressed for more than 5 seconds, or attempts are made to select the code with periodic twitching of the door (closing the SB1 button), capacitor C1 will charge. The source-drain resistance of field-effect transistor VT1 will increase sharply, and thyristor VS1 will turn on. Relay K2 - thyristor load - with its contacts K2.1 will open the code dialing circuit and turn on an audible or other alarm.

    The next access to the lock will be possible only after unlocking the circuit - pressing the SB2 “Reset” button. The response delay time (in seconds) is determined by the parameters of the elements of the RC circuit (C2R2), where the capacitance is expressed in microfarads and the resistance in MOhm. To vary this time, it is possible to use a potentiometer as resistor R2, which allows you to set any response delay time, at the user’s discretion, from 0 to several seconds. Diode VD2 is designed to instantly discharge capacitor C2 when the code is entered “correctly” and is not a mandatory element.

    An electronic combination lock with push-button control (Fig. 22.14) uses /SHOG7 switches (DA1 K561KTZ microcircuit) and an output stage on transistor VT1 with executive relay K1 [Рл 9/99-24].

    The previous schemes work when several buttons are pressed simultaneously. The electronic lock (Fig. 22.14) is activated when the “correct” buttons SB1 - SB4 are pressed sequentially or simultaneously. Pressing the SB1 button causes the feed high level to the control input of the DA1.1 switch (pin 13 of the microcircuit) and storing this level on capacitor C1. The DA1.1 key is turned on. Closing the DA1.1 key allows you to press the SB2 button to apply a high level voltage to the control input of the next key, etc. - along the chain.

    Capacitors C1 - C4 remember the “high level” state for a period of several seconds, determined by the values

    resistors R2, R4, R6, R8 connected in parallel with these capacitors. If, while dialing the code, the SB5 - SBm button is mistakenly pressed or the code dialing time is long, capacitors C1 - C4 will be discharged. The keys on the switch(es) will open, preventing the lock from being opened.

    As in previous schemes, incorrectly entering the code or pressing the bell button will cause the discharge of capacitor C5 and prevent further dialing of the code. Instead of buttons SB1 - SB4 in the circuit (Fig. 22.14), standard typesetting elements can be installed (Fig. 22.1). In this case, the lock loses its ability to protect against code selection. It is recommended to decide for yourself how to return this property to it.

    Literature: Shustov M.A. Practical circuit design (Book 1), 2003

    A combination lock is generally a very convenient and practical thing. With its installation, there is no need to constantly carry a bunch of metal keys in your pocket in order to open this or that shed. To do this, you just need to remember the code.

    Combination locks, in general, can be divided into two categories according to their characteristics: mechanical and electronic.

    Most electronic combination locks are made on K561TM2, KTZ trigger microcircuits or on microcircuits specialized just for this purpose. Particularly sophisticated designs are appearing these days on microcontrollers and sensors. Three simple circuits presented by Dmitry Nifashev on www.radiokot.ru.

    First, let's look at the combination lock on the 4017 chip (HEF4017BP). The lock code consists of four numbers pressed in a given sequence. To find the code, you will have to go through 10,000 options.

    The proposed scheme (Fig. 1) will help to assemble a simple combination lock with high encryption strength.

    Rice. 1. Scheme of a simple combination lock

    The diagram shows:

    ♦ using buttons S6-S9 “correct” code numbers;

    ♦ using the SI-S5 buttons, numbers that are not needed at all in the code.

    Initially, there is a logical “1” at pin 3 of the IC.

    When the "S6" button is pressed, a logic "1" is applied to the input of the counter 14, and a logic "1" appears at pin 2. In the same way, after pressing the "S7" button, a logic "1" appears at the output 4, and after pressing the button "S8" - at output 7.

    After pressing the last correct digit “S9”, logical “1” appears at output 10. Transistor VT2 opens, the relay is activated and connects the load with its contacts. Relay activation is indicated by an LED.

    If you press any of the “incorrect” numbers (SI-S5), logical “1” will go to pin 15 (“Reset” - reset to its original state), and the selection of the code will have to start over. The lock is based on the K561IE9 microcircuit and the KP501A field-effect transistor.

    Combination lock diagram (Fig. 2) fundamental differences It has little in complexity from the previous scheme.


    Rice. 2. Scheme of a simple combination lock with an extended keyboard

    The chip is a four-digit Johnson counter. The principle of operation of this circuit is similar to the circuit described above, although there are more buttons on it.

    Finally, let’s look at the lock on two K561TM2 microcircuits (Fig. 3).


    Rice. 3. Scheme of a simple combination lock on two K561TM2 microcircuits

    The electrical circuit works as follows. At the initial moment, when power is applied, the Cl, R1 circuit generates a pulse to reset the triggers (there will be a log “0” at outputs 1 and 13 of the microcircuits).

    When you press the button of the first digit of the code (in the diagram - SB4), the moment it is released, trigger D1.1 will switch, i.e. a log will appear at output D1/1. “1”, since there is a log at input D1/5. "1". When you press the next button, if there is a log at input 0 of the corresponding trigger. “1”, i.e. the previous one worked, then log. “1” will also appear at its output. The last one to fire is trigger D2.2, and so that the circuit does not remain in this state for a long time, transistor VT1 is used. It provides a delay in resetting triggers.

    The delay is made due to the charging circuit of capacitor C2 through resistor R6. For this reason, at output D2/13 the signal is logic. "1" will be present for no more than 1 second. This time is quite enough for relay K1 or electromagnet to operate. The time, if desired, can easily be made significantly longer by using capacitor C2 of a larger capacity.

    To increase resistance to hacking, the number of “unnecessary” buttons can be increased. Up to any quantity - it all depends on your desire and circumstances.

    Note.

    While dialing the code, pressing any wrong digit resets all triggers.

    In conclusion, it should be noted that over time, the “necessary” buttons begin to wear out and differ from all the others. So it is advisable to occasionally swap the buttons to ensure even wear.