Electronic lock, which is also based on 51 series single chip microcomputer (AT89051) as the core, with the corresponding hardware circuit, complete the password settings, storage, identification and display, drive the electromagnetic actuator and detect its driving current value, receive the alarm signal sent by the sensor, send data and other functions.
The MCU receives the input code and compares it with the password stored in EEPROM. If the password is correct, it drives the electromagnetic actuator to unlock. If the password is incorrect, the operator is allowed to re-enter the password for up to three times. If the three times are incorrect, the MCU reports to the intelligent monitor through the communication line. Police. The SCM sends the status information of each unlocking operation and the driving current value of the electromagnetic actuator as the status information to the intelligent monitor, and sends the alarm information from the sensor interface to the intelligent monitor as the basis of intelligent analysis.
1, basic principles and hardware components
The system of intelligent cipher lock consists of intelligent monitor and electronic lock. The intelligent monitor supplies the power needed by the electronic lock and receives the alarm and status information. Line multiplexing technology is used here to make the power supply and information transmission share a two-core cable, which improves the reliability and security of the system.
1.1, the basic principle and block diagram of intelligent monitor.
The block diagram of intelligent monitor is composed of single chip microcomputer, clock, keyboard, LCD display, memory, demodulator, line multiplexing and monitoring, A/D conversion, buzzer and other units. Mainly complete the communication with electronic locks, intelligent analysis and communication line safety monitoring and other functions.
The intelligent monitor is always in the receiving state, receiving the alarm information and status information from the electronic lock in a fixed format. For alarm information, sound and light alarm will be issued immediately through LCD display and buzzer; for status information, it will be stored in memory, and compared with the historical state of electronic locks before this time, the change trend can be obtained, the future state change can be predicted, and the corresponding information can be provided to the staff on duty through LCD display. For decision making. Intelligent monitor and electronic lock establish communication links at the same time, through the A / D converter real-time monitoring of power supply current changes across the communication line, effectively prevent damage caused by human factors, to ensure the smooth communication line.
1.2, the basic principle and block diagram of electronic locks.
The block diagram of the electronic lock is also based on the 51 series single chip microcomputer (AT89051) as the core, with the corresponding hardware circuit, to complete the password settings, storage, identification and display, drive the electromagnetic actuator and detect its driving current value, receive the alarm signal sent by the sensor, send data and other functions.
The MCU receives the input code and compares it with the password stored in EEPROM. If the password is correct, it drives the electromagnetic actuator to unlock. If the password is incorrect, the operator is allowed to re-enter the password for up to three times. If the three times are incorrect, the MCU directs the intelligent monitoring through the communication line. Alarm. The SCM sends the status information of each unlocking operation and the driving current value of the electromagnetic actuator as the status information to the intelligent monitor, and sends the alarm information from the sensor interface to the intelligent monitor as the basis of intelligent analysis.
2. Key technologies:
In order to improve the security and reliability of the smart password lock, in addition to the measures taken in the device selection (such as the device with low power consumption and wide temperature range), some key technologies are also adopted in the design.
2.1, line multiplexing technology
The smart monitor and electronic lock are placed off-site, and the smart monitor supplies the power required by the electronic lock and receives the alarm and status information it sends. If the communication line and the power supply line are separated, it is necessary to increase the number of cable cores and increase the safety hazard. This paper adopts the line multiplexing technology, which uses only one two-core cable to realize the transmission of power and information. The schematic is shown in Figure 3.
At the transmitting end, the electronic lock boosts the modulated data signal through the pulse transformer T and sends it out; at the receiving end, the pulse transformer T steps down the received data signal and sends it to the demodulator to reduce the carrier signal during transmission. Loss in the middle. In order to reduce mutual interference between communication and power supply, the selection of choke coil L and coupling capacitor C should be considered comprehensively.
Let the carrier frequency fo=400kHz, in order to ensure that most of the signal energy is transmitted to the receiving end, take L=33.7μHC1=0.047μF.
2.2, current monitoring technology
In order to prevent the artificial destruction of the communication line and the electromagnetic actuator from causing the current flowing through the electromagnetic coil to be excessively burnt due to some reason, the current monitoring technology is adopted in the design of the smart code lock. The current monitor uses the MAX471 current-to-voltage conversion chip from MAXIM. The chip can convert the measured current I into a ground output voltage U, and has the characteristics of large measuring range, high precision, and the output voltage U and the measured current I are proportional. The current monitor output voltage is sent to the A/D converter. The MCU reads the A/D conversion result to know the current change in the line, and finds the abnormality in time by analysis and issues an alarm signal. The principle circuit is shown in Figure 4.
2.3, data communication and preprocessing technology
The intelligent monitor receives the status information sent by the lock (including the opening and closing of the lock, the first password error, the second password error, the third password error, etc.), the current value flowing through the electromagnetic actuator coil, and Reading the supply current value of the communication line at that time, the three combine to form a data block, wherein the operation state occupies 1 byte, the supply current occupies 2 bytes, and the coil current occupies 2 bytes. The intelligent monitor is always in the receiving state during communication with the electronic lock. In order to improve communication reliability, this paper adopts the method of repeated transmission in the communication protocol. The electronic lock repeatedly transmits 5 times for each group of data. After receiving the data, the intelligent monitor corrects the error by using the large number decoding law. The accuracy of data reception. In addition, in order to save memory, pre-processing technology is adopted for the received data, that is, after receiving one data, the data is first compared with the set threshold, and if it is greater than the threshold, an over-limit alarm is issued; if less than The threshold value is compared with the same type of data received on the same day, and the larger one is retained. In this way, the data stored every day is the maximum value in the same type of data, and the flow chart is as shown in the figure.
2.4, intelligent analysis
The intelligent analysis and prediction technology is based on each received data block, compared with the recorded value of the previous similar data, analyzes the magnitude and trend of the current change caused by the operation, finds problems in time, and reports the management personnel. Improve the reliability of the entire system.
3, system software design:
The intelligent password lock software uses the 51 series MCU assembly language to separately program the intelligent monitor and the electronic lock. The intelligent monitor software includes keyboard scanning and LCD display programs, buzzer drivers, clock modification and reading programs, data communication and pre-processing programs, intelligent analysis programs and line monitoring programs. The electronic lock software includes modules such as a keyboard scanning and decoding program, an LCD display program, a communication program, an electromagnetic actuator drive and detection program, and a sensor interface program. The modular design method is used in the software design process to facilitate reading, debugging and improvement of the program.
The intelligent password lock fully utilizes the software and hardware resources of the 51 system microcontroller, and introduces intelligent analysis functions to improve the reliability and security of the system. It is welcomed by users by installing it in a certain type of safe. In addition, the smart password lock can be modified in software and hardware to form an intelligent distributed monitoring network, achieving centralized monitoring and management within a certain range, and is widely used in finance, insurance, military and other security fields. Application prospects.
Electronic lock products
1, reinforced glass door lock
◆Automatic storage unlocking record Attendance function instead of access control (optional)
◆Illegal unlocking Phone/mobile remote alarm (optional)
◆Digital password and electronic sensor touch key
◆Wireless remote control function (optional)
◆Auto/manual lock function
◆Illegal intrusion alarm function When the door lock is locked, an alarm sounds when the door is forcibly opened or the lock body is broken.
2, smart electronic lock
◆All moving parts, the force-receiving parts are made of stainless steel precision castings, which are compact and durable.
◆ Tiandi bolt function, when the door is locked, as long as the handle is lightly lifted, the Tiandi bolt and the anti-smashing lock tongue all extend out when opening the door, as long as the handle and the lock tongue are retracted.
◆Indoor anti-locking, rotating the anti-lock knob in the room to the anti-lock position, the indoor mode can not open the door.
◆Outdoor anti-locking, when the card or password is set to outdoor anti-lock, the indoor rotating handle can not open the door. No need to open the door left or right, free to replace all the troubles of opening and closing the door
3, wireless electronic lock
◆Wireless electronic lock is ready to use, unlocking and unlocking to send alarm information in real time to notify the monitoring terminal remotely.
◆ Lock body switch status information is reported in real time, and the monitoring platform is uploaded by the vehicle host for real-time monitoring by relevant personnel.
◆Automatic sealing and unsealing, the opening and closing of the lock body can be realized remotely through the host, the handheld and other devices.
◆ Alarm information re-delivery mechanism to ensure that important data is not leaked.
◆ Ultra-low power hardware and software design, can be used for more than 5 years without charging.