Combination lock design and working principle
2010-4-21 14:06:54
![]()
3.1 Work
Non-contact IC card combination lock system to radio frequency identification

technology at the core, the main use of a dedicated reader Mifare card processing chip MFRC530. It is a small, maximum operating distance of 10 cm radio base stations, Mifare card, its functions include modulation, demodulation, producing radio frequency signals, safety management and anti-collision mechanism is non-contact IC card and wireless communications core module is non-contact IC card reading and writing the key interfaces. When the system card to enter sensitive areas of RF antenna, the electronic code lock to read non-contact IC card, card number and card number and user password read into memory, and time the user send card number and credit card to the user Loudong PC, and LCD display LCD display user information. When no card into the RF antenna sensing zone, MCU reads the real time clock chip and LCD display shows the current time and date.
3.2 hardware
Each electronic door locks can be independently locked state and the state of the monitoring, identification card is valid, real-time motion control card to control combination locks and alarm, reads the keyboard information, and a series of operations. combination lock system includes radio base station hardware MFRC530, keyboard input module, LCD liquid crystal display, monitoring and control module, RS485 communication interface, clock DS1305, information storage unit and buzzer alarm. The hardware block diagram of the circuit shown in Figure 2:
(1) systems using SCM STC89C58RD + as a control chip, which is the combination lock control system, the core, to control and coordinate the handling of combination lock system data. STC89C58RD + built-in 32K of Flash memory and 1280 bytes of RAM, with three 16-bit counter and a standard serial port, and with P4 port, strong encryption, superior interference immunity, low power, on-line system programmable and can be remotely upgraded and so on.
(2) radio base station module uses the Philips MFRC530 chips, MFRC530 card with RF wireless communications core modules. It is based on register settings of the sending data buffer to send the signal modulated by the TX1, TX2 antenna foot drive to the form of electromagnetic waves sent out, non-contact type IC card using RF field in response to load modulation. Antennas pick up non-contact IC card response signal sent through the antenna matching circuit RX pin, MFRC530 internal buffer to receive the signal detection and demodulation and processing according to register settings. Processed data sent to the MCU data bus waiting to read. MCU with SPI bus with MFRC530 way communication can be achieved with the non-contact IC card for wireless data transmission [3].
(3) information storage unit is mainly used to store user interaction information, and prevent network failures affect the normal use of combination locks, combination locks to achieve the isolation. User information storage unit database information requests and server line. Information storage unit produced by Ramtrom a ferroelectric memory (FRAM) FM38081, storage capacity of 32k × 8bits new FRAM, a high-speed read and write, low power consumption and unlimited read and write and other characteristics, especially for those who data collection, write time demanding occasions. As the MCU does not have the IIC bus interface, FM38081 and external interfaces need to adopt industry standard IIC bus, therefore the system uses the P2.3 and P2.4 port line to simulate IIC bus.
(4) system card in the card when the need to record the time, through the use of the United States launched DALLAS low-power ASIC DS1305 serial communication interface to provide a reliable clock. DS1305 support SPI serial data port or a standard three-wire interface and data correction time to read, can be single-byte byte Linking In His hair the way to visit. In this system, using SERMODE ground, use three-wire serial mode with the MCU data communication: SCLK as the clock input, SDA as a serial data input and output, RST as a communications allow signals.
(5) detection and control module is a real-time monitoring of the main door, lock status and communications status, and implementation of the controller's various control information, such as the implementation of the * implementation of the alarm; LCD liquid crystal display part of the selection to ST7920 as the controller of 128 × Chinese Characters LCD Module with 64 to display the time date and a variety of state information, as human-computer interaction interface; keyboard input module with 4 * 4 keyboard input, mainly for the MCU to provide user input information; buzzer alarm some compared to the error status of combination lock alarm sounds.
4. Software Design
combination lock system, the procedures include: MFRC530 on the non-contact IC card operating procedures, MCU and MFRC530 communication interrupt handler, read and write clock chip DS1305 and LCD liquid crystal display program, testing procedures and doors and lock state memory read and write procedures . Electronic Code Lock main program flow chart shown in Figure 3.
Figure 3, the main program flow chart of combination lock
5. Problems and solutions
5.1 The distributed architecture and centralized management of integrated
The establishment of a distributed management system of combination locks, a key technology in different parts of the electronic code lock and management of data between a central server transmission. If the combination lock and the server through the RS485 signals directly interact with information, will result in a shorter distance, information exchange is slow and poor anti-interference problems. The TCP / IP protocol, there were transmission speed, transmission distance is infinite, communication quality is stable, less susceptible to outside interference. Therefore, in the implementation process of communication through the use of RS485-TCP/IP RS485 converter to achieve, and TCP / IP communication protocol conversion, and information is the forward.
5.2 Electronic Code Lock isolation
In the combination lock system, combination locks each user information (such as card number and password) are stored in the corresponding electronic information storage unit lock, combination lock controller unit to read information stored in the corresponding user information, and and user input information through the comparison to determine the legitimacy of the current user to ensure that the network management center server or communication failure will not affect the use of combination locks, combination locks to achieve the isolation.
5.3 Electronic anti-lock conflicting
RF cards are fast anti-collision mechanism, to prevent interference with the data between the card, combination lock reader can "simultaneously" read more than one non-contact IC card card information, but the actual one only read the non- contact type RF card, through the LCD screen display is processing non-contact IC card card information, to prompt the user to enter the corresponding password, to resolve a number of non-contact type RF card and password appear inconsistent.
5.4 system security
IC card information on the decision of the encryption is the key to IC card security. Since the system uses the company PHILIPS Mifare card, it is a smart card (smart card), built-in central microprocessor (MCU) and the ASIC, so that card in the security and confidentiality, authentication logic, arithmetic and other micro-operation control orderly manner. To access a data card, Mifare class, first to complete the certification. Mifare card authentication using three certification process that can be automatically Authbent1 and Authbent2 order to achieve. After using this method, can effectively prevent illegal copying and the IC card data illegally modified. In the system implementation process, by non-contact IC card and enter the user password combination, and make logging, truly combination lock system security.