How To Build A Simple Code-Operated Switch

Not rated 16,787

Circuit Image

This is a simplified version of the Universal Keypad-Operated Switch. The design has been modified to reduce circuit complexity and the number of components required, resulting in somewhat less secure code functionality. However, it remains adequate for many applications. The circuit operates on a 12-volt supply but is compatible with voltages ranging from 5 to 15 volts. Selecting a relay suitable for the desired supply voltage is necessary. A multi-pole relay can replace the SPCO/SPDT relay if it fits the application. It is important not to use the on-board relay for switching mains voltage, as the board layout does not provide sufficient isolation between relay contacts and low-voltage components. For mains voltage switching, a suitably rated relay should be mounted safely away from the board. The user can choose four keys to serve as the code, connecting them to terminals "A, B, C, and D," while all other keys connect to "E." The circuit will power up with the relay energized, and to de-energize it, the user must enter the code. To re-energize, any key connected to "E" must be pressed. Replacing Q2 with a BC547 transistor will reverse the circuit's operation, allowing it to power up with the relay de-energized. Entering the code will energize the relay, while pressing any key connected to "E" will de-energize it. Keys not connected to "A, B, C, and D" are linked to the base of Q1. Pressing any "wrong" key will pull pin 1 low, causing the code entry sequence to fail. Mistakes in code entry can be corrected by starting over. The keypad should have a common terminal and a separate connection for each key; a 12-key pad will have 13 terminals, and matrix types with 7 or 8 terminals are unsuitable. A 12-key pad includes eight "wrong" keys connected to "E." For enhanced security, a larger keypad with more "wrong" keys can be utilized. Support material for this circuit includes a step-by-step construction guide, a parts list, and a detailed circuit description.

The Universal Keypad-Operated Switch circuit is designed for versatility and ease of use, making it suitable for various applications that require controlled access. The circuit's operation is governed by the keypad input, which allows user-defined access codes. The relay acts as the main switching element, controlling the load based on the code entered.

The choice of relay is critical, as it determines the voltage and current handling capabilities of the circuit. For low-voltage applications, an SPCO/SPDT relay can suffice, while high-power applications may require multi-pole relays to manage multiple loads or provide additional functionality. The recommendation to avoid switching mains voltage with the on-board relay emphasizes the need for safety and proper isolation.

The code entry process is straightforward: upon power-up, the relay remains energized, allowing the user to enter a predetermined code using the designated keys. The connection of other keys to terminal "E" provides a method for the user to reset or re-energize the relay without needing to re-enter the code. The inclusion of a BC547 transistor allows for flexibility in operation, catering to different user preferences regarding the relay's initial state.

The circuit's design includes fail-safes, such as the detection of incorrect key presses, which prevents unauthorized access attempts. This feature enhances security by ensuring that only the correct sequence of key presses will activate the relay. The requirement for a keypad with a common terminal and separate connections for each key ensures compatibility and reliability in operation.

In summary, the Universal Keypad-Operated Switch circuit is a practical solution for applications requiring controlled access, with considerations for safety, security, and user flexibility. The accompanying support materials provide comprehensive guidance for successful implementation and customization of the circuit.This is a simplified version of the Universal Keypad-Operated Switch. I have modified the design to reduce the complexity of the circuit - and the number of components required. As a result - the code is somewhat less secure. However, there should be lots of situations where it will still be adequate. The circuit is drawn with a 12-volt supply - but it will work at anything from 5 to 15-volts. All you have to do is choose a relay suitable for the supply voltage you want to use. Replace the SPCO/SPDT relay with a multi-pole relay - if it suits your application. Do not use the "on-board" relay to switch mains voltage. The board`s layout does not offer sufficient isolation between the relay contacts and the low-voltage components. If you want to switch mains voltage - mount a suitably rated relay somewhere safe - Away From The Board.

Choose the four keys you want to use as your Code - and connect them to "A B C & D". Wire the common to R1 and all the remaining keys to "E". The circuit will power-up with the relay energized. To de-energize it - you must enter your code. To re-energize it - press any of the keys connected to "E". To reverse the operation of the circuit replace Q2 with a BC547. With an NPN transistor in this position - the circuit will power-up with the relay de-energized. To energize it - you must enter your code. To de-energize it again - press any of the keys connected to "E". Any keys not wired to "A B C & D" are connected to the base of Q1. Whenever one of these "Wrong" keys is pressed - Q1 takes pin 1 low and the code entry sequence fails. If you make a mistake while entering the code - simply start again. The Keypad must be the kind with a common terminal and a separate connection for each key. On a 12-key pad, look for 13 terminals. The matrix type with 7 or 8 terminals will NOT do. A 12-key pad has eight "Wrong" keys connected to "E". If you need a more secure code - use a bigger keypad with more "Wrong" keys. The Support Material for this circuit includes a step-by-step guide to the construction of the circuit board, a parts list, a detailed circuit description and more.

🔗 External reference