The Instructables author's code lock under the nickname vandenbrande will not allow unauthorized persons to turn on four electrical appliances. This can be, for example, kitchen appliances, power tools, computers, televisions, game consoles, etc.
The following is a diagram. homemade. Besides Arduino-compatible board (in this case - RobotDyn Uno), it includes a keyboard matrix and a relay module. Both additional devices can be both ready-made and home-made. In any case, make sure that high-quality relays are used in the relay module, their windings are shunted by diodes in the opposite polarity, and the control circuits are well isolated from the load switching circuits. The device also includes a sound emitter and LED.
The red LED informs that the device is waiting for code entry, all four loads are disconnected, their switching is impossible. Green - that the code is entered correctly, the power of the loads can be switched.
How to use the device. Enter the code - by default 3241, in the sketch you can specify any other. Use buttons A, B, C, D to turn loads on and off. Using the asterisk button, disconnect all loads and put the device into standby mode, in which it waits for the code to be entered.
The master puts the sketch for the firmware of the board here. To compile it, you will need the Keypad.h and Password.h libraries already available in the Arduino IDE.
This make-up was repeated by two participants of the Instructables website: JR86 (it is in its execution that the device is shown on the KDPV) and firdaiszahari. Here is what happened in the first:
And here is the second:
All of them, including the author of the original, made the same mistake. No matter how good the lock works, in this form you can simply switch one or another input of the relay module to plus power, and the load will work. Therefore, it is necessary to place the device in a housing along with a PSU for Arduino and peripheral devices and sockets for connecting loads. The loads themselves must be with fixed cords, otherwise they can be connected to the network with another cord. Arduino should be flashed periodically, changing the code so that the markings on the keys wear out evenly, and by this sign the code could not be restored. A fuse or a modular machine is required at the input of the device.