The site already had many combination locks – with a full-digit keyboard , two buttons, and one too. But this device also has a right to exist because of its simplicity and reliability. Implemented a project on MK Attiny-13 and of course one micro-button. Of course, this scheme will not protect the safe in the bank, but something simple and small is quite enough to restrict access from, for example, children or colleagues at work. The circuit can also act as a switch, or simply as an immobilizer for a car or motorcycle. In general, this gadget will definitely come in handy for someone, so we post a full description.
Attiny code button diagram
A few words about the resistor at the output of the microcontroller. The relay used can draw less than 20 mA (the higher the voltage, the lower the holding current of the coil), which with a current gain of about 200 gives about 0.1 mA of base current. When the output from the board is about 5V and the base-emitter drop is about 0.7V, the base resistor can be 4.3V / 0.1mA or 43k ohms. Any less value guarantees full saturation in this range. So 4.7 kOhm will already give full saturation.
The program is written in BASCOM and after compilation it takes exactly 1024 bytes. Bin file for programming in attachment . Clock frequency 1.2 MHz. The operation of the encryption button is somewhat similar to Morse code, when the code is pressed short and long at the right time. We have 256 combinations in total. It may be a little, but hardly anyone wants to spend so much time brute-force typing code (you also need to know what you need to do in general). After turning on the power for 1.5 seconds, the circuit performs an internal cleaning and is ready for operation.
Shutdown mode
The relay is off and the code is pending. In fact, this is the only function in this mode. The button turns on the device (switches to ON mode) after entering the 8-bit code (as with serial transmission). Button press time:
The red LED is active as long as the button is held down (for convenience and to make sure the button is pressed).
Mode enabled
Switching off is performed by briefly pressing the button (it will not respond for a long time). Any configuration of the button is also possible in this mode:
The procedure for changing the code is as follows: we introduce a new code with time for the button, which was written about earlier. After entering the last eighth state, press the button again and hold for 6 seconds until the LED stops flashing. The pause time from entering the code to confirmation cannot exceed 1.5 seconds – after this time, the circuit will automatically exit the code change mode without changing it. You can also exit this mode by holding the button for 6 seconds after entering an incomplete code (the program checks if there were 8 characters). The entered code is saved in the EEPROM memory, so after turning off the device and turning it on again, it will still be valid.
What happens if we forget the code? Just turn off the power supply, hold down the button again, turn it on and we have a temporary code “00000000” – in the EEPROM memory, however, it is better to immediately enter the ON mode and change it to a more complex one.
You've all seen portable speakers becoming popular right now, but most of them are pretty…
UNIVERSAL BRUSH MOTOR DRIVER AND BLDC Introducing an overview of the BLDC motor driver circuit and…
DIY Automatic Sensor Hand Sanitizer Automatic Hand Sanitizer Based on Distance Sensor (No Arduino Required)…
What is Arduino Arduino is a convenient, flexible and easy-to-use open source electronic prototyping platform,…
Make Your Own Arduino Board In this DIY Project, I will show you how to…
WIND GENERATOR FROM A GYROSCOOTER MOTOR A solar power plant is good when there is sun. But…