Infrared and ultrasonic complementary intrusion detection method
Aiming at the problem of distance detection of moving targets, a distance measurement method based on the complementary use of infrared detector and ultrasonic sensor is proposed. The combination of two different types of sensors enabled the detection of moving targets in the range of 20 m, the use of infrared detectors to sense distant targets and measure distances, the use of ultrasonic sensors to achieve close-range measurements, and the upload of intrusion information through the Internet of Things module. The measurement results show that the error is about 3.2%, which has reference significance for application scenarios such as intrusion detection.
0 Introduction
Intelligent and networked security monitoring equipment has gradually become an industry with huge demand and complete system, and is a hot application direction in the field of Internet of Things [1]. Moving object detection has also been adopted by more and more industrial and agricultural production [2].
Intrusion detection can be divided into perimeter intrusion detection and area intrusion detection [3]. Perimeter refers to the outer defense line of the warning area. Perimeter intrusion detection generally focuses on the detection of the border of the warning area, and mainly uses detection technologies such as optical fiber, infrared, leakage cable and electronic pulse. Although the detection results are simple and clear, there are also problems such as high maintenance cost and high false alarm rate. The boundaries of regional intrusion detection are fuzzy, and scanning observation is mostly carried out for a certain area, mostly using microwave radar, video surveillance and other technologies. Such technologies have good visualization and interactive effects, but have high technical barriers and complex operation [4-6]. With the continuous subdivision and deepening of user needs, the boundary between the two tends to blur. In the agricultural field, an effective and intelligent area intrusion detection device is needed to monitor and prompt field personnel, and enable managers to obtain management data in real time. The intrusion detection device shall have the characteristics of simple operation, reliability and durability.
In order to meet the above requirements, this paper combines passive infrared detector and ultrasonic sensor to design a combined multi-detector [7] system, and introduces the Internet of Things module to make the system have remote and real-time working ability [8].
1 Overall system scheme
The system consists of infrared detector, ultrasonic sensor, MCU and Internet of Things module 3 parts. When someone or animal enters the detection area, the infrared detector automatically detects and completes long-distance measurement, and sends a prompt signal to the MCU. When the proximity reaches the set threshold, the MCU starts the ultrasonic sensor and performs short-range ranging. Upload monitoring data through the iot unit.
Figure 1 shows the overall design of the system, wherein the infrared detector is equipped with Fresnel lens to improve the receiving sensitivity of the system, and the detection signal is amplified and collected by the back-end processing circuit. When the invasion target is far away, the distance is measured by infrared detector. When the invasion target is close to a certain extent, the ultrasonic sensor is started to complete the distance measurement. The ultrasonic sensor consists of two probes, receiving and transmitting, which generate and receive a set of continuous pulse sequence respectively. The distance measurement is realized by using the characteristic of constant ultrasonic propagation speed. Finally, the MCU sends the detection result to the client in real time.
1.1 Remote measurement based on infrared pyroelectric detector
Commonly used infrared pyroelectric detectors are generally composed of two groups of pyroelectric sensitive units in reverse polarity series, as shown in Figure 2 (a). This design can offset the influence of thermal noise in the background environment, and also reduce the external interference of relatively stationary heat sources.
When the moving heat source target appears in the detection region, two positive and negative peaks will be generated, and the magnitude of the peaks is inversely proportional to the distance. It can be seen from FIG. 2 (b) and FIG. 2 (c) that when the same target is in position ①, ② and ③, the peak value of the sensitive voltage is V1, V2 and V3, respectively. Using this feature, we can measure the distance of the invading target.
Detector output
1.2 Close measurement based on ultrasonic sensor
Ultrasonic ranging has three detection methods: phase, acoustic wave amplitude and transit time. Due to the high cost of phase detection hardware and the shortcomings of acoustic wave amplitude detection, the transit time detection method is used in this paper.
Figure 3 shows the principle of transit time detection, where T and R represent the transmitting end and the receiving end respectively. If the propagation speed of ultrasonic wave is v and the propagation time is Δt, the distance S can be expressed as
If the measurement distance between the sensor and the intrusion target is L, and half of the distance between the two sets of sensitive probes at the receiving end and the transmitting end is H, then:
When L is much greater than H, L can be expressed as
Figure 3. Principle of transit time detection
1.3 Weighted average distance acquisition method
The change of the output voltage peak of infrared pyroelectric detector is greatly affected by the detection distance, and the measurement linearity is good for the measurement above 10m. In the range of 5~10 m, the linearity becomes worse, but still shows a certain positive correlation. In the range of 5m, the sensor reaches saturation, and the output voltage peak is almost unchanged. Since the range of ultrasonic sensors is mostly about 10m, this paper adopts the method of segmental processing and weighted calculation combined with the characteristics of the two sensors.
Ultrasonic sensors are used to measure targets within 5 m, and infrared pyroelectric detectors are used to measure targets above 12 m. For targets within the range of 5 to 12 m, the two measured values are weighted. The calculation process is shown in Equation (4) :
2 System Design
2.1 Infrared detection circuit design
The infrared pyroelectric detector is sensitive to moving heat source to identify the intrusion target, use the in-phase summing circuit to offset the background output voltage, use the reverse phase differential amplifier circuit to amplify the intrusion signal, introduce the voltage comparison circuit, and compare the amplified intrusion signal with the proximity voltage threshold. The output of the comparator is provided to the MCU. Figure 4 shows the design scheme of the infrared detection part.
When there is no infrared heat source intrusion, the background output voltage of the infrared detector is about 0.7V, and when there is infrared heat source intrusion, the output voltage fluctuation range is about 10 ~ 40mV.
Therefore, the R4 and R5 voltage divider circuits designed in the circuit structure of Figure 5 can generate appropriate summing voltage (V_add, about -0.7V) according to the characteristics of the infrared pyroelectric detector and the partial pressure of the peripheral environment, and add the summing voltage with the detector signal to obtain the signal V_PIR_1. Since V_PIR_1 is a motion signal detected by an infrared detector, the signal can be transmitted to the reverse differential amplifier circuit for amplification to reduce the influence of peripheral environments such as temperature, and the signal is connected to the AD input terminal of the MCU. Before the V_PIR_2 signal is transmitted to the reverse amplifier, a first-stage design follower is added to intercept the negative voltage that may be generated by the reverse summation, while avoiding the influence of subsequent circuits on the previous stage. The voltage threshold can be adjusted by adding a variable resistor R11 to the reverse input of the comparator, thus adjusting the recognition distance. The output signal of the comparator (V_PIR_4) is transmitted to the MCU, and the MCU enables the ultrasonic ranging function according to the signal. The infrared detection and processing circuit given in Figure 5 consists of four parts in turn: in-phase summation amplification, inverse phase differential amplification, emitter follower and voltage comparison.
2.2 Ultrasonic circuit design
At normal temperature and pressure, the ultrasonic propagation speed in the air is constant, about v = 341 m/s, respectively record the time of ultrasonic transmission and reception, obtain Δt, and use formula (3) to obtain the distance of the measured target. Figure 6 shows the circuit design scheme of this part.
When the output voltage of the infrared thermal power supply detector is higher than the set threshold, the MCU enables the pulse sequence generation circuit to produce a set of 40 kHz pulse sequences, each group contains 8 pulses, as shown in Figure 7. And the pulse sequence group period is set at 500 ms to ensure that each pulse does not affect each other.
If the number of pulse peaks is too small and the emission intensity is small, the waveform distortion is easy to be caused by external factors [9]. However, the number of pulse peaks is too large, so that the length of the whole string wave can not be ignored, and the front segment of the whole string wave may be attenuated when reflected, so it is difficult to distinguish whether the echo is the front segment or the back segment of the whole string wave, which is obvious when the distance is slightly far away, and in the near distance, the signal has not been transmitted, and the echo has reached the receiving end, which also seriously affects the distance measurement. When the actual number of pulse peaks is 8 ~ 10, a good ranging effect can be obtained.
In order to improve the range, a pulse shaping circuit is added to the circuit in Figure 7, which consists of six inverters and two capacitors, where the 40 kHz square wave signal is transmitted in two ways, one way through the first-stage inverter to one electrode of the transmitter, and the other way through the two-stage direction to the other electrode. The square wave signal is added to both ends of the ultrasonic transmitting probe by push-pull output to increase the transmitting power, and the two reversers are connected in parallel to improve the driving capacity. The test range can reach more than 8 m. Figure 8 shows the ultrasonic receiving circuit. Adjusting the value of resistance R21 can fine-tune the center frequency of the received signal. When the value is 200 kΩ, the corresponding frequency is 40 kHz. Changing the size of capacitor C9 can adjust the receiving sensitivity and improve the anti-interference ability. When the CX20106A chip receives a 40 kHz signal, it can generate a low-level signal and transmit it to the MCU.
Figure 8 Ultrasonic receiving circuit
2.3 MCU and communication circuit
After the initialization of the system, the infrared pyroelectric detector is in the automatic detection state. When the intrusion target is detected, enter the remote measurement mode. When the intrusion target is approaching gradually and the detection output voltage exceeds the set threshold, the MCU enables the ultrasonic ranging circuit to enter the close-range measurement mode. The MCU automatically generates the intrusion log file and uploads the information to the service terminal, as shown in Figure 9. At the same time, the user can also set several key detection points, and the key point detection information is transmitted to the user's mobile terminal in the form of short messages.
The Internet of Things module adopts commercial products and is configured with external RF antennas, which can ensure the real-time and reliability of data transmission. The communication protocol MQTT network transmission protocol is selected, and the AT instruction is used to directly interact with the MCU to improve the processing efficiency.
When the MCU enables ultrasonic pulse transmission, the timer is first configured to make the receiving end wait, and the receiving is delayed by 1ms, so that the receiving blind area can be avoided.
From the ultrasonic ranging formula (1), it can be seen that the difference of ultrasonic transmit-receive propagation time (Δt) directly affects the accuracy of the calculation results. Under the condition that the accuracy of distance calculation results is better than 0.01m, formula (5) can be used to calculate the time ts spent by ultrasonic propagation of 0.01m distance:
Therefore, according to the calculation results of equation (5), the MCU timer resolution should be at least 29 μs. In order to ensure the measurement accuracy, the index should be increased by one order of magnitude, and the MCU crystal frequency of the system should be selected as 12 MHz.
3 Effect Analysis
The intrusion detection device was placed on a bracket with a fixed height of 1 m, and was measured when the tester passed through the detection area at a speed of 1 m/s (normal pace). For better analysis, 5 groups of measurements were completed in succession under the same conditions, and the measurement records were listed in Table 2.
According to the measurement data in Table 2, the relationship between the output voltage amplitude of the infrared pyroelectric detector and the distance is drawn. It can be seen from the figure that when the distance is less than 10 m, the output voltage amplitude of the infrared pyroelectric detector and the measurement distance have poor linearity, and the resolution is poor if it is used for short-range ranging. For targets over 10 m, the two show a good linear relationship. Using this part of the measurement data given in Table 2 to fit, equation (6) can be obtained:
Formula (6) can be used to achieve distance measurement in the range of 10 ~ 30 m, and the measurement error is less than 0.1m. The effect is shown in Figure 11 (b), which can meet the detection requirements for intrusion targets.
(a) The variation trend of voltage amplitude in the range of 5~30 m
(b) The variation trend of voltage amplitude in the range of 10 ~ 30 m
Figure 11 Distance measurement effect of infrared pyroelectric detector For the close-range target system within 10 m, ultrasonic detector is selected for measurement. The threshold value (voltage) of the proximity of the intrusion target is set to 3.62V. When the output voltage of the infrared detector receiving circuit exceeds this value, the system enables ultrasonic ranging.
Since the measurement interval of 5 ~ 12 m is close to the upper limit of distance measurement of ultrasonic sensor, and it is also the area where the sensitivity of the change of output voltage amplitude of infrared pyroelectric detector gradually decreases, the method of segmental processing is adopted to solve the distance, as shown in equation (4) and Table 1. In MCU processing, the two sensors adopt the method of multiple continuous measurements to take the average value, and the 5 measurements are divided into 1 group, and the maximum and minimum values of each group of data are eliminated, and then the weighted mean is used to determine the final result of the measurement.
In order to better verify the effect of the system, this paper designs two sets of experiments, static target test and moving target test, respectively, to verify the operation of the intrusion ultrasonic sensor circuit. The moving target here means that a person passes through the detection range at a speed of 1 m/s. For both test experiment methods, the measured value can be compared with the set value to obtain the measurement error, as shown in equation (7) :
Where: ε, dmea and dset are respectively the error, measured value and actual set value. FIG. 12 and FIG. 13 respectively show two kinds of experimental results.
According to the test results of stationary target given in Figure 12, when the target distance is less than 0.3m, the measurement error exceeds 5%, which is caused by the measurement blind area of the ultrasonic sensor itself. When the target distance is 0.3 ~ 15 m, the error is generally less than 2%. When the target distance is more than 17 m, the error shows a relatively obvious increase trend, but the maximum is not more than 3.2%.
Figure 13 shows the test situation of a moving target. At this time, a person passes through the measurement range of the system at a speed of 1 m/s. The trend of the test curve at this time is similar to that of a stationary target, and the overall error is less than 4%. But the gross error increases obviously, and the overall precision index also decreases slightly.
When the MCU detects an intrusion event, the device can automatically configure the iot module to complete data transmission.
4 Conclusion
The system did not consider the influence of external environment such as temperature in the test process, all the test data were obtained in the indoor working environment, and the ultrasonic speed was 341 m/s, that is, the propagation speed at 20 ℃. The actual ultrasonic propagation speed is greatly affected by the ambient temperature. In order to improve the measurement accuracy, a temperature sensor can be added in the subsequent improved version and temperature compensation can be realized in the MCU program.
The mobile object monitoring device designed in this paper is composed of infrared detector, ultrasonic sensor, Internet of things module, etc., which can automatically detect and transmit information to the intrusion target (human or animal). The system works reliably, the information is transmitted in time, and the operation is simple and the applicability is strong.
References:
[1] Xu Manganese. Research and design of home security system based on cloud platform [D]. Jinan: Shandong University, 2018. (in Chinese)
[2] Xu Xuzhi. Development history analysis of China's security video surveillance system and 5G trend outlook [J]. Mechanical and Electrical Information, 2020 (3) : 97-98.
[3] Wang Yun, Zhang Xu. New intelligent fiber perimeter alarm system [J]. Optoelectronic Technology Application, 2018, 33 (2) : 13-19.
[4] Wenling. Application analysis of multi-sensor fusion technology in perimeter security [J]. China New Technology and New Products, 2017 (8) : 142-143.
[5] A low power self-diagnostic double threshold ultrasonic propagation time detection method [J]. Instrument Technology and Sensors, 2021 (3) : 82-92.
[6] Wang Xiaoli. Overview of mainstream technology and principle of intrusion detector [J]. Micromachines and Applications, 2014,33 (18) : 1-3.
[7] Yang Wei, Li Bo, Sun Qiao, et al. Research on Time difference method of distance measurement based on pyroelectric infrared sensing [J]. Sensors and Microsystems, 2013,32 (4) : 37-40.
[8] Liu Weibing, Xu Chunxiang. Smart meter real-time monitoring system based on Internet of Things
[J]. Instrument Technology and Sensors, 2017 (12) : 72-75.
[9] Gao Wei. Wind speed and direction measurement method based on ultrasonic sensor array and multiple signal classification algorithm [D]. Changchun: Jilin University, 2017. (in Chinese)