ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING Seven-channel electronic key. Encyclopedia of radio electronics and electrical engineering Encyclopedia of radio electronics and electrical engineering / Safety and security The main function of the device, which is described in the article, is access restriction, limiting the circle of people who have access to an object (product, device, etc.). These can be, for example, cells of a bank safe or components of a complex electronic product, access to which can be limited both by power supply circuits and by control circuits. A single-channel combination lock, perhaps, can be considered as a special case of such an electronic key. The software and hardware resources of the ATtiny2313A microcontroller make it possible to develop a simple multi-channel dongle with a simple and user-friendly interface. The secret code stored in the non-volatile memory (EEPROM) of the microcontroller will not be "lost" when the power is turned off, it is always easy to reprogram it using only the hardware resources of the microcontroller itself (i.e., a device based on it). The diagram of a seven-channel electronic key (hereinafter referred to as the key) is shown in fig. 1. It is assembled on the basis of the ATtiny2313A (DD2) microcontroller and the K555IR23 (DD1) eight-bit synchronous register. Consider its main functional units. The operating frequency of the microcontroller is set by a ZQ1 quartz resonator to a frequency of 10 MHz. The PB port controls dynamic indication made on digital seven-element indicators HG1-HG5 and transistors VT1-VT5. Resistors R3-R10 - current-limiting for indicator elements. The PD4 line (pin 8) of the PD port of the microcontroller is used for the keyboard to function.
The +5 V supply voltage is supplied to the device through the XP1 plug. Capacitor C6 filters the ripple in the +5 V voltage circuit. Blocking capacitors C4, C5 are included in the power circuit of the DD1 register and the DD2 microcontroller, respectively. Register DD1 is used to increase the number of output lines. The device has seven independent channels. To turn on channel 1, you need to enter secret code No. 1, channel 2 - secret code No. 2, etc. The output signals of the channels are taken from pins 1-7 of the XS1 socket. Immediately after power-up, all signals have a log level. 1. The device interface includes a five-digit display of digital seven-element indicators HG1-HG5 and a keyboard containing buttons SB1-SB8. The first four indicators display the entered code, the fifth - the number of the activated channel. As can be seen from the diagram, the hardware resources of the microcontroller are fully utilized. In the algorithm of the device, 14 modes of operation can be distinguished. The first seven of them are modes for entering working codes (No. 1 - code No. 1, No. 2 - code No. 2, etc.). If the working (entered from the keyboard) and the secret codes match, the corresponding channel number of the XS1 socket contact is set to log 5 for 0 s (signal "Channel N", where N is its number). Modes No. 8-No. 14 - modes for entering (writing) secret codes in the EEPROM of the microcontroller (mode No. 8 - for channel 1, mode No. 9 - for channel 2, etc.). Keyboard buttons assignment:
The device operation algorithm is as follows. Immediately after the power is turned on, the R1C1 circuit generates a system hardware reset signal at the microcontroller input. The number 00001 appears on the display. The DD2 microcontroller is waiting for a four-digit code to be entered. But first you need to write down the secret code for each channel. By pressing the button SB8 ("З / Р") we select the "Record" mode and enter the code for channel 1 from the keyboard. The microcontroller indicates it on the display and writes it to RAM. on the display, the code is written to the EEPROM of the microcontroller, becoming secret for channel 1. After that, zeros are again displayed in the digits HG6-HG1. Press the SB1 ("K") button to select the next channel and perform similar operations for channel 4, etc. To exit the recording mode, press the SB7 button, while the decimal point h on the HG2 indicator goes out. The device is ready to work. In operating mode, the microcontroller also waits for a four-digit code to be entered. It displays the code entered from the keyboard on the display and writes it to RAM. After entering the fourth digit and then pressing one of the SB1-SB6 buttons, the microcontroller byte-by-byte compares the entered code with the one written in its EEPROM and, if they match, sends a signal for 5 s to turn on the corresponding channel (sets log. 0 at its output) and sends signal to turn on the sound emitter BF1. After 5 s, the microcontroller turns off the signal (sets the channel output to log. 1), de-energizes the sound emitter and resets XP1 wf-2 on the display the digits of the entered code. If the entered code did not match the secret one, the microcontroller still resets the display (the number 00001 is displayed on it), but does not change the state of the channel output signal. It is advisable that access to the SB8 button be limited. The program uses two interrupts: Reset and a TO timer interrupt whose handler starts at TIM0. When switching to the Reset label, the stack, timer, ports, as well as flags and variables used in the program are initialized. In the interrupt handler of the timer T0, the procedure for polling the buttons SB1-SB8, the operation of dynamic indication, the conversion of a binary number into a code for displaying information on seven-element indicators, and the formation of a time interval of 5 s necessary to change the output signals of the channels (setting the signal level log 0 on the pins of the XS1 socket), and the procedures for writing and reading the typed code in the EEPROM of the microcontroller. In the RAM of the microcontroller from addresses $60 to $64, a display buffer is organized for dynamic indication (at address $60 there is a number that determines the channel number, and from address $61 to address $64 - the input code). The secret code from the EEPROM of the microcontroller is rewritten to its RAM at addresses from $66 to $69. The flags involved in the program are in registers R19 (flo) and R25 (flo1). On fig. Figure 2 shows a fragment of the program for writing the secret code for channel 7.
The developed program in assembler takes only about 0,7 Kb of microcontroller program memory. In the manufacture of the device, resistors s2-33N-0,125 were used, but any others with the same dissipation power and a permissible deviation from the nominal ± 5% are also suitable. Capacitors C1-C5 - ceramic K10-17a, C6 - imported oxide. Capacitor C4 is mounted in close proximity to the power outputs of the register DD1, C5 - as close as possible to the power outputs of the microcontroller DD2. Socket XS1 - HU-10 (mate - plug WF-10), plug XP1 - WF-2 (mate - socket HU-2). Indicators HG1-HG5 - HDSP-F501 (green glow). If there is no need for visual control of the dialed code, then the indicators HG1 - HG4, transistors VT1-VT4 and resistors R3-R18 can be excluded, this will not affect the operation of the device. The circuit for switching on the solenoid for retracting the bolt (valve) of the lock is shown in fig. 3. When contact 1 of the XP3 plug is logged. 0, the emitting diode of the optocoupler U1 is turned on and the phototransistor built into it opens. This opens the transistor VT1 and the voltage of 24 V from pin 1 of the XP2 plug goes to pin 1 of the XP1 plug and then to the solenoid, as a result of which the lock bolt is drawn into it. Resistors - any ratings and power dissipation indicated on the diagram, capacitor C1 - oxide K50-35 or an imported analogue In the general case, the circuit design of this node is determined by the specific parameters of the actuators connected to the key.
The described device does not require adjustment. If serviceable parts are used and there are no installation errors, it starts working immediately after the supply voltage is applied. To increase the degree of protection (increase the bit depth of the reference code), you can modify the software. In this case, only the four least significant (or the same number of most significant) digits of the entered code will be displayed on the display. Author: S. Shishkin See other articles Section Safety and security. Read and write useful comments on this article. Latest news of science and technology, new electronics: Machine for thinning flowers in gardens
02.05.2024 Advanced Infrared Microscope
02.05.2024 Air trap for insects
01.05.2024
Other interesting news: ▪ Hydrogen sailboat Nemesis Yacht ▪ Invisibility film for transmitting secret messages ▪ Hamster sleeps - telomeres grow News feed of science and technology, new electronics
Interesting materials of the Free Technical Library: ▪ section of the site Application of microcircuits. Article selection ▪ article Assembly workshop for beginners. video art ▪ article Who and how taught dogs to drive a car? Detailed answer ▪ article Convulsions. Health care ▪ article Postcard-boomerang. Focus Secret
Leave your comment on this article: All languages of this page Home page | Library | Articles | Website map | Site Reviews www.diagram.com.ua |