A WSN system for high-precision cable manhole cover movement detection uses TDOA ranging method

In the research of the power cable anti-theft problem, the demand for high-precision positioning of the cable manhole cover is proposed. For this reason, a wireless sensor WSN node with ranging function is studied. The system uses the Stm32 chip as the MCU core, uses 433MH radio frequency signals and ultrasonic signals to implement a ranging circuit based on the TODA principle of arrival time difference, and sends data to the cloud server through the NB-IoT module to achieve the purpose of alarming. The system has the characteristics of good real-time performance and high positioning accuracy. It can be applied to the theft prevention of cable manhole covers, and can also be extended to the detection of indoor moving objects.


Introduction
Wireless sensors have developed from the last century to today, and have been applied to various industries. They are currently used in various physical parameter detection [1], including environmental detection, medical care, and industrial control [2]. Now based on the base station LBS positioning technology is becoming more and more mature, with the rise of NB-IoT technology, wireless sensor networks will have more application examples. For example, it is often used for environmental detection in power cable wells and underground passages to ensure the safety of facilities and equipment and human resources [3]. WSN detection technology is more and more widely used in power systems. WSN technology is of great significance for realizing the safety, reliability and economic operation of cables and ensuring the safety and economy of power systems [4][5]. In addition, WSN is often used for item positioning in large warehouses and large supermarkets, as well as personnel positioning in dangerous situations such as earthquakes and fires [6] Therefore, indoor positioning has important practical significance. In the cable monitoring system in the cable well, cable anti-theft is a difficult problem. At present, detecting the movement of the cable manhole cover has become one of the main prevention and control methods. Because the outdoor positioning technology uses GPS, Beidou navigation, telecommunication base station and other technical means that do not support cm-level positioning, it is difficult to complete the movement detection of the cable manhole cover. Therefore, a high-precision positioning device is required. At present, indoor positioning mainly relies on two propagation models based on ranging (Rang-base) and non-ranging (Rang-free). The propagation models based on ranging mainly include: Based on Received Signal Strength Indicator (RSSI) [7][8], Based on Time of Arrival (TOA) [9][10], Based on Angle of Arrival (AOA) [11], Based on Time Difference of Arrival (TDOA) [12][13] 4 models. Through the four models to achieve medium comparison, the TDOA propagation model can obtain high-precision distances in an indoor environment and is easy to implement. The other three methods can only calculate the distance after proper long-distance propagation. Therefore, this paper designs a ranging system based on the TDOA model to assist the wireless sensor network node to realize the movement detection of the manhole cover.

System application introduction
As shown in Figure 1: In the visual environment of a single-story building, the nodes in the positioning system are divided into three types: one is a sink node, one is a general node, and the other is an unknown node. The other two kinds of nodes can realize ranging from the unknown. The unknown node is bound to a moving object and sends a set of ranging signals by controlling the ranging system. The ranging signal contains two different rate signals. Generally, the node calculates the distance by receiving the arrival time difference of the ranging signal, and then passes through the Zigebee network of the CC2420 chip. The distance information is transmitted to the Sink node to realize the movement and positioning of the object. Among them, the sink node can send the mobile data results of the general node detection object to the cloud server through the NB-IoT module, so as to realize the positioning alarm and achieve the anti-theft effect.

Principle of Ranging System
The node can control the RF signal and the ultrasonic signal to form a distance signal. The MCU controls the 433MHz module to send an electromagnetic wave signal (RF) with password information, and then modulate an ultrasonic signal with a size of about 40KHz (US). The receiver detects these two kinds of signals. Because these two signals have different propagation speeds in the air, there will be a time difference of arrival at the receiver .
(1) and calculate the distance to the transmitter according to the propagation speed of the ultrasonic signal r u r u (2) r is a radio frequency signal, and u is an ultrasonic signal. It is mentioned in the existing ultrasonic research that the ranging accuracy can reach the millimeter level in theory [14]. In the process of ultrasonic transmission, the propagation wave speed is affected by the temperature parameter. When the temperature is in the range of 0 ℃ to 20 ℃, the wave velocity is 331.4 m/s to 340 m/s, and the wave velocity will increase or decrease by about 0.6 m/s every time the temperature rises or falls by 1 ℃. The formula for the speed of sound commonly used in industry: u 331. 05 0. 61 (3) where is the temperature in Celsius. In an indoor environment, the temperature t is usually 20 ℃, then u =343.25 m/s. In formula (3), r  3×10^8 m/s, because r >> u , can be approximately regarded as . [14][15]

System structure
The overall design of wireless network sensor nodes is shown in Figure 2. The system structure includes power supply module, MCU controller, ultrasonic transceiver module, 433MHz radio frequency module, BC26 IoT module, CC2420 Zigbee module, expandable sensor interface, debugging UART interface. These modules are the core part of the high-precision ranging function in the dotted frame.
The MCU microcontroller is a 32-bit Cortex-M3 low-power CMOS microprocessor Stm32f103, which mainly implements ranging signals, calculating distances, and sending data. Considering the problem of work efficiency, the duty cycle detection method is designed as shown in Figure 3. The duty cycle detection method is designed to communicate once every 60s. The detection work is completed and enters the dormant state, the system module is configured into a low power consumption mode during the dormant period.
433MHz radio frequency module uses RF12A sensor chip. it communicate with MCU through SPI interface, the connection is shown in Figure 4. MCU sends data packets in the (0xb8+ID) field to the module through the SPI interface, and the RF12A modulates the signal through the antenna and sends it. When the RF12A is in the receiving state, it will notify the MCU processor through the nIRQ pin when it detects an RF signal on the channel.  The design Power supply is shown in Figure 5. Sy8088 chip is used to realize 5V to 3.6V, and then 3.6V to 3.3V through Xc6202 chip. The two-stage power supply circuit meets the energy requirements of the system modules.
As shown in Figure 6, the principle of ultrasonic transceiver: MCU controls the I/O pin to alternately generate 8 pulse signals with a duty cycle of 50% within 1s. The signals are modulated by PNP and act on the ultrasonic probe, causing mechanical vibration to emit ultrasonic waves. When the ultrasonic probe detects a 40 KHz ultrasonic signal, it will produce mechanical vibration induction, forming an initial signal Ui, which will send a large signal through a two-stage differential circuit and suppress high-frequency signal interference, and then superimpose the Ui signal with the basic voltage to produce a large amplitude wave Type, through the signal comparison circuit to determine the Ui signal logic change [6], to achieve signal reception. The design of the ultrasonic circuit determines the accuracy of the ranging, and the system chooses the HC-SR04 integrated transceiver probe sensor. The working voltage is 3.3V-5V, and the reflective detection range reaches 4.5m. The specific design circuit is shown in Figure 7 The NB-IoT module selects the BC26 chip, which can achieve two-way communication, support 2.1V-3.63V power supply, compatible with GSM/GPRS network, can quickly and flexibly realize 2G switching NB-IoT network, and support 30db vertical and patch antennas at the same time, access to the network After that, if you don't send the number, it will automatically enter sleep. The specific design is shown in Figure 8.
The Zigbee networking module uses the HFZ-CC2420EM module, which can provide a mature zigbee protocol stack to facilitate networking, and supports the SPI interface to communicate with a 32bit MCU. The system's power supply module covers its 2.1-3.6V power supply requirements. The design scheme is shown in the Figure 9.  Figure 9. CC2420 usage diagram 3. software design BC26 docking mobile cloud platform includes two parts of work. First, register an account on the platform, register the product ID and field information, for the platform to verify the validity of the uploaded data. Second, in the BC26 sending process, first wait for the MCU to send a command, start self-checking ID identity information, search the network, register and log in, encapsulate the data packet, and send the data to the platform. The specific design is shown in Figure 10.
The ranging software design is mainly divided into two programs: receiving and sending, as shown in Figure 11. the sender sends a signal after executing the ranging code, and when the receiver waits to receive the RF signal in the ranging signal, it starts to count until the ultrasonic signal is received. Distance. if it is not received within a fixed time, it will give up this time and enter the standby state.
Anti-theft function design: The sensor node measures the distance of the moving object and sends the data to the sink node. The sink node determines whether the movement threshold is exceeded according to the change in the distance of the measured node. If so, the BC26 module is called to send the data to the server to realize the location detection. The specific design is shown in Figure 12.

System test results and analysis
The range experiment is carried out in a room temperature environment, set to pass 0cm-1000cm, and measure the average value of 2 times with an interval of 100cm. The maximum measurement distance of the system is about 860cm at an angle of 0°. there is a blind zone of 2 to 4 cm. in the 0° experiment, the error increases from 0.4-2.3cm. The probe measures the average value twice at the relative angles of 20°, 40°, 60°, and 80°. Except for the blind zone, the accuracy can be kept within 12cm in the range of 0cm-900cm, and the distance measurement is basically impossible at 60°-90°. The quality of the ultrasonic probe will affect the state of ultrasonic generation. Through testing two different ultrasonic probes, it is found that the sound wave intensity is inconsistent. Therefore, the circuit design, material and other reasons cause the inconsistent transmission power intensity to affect the distance. In the 2～4 cm experiment, it was found through the oscilloscope that the square wave signal could not be detected normally, which led to the failure of reception. The system uses the RF signal as the start signal, and the RF transmission time is affected by the antenna power consumption, which may cause inaccurate timing and may also lead to errors. The system needs to consider battery power supply for power failure. Therefore, in the theoretical situation, the system power consumption is the sum of the normal working current of each module. 50.4mA through design power consumption current. Set the MCU to low-power Stop mode during idle time, and set the RF12A to Standby mode when idle, IALL=0.014+0.031+17.4+2+0.3+0.024=19.769mA, and the operating current drops by 13.756mA. The actual measurement is about 70mA when sending data, and about 20mA when idle. The deviation between the measurement result and the theory is mainly due to the time-sharing of the module and the non-linear power consumption of the wireless module. The MQTT protocol is realized through BC26 to upload data to the OneNet platform of China Mobile Internet of Things, and the system realizes the voltage detection and mobile alarm functions of node1.

Conclusion
Compared with the reflective ultrasonic distance measurement system, the distance measurement range of this system is increased to about 860cm, the error is controlled within 1.4%, and the maximum effective wide angle is about 60°. This system can well realize the cm-level distance measurement, thus completing the anti-theft function of the cable manhole cover. It provides a successful reference case for wireless sensor network applications.