Intelligent Cabinet Lock Control System Based on Cloud Technology

With the rapid development of wireless communication and Internet of things, intelligent products have been widely used in living and industrial places. The purpose of this paper is to develop an intelligent controller and intelligent lock cabinet for the monitoring of optical cable handover box. It can monitor the temperature, humidity, fire, flood, vibration and the identity of the personnel in and out of the optical cable box, and send the data information to the management server through wireless communication, so as to realize the purpose of monitoring and management of the optical cable box. The products under development include intelligent controllers, smart keys and electronic locks. The smart key is used in conjunction with the electronic lock.


Introduction
In recent years the rapid development of communication industry, mobile, unicom, telecom companies such as across the country to build a large number of fiber optic cable transfer box, base station and manhole covers, such as infrastructure, an increase in the number of equipment also brought a series of management problems: wide distribution, large quantity, regulation is difficult, pry, lack of equipment is stolen, the door was open closed notes, etc. This subject is to design and develop a set of intelligent controllers and smart locks based on cloud, that is, Internet of Things technology in response to the demand. Our research and development starts from the actual needs of enterprises to monitor and manage optical delivery boxes distributed in provinces and cities across the country. Monitor the data of temperature, humidity, fire, flood, vibration and the identity of incoming and outgoing personnel in the cable box, and transmit these data to the enterprise management department remotely. On the premise of completing the basic functions proposed by the enterprise, we should try our best to save costs, add more humanized functions and improve the efficiency of use. 2 sparks in the box, low-lying areas flood, etc. Therefore, it is necessary to remotely monitor the situation in the optical cable handover box and authorize personnel to enter and exit optical handover box with special electronic locks and keys, so as to meet the purpose of monitoring and management of optical handover box. In addition, there is no power supply inside the optical delivery box, so the whole scheme needs an independent power supply, and it is required not to change the power supply frequently. According to the above analysis, the system is composed of master board controller, electronic key, electronic lock, sensor and server. A simple schematic diagram of the system is shown in Figure 1. The intelligent controller is placed in the optical cable handover box to collect the data of various conditions in the box through various sensors. Moreover, since remote monitoring is needed, the intelligent controller needs to transmit the collected data to the server computer controlled and managed. High wired cost, difficult wiring, long distance data transmission unreliable. Therefore, to eliminate the wired scheme, decided to use wireless transmission mode. The various technologies of wireless transmission are analyzed, and the controller needs to be placed in different areas, such as mountain villages, towns and cities. Decide to use the GPRS network communication function of the mobile phone card to send the data collected by the controller to the remote IP designated server. The country's communications infrastructure is now so comprehensive that almost all of the country can receive mobile phone signals and enable pointto-point wireless data transmission. It can transmit data to remote servers with public network IP addresses and charges a low per-traffic rate.

Functionality to implement
The functions to be implemented are: 1) The light delivery box shall be installed with an intelligent lock, which shall be opened with an intelligent key. Another mechanical key shall be used as a spare, and the controller shall be installed inside, and has the state self-check function, the server can at any time to view each optical box of various state quantities (water level, wet Degree, temperature, vibration, fire), when there is an abnormal state of the system to send an alarm; 2) Each smart lock and smart key has a built-in fixed number. The key number corresponds to the identity of the holder. Only when the number of smart lock and smart key is matched successfully can the lock be unlocked.
3) The smart key is equipped with a large capacity rechargeable battery, which supplies power to the smart lock when opening the door. The smart key reads the smart lock, and search within the internal stored permission number, if there is permission, that is, unlock; 4) The intelligent key is equipped with radio frequency communication function inside and in the controller to transmit the intelligent key number, etc 5) The permission of the smart key can be changed or increased by downloading the authorization of the device. 6) An Angle travel switch is installed inside the door to detect the state of the door opening and closing, and the state of the door opening and closing as well as the letter of opening and closing. Information transmission is wired to the IO port of the controller; 7) Under normal circumstances, the intelligent controller sends each parameter message to the server once a day through GPRS network communication information, such as temperature, humidity, vibration, smoke, controller power, etc. Detection time interval of each parameter adjustable, regulation rules or instructions are set uniformly or separately by the server. Pay special attention to abnormal conditions: fire appearance, disaster, flood, excessive humidity, burglary, or opening a door with a mismatched key, an alarm should be sent immediately, and write down the status data, controller number, time and other information at this time; 8) The controller is equipped with a large-capacity battery, so it is not necessary to sleep when working, wake up when working, and reduce the power Consumption, ensure that the working time of the battery is not less than 6 months; 9) The data transmission between the server computer and the intelligent controller needs to be carried out in accordance with specific data protocol.

Local terminal design
According to the functions required by the whole system, the hardware circuit is divided into four parts, namely intelligent controller data part, intelligent controller data sending part, intelligent key part and electronic lock part. The controller's main chip USES the ARM Cortex-M3 kernel based STM32 series. The main chip of smart key and lock core adopts ATmega88PA. The chip is a low power 8-bit CMOS microcontroller based on AVR enhanced RISC structure. The power supply part is an important part. The power supply voltage of lithium battery is 3.6V, the power supply voltage of SCM is 3.3V, and the normal operating voltage of SIM900A is 4.0V-4.2V. Therefore, it is necessary to make corresponding transformer treatment. TPS733Q and TPS63030 chips are selected to provide 3.3V voltage and 4.2V voltage of SIM900A to a single chip. The power supply of SIM900A needs to adjust two resistors on the tenth pin of TPS63030 to control the output voltage, but the current in the circuit should not be too small. The intelligent controller sends the newly added data to the sending module at a specified time every day, and then sends it to the server remotely. Therefore, it is necessary to record the minutes and seconds of the year, month and day, and regularly send the normally recorded data every day. Select IIC interface to read the time of digital clock chip RX8025. Temperature and humidity sensors using digital DHT11, this is a composite sensor, the sensor consists of a resistance type humidity sensor and a NTC temperature sensor, simultaneously monitoring temperature and humidity. Both the water level sensor and the flame sensor are trigger-type and send a switch measuring 0 or 1. Only an IO port that controls its chip is connected to the sensor. Read the corresponding high and low level signal. Intelligent electronic keys and controllers use radio frequency technology for data exchange. NRF24L01 +, the most commonly used chip, is selected. This chip has a near-field communication range of 200 meters and adopts the globally open ISM frequency band of 2.4ghz. Safe and reliable for short distance communication. Operating voltage: 1.9V to 3.6V. The data sending part and data acquisition part of the intelligent controller are connected by serial port. The two parts interact with data and have clear functional division. The data sending part and receiving part adopt independent control chip. STM32L152RBT6 MCU is also selected as the core, between the power line and ground wire to connect a high frequency characteristic of 0.1 F and a 10 F capacitor. RTC clock circuit requires the use of 32.768K oscillator, parasitic capacitance of 6pF. The pulse of the reset circuit should be at least 300ns, and the external reset circuit should not interfere with the output of the internal pulse. To simulate it less conveniently to pull BOOT0 down to earth, operate the Flash boot kernel. The crystal oscillator and capacitor must be close to the main chip, and the power supply voltage is 3.3V. The SCM first discipline should be connected to 3.3V to prevent simulation errors. In order to prevent interference, the active crystal oscillator is used as the external crystal oscillator of the minimum system. Electronic keys are divided into two parts: the circuit part and the mechanical shape part. This section discusses the circuit part. The electronic key is an important component that has three functions: 1) Unlock function; 2) Conduct radio frequency communication with the intelligent control card placed in the optical crossover box; 3) For the distribution and management of personnel of optical cable handover box and the authorization management of optical cable handover box; The first and second functions are rigid functions. The third function is the flexible function, as a management function, which affects the subsequent chip selection, circuit design and programming, optical delivery box has one-to-one management, many-to-one management, and upper master key management. According to the first and second functions, we also divided the key into two cores according to the functions of the controller, one is responsible for unlocking and the other is responsible for wireless communication with the controller. Two control chips interact with data through a serial port. Because of its simple function does not need to use a 32bit MCU, considering the key should be delicate, small packaging of single-chip computer is running out, there are analysis patch type of AVR series MCU in the second quarter, and less than electronic locks lock also need SCM into the lock inside, so choose the ATmega88PA AVR series the microcontroller. Based on the above three functions, the schematic circuit diagram is designed. The upper key board is equipped with radio frequency function. NRF24L01 + chip is selected for radio frequency communication, with communication distance up to 200 meters and working voltage between 1.9V and 3.6V. Operating temperature -20°~+85°. Locks are divided into mechanical parts and electronic parts. The electronic part is placed on the part of the lock core, and the electromagnet is controlled by a circuit to attract and repel the iron core, that is, the iron core corresponding to the tooth shape of the key in the lock [51]. So as to achieve the purpose of switch lock. The MCU chip, which is controlled by the circuit board inside the lock core, is mainly used to match the communication password with the intelligent electronic key, so as to control the IO port high and low level of the MCU to drive the PNP triode to control the current of the electromagnet and achieve the purpose of locking. After circuit design, PCB wiring and welding, the system products are shown in Figure 3.36. There are four parts: intelligent controller, intelligent electronic key, electronic lock and all kinds of external sensors. The intelligent controller and intelligent key of the Internet of Things designed by the project are placed inside the optical cable connection box, so the external design should be beautiful and exquisite, and also be conducive to installation. The designed controller circuit board is placed inside the black box and fixed with screws. The bottom of the box has a round installation slot, which is easy to be stuck directly on the cable connection box. The external sensor is placed in the position to be installed with a three-meter-long wire and plugged into the control panel. The internal two teams of orange lithium battery is the power supply of the whole system, and the controller has done the docking plug, directly plug and unplug can be turned off. Some of the other sockets are installed on the corresponding socket and can be used directly. The shape of the whole controller structure is shown in FIG. 4 in 3.37. The size of the black controller box is: 19cm×16cm×7.5cm. The curve of the shape frame of the smart key matches the shape of the circuit board, and the black outer cover is also customized. The four conductors on the head are spring conducting needles, which can ensure close contact with the contact point of the lock. The shape and structure are 1 in Figure 2 As shown, the size, shape, size, length, width and height after conversion are as follows: 5.8cm×4.2cm×2.0cm. As can be seen from Figure 3.36, at the bottom of the lock, the four yellow contacts are where the electronic key communicates. The external structure of the lock is shown in Figure 3.36 (2). The mechanical shell is made of steel. The size, size, width and height after conversion are 15cm×5.5cm×5cm.

Conclusion
This paper introduces the whole process of research and development of intelligent controller and intelligent key based on wireless communication, discusses the research and development status of wireless communication technology and intelligent key at home and abroad, and analyzes in detail the application of Altium Designer to design circuit and PCB wiring process. On this basis, the product hardware, software programming, computer programming, TCP network server debugging process made a detailed explanation.