Development of a new high precision integrated reflection ultrasonic sensor ranging system
Based on single chip microcomputer, infrared remote control receiver and analog electronic switch, the distance measurement circuit of integrated reflective ultrasonic sensor is designed, the hardware and software design of the sensing system is completed, and the theoretical and experimental research is carried out in detail. The experimental results show that the proposed design method has the advantages of simple structure, high precision, good repeatability, high reliability and low cost, and has universal application significance and wide application value. This method has been applied well in obstacle avoidance of mobile robot.
0 Introduction
Ultrasonic sensor is one of the commonly used sensors for ranging, and has the following advantages:
(1) The propagation speed of ultrasonic wave is only one millionth of that of light wave, so it can directly measure a relatively close distance, and the longitudinal resolution is high;
(2) Ultrasonic is not sensitive to color and illuminance, and is suitable for identifying transparent, translucent and diffuse objects (such as glass, polished body, etc.);
(3) Ultrasonic is insensitive to external light and electromagnetic field, and can be used in dark, dust, strong electromagnetic interference and other harsh environments;
(4) Ultrasonic sensors have simple structure, small size, low cost, simple and reliable information processing, and are easy to miniaturize and integrate.
The integrated reflection ultrasonic sensor adopts a single ultrasonic probe, and uses pulse impulse to drive the transducer to emit ultra-sound wave. When the emission stops, the energy exchanger turns into a receiver to receive the reflected sound wave. Because of the single probe operation, it is easier to realize the miniaturization and integration of the measurement and control system. And the integrated reflection type ultrasonic sensor receives and sends the same body, so there is no measurement error caused by double probe spacing. In the existing literature [1-4], pulse impulse transformers are used to drive the integrated ultrasonic sensor, which not only plays the role of boosting voltage, but also plays the role of separating the input and output of the sensor. In this paper, a novel integrated ultrasonic wave sensor ranging circuit based on MCU + infrared remote receiver CX20106 + analog electronic switch CD4066 is designed. The circuit structure is simple, stable and reliable, and the measurement accuracy is high, which has been well applied in the obstacle avoidance of mobile robots.
1 Ultrasonic sensor ranging principle
The most common ranging method for ultrasonic sensors is echo detection. The basic principle is to use the controller to emit a certain frequency of ultrasonic waves through the transmitting probe, receive the probe to wait for the ultrasonic waves reflected back by the obstacle, just calculate the time from the transmitting signal to the receiving signal, you can calculate the distance of the obstacle L.
Where: c is the sound speed; t is the time interval between transmission and reception.
2 Integrated reflection ultrasonic sensor measurement and control system design
2.1 Probe system error correction
Because the piezoelectric material is fragile, and because of the requirements of absolute edge, sealing, impedance matching, etc., the ultrasonic transducer is often packaged in the probe housing, so that the piezoelectric material has a certain distance from the probe surface, which will bring measurement errors in the measurement process. The surface of the ultrasonic probe has a protective net, so the distance cannot be measured directly.
This leads to:
After many measurements, the average value of sensor L0 is 7 mm.
2. Overall design of sensing circuit of ultrasonic sensor
The sensing circuit of the integrated reflective ultrasonic sensor is shown in Figure 1. The microcontroller controls the ultrasonic sensor emission through 74HC04, and CX20106 and peripheral devices compose the echo detection and processing circuit. Since the transmitting circuit and the receiving circuit of the integrated reflective ultrasonic sensor use the same sensor pin input and output, if the input and output are not separated, the receiving circuit will act when transmitting, and the receiving circuit will be affected by the transmitting circuit when receiving, so the transmitting circuit must be separated from the receiving circuit, and the pin will be reused when output and input. Therefore, the transmitting circuit must be separated from the receiving circuit, and the pins are multiplexed at the time of output and input. The transmitting and receiving isolation is realized by using CMOS dual-mode analog switch CD4066BE.
Figure 1. Schematic diagram of sensing circuit of integrated reflective ultrasonic sensor
2.3 Design of transmitting and receiving isolation circuit
CD4066[5] internal structure diagram is shown in Figure 2, each package has 4 independent analog switches, each switch has input, output and control three ends. When the control end increases the power level, the switch is switched on; Switch off when the control terminal is low power. When the analog switch is on, when the power supply voltage is 5V, the on-resistance is less than 80Ω. When the analog switch is cut off, it presents a high impedance. The upper frequency of the analog signal that can be transmitted by the analog switch is 40MHz. The four switches control CONA, CONB, CONC, and COND respectively as the control ends of switches SWA, SWD, SWB, and SWC (as shown in Figure 1), which are controlled by P1.2-P1.5 of the single chip machine. Switch SWA and SWB control ultrasonic emission,74HC04 output is connected to CD4066 1, 4 end, CD4066 2, 3 end is connected to the ultrasonic sensor, by the MCU P1.2, P1.4 control switch on and off. The switch SWC and SWD control the ultrasonic reception, the two pins of the ultrasonic sensor are connected to the first pin and ground of CX20106 respectively through the switch, and the P1.3 and P1.5 pins of the MCU control the opening and closing of SWC and SWD.
Figure D Internal structure of 66
2.4 Design of transmitting circuit
When the external signal frequency is equal to the natural vibration frequency of the two piezoelectric wafers, resonance will occur [6]. The center frequency of the ultrasonic sensor used is 40 kHz. Therefore, in the transmitting circuit, through the software programming formula, the I/O port P1.1 is set high and low to produce 40 kHz pulse impulse signal, which is sent to the transmitting circuit. Since P1 port of AT89S51 single chip microcomputer can provide 20 mA current filling capacity when used as I /O port, but the current absorption capacity is small, 74HC04 is used to improve its output current capacity to ensure that the 40 kHz pulse signal has a certain power. The schematic diagram of ultrasonic transmitting module is shown in Figure 1.
P1.1 port generates a modulated pulse wave with a period of 25μs. After passing 74HC04, the transmitting power of the ultrasonic sensor can be increased by inputting the same frequency pulse at both ends of the transmitting probe of the ultrasonic sensor. The probe transmits several pulse waves, then stops transmitting, and receives the probe waiting for the reflected signal. The timer T1 not only controls the interval time between launching, but also calculates the time from transmitting to receiving signal through T1, so as to calculate the distance of obstacles. Since the 16-bit timer can be fixed at a maximum of 65 536 μs when using a 12 MHz crystal oscillator, the launch interval time can be increased by using software to control the number of T1 counts. The transmitting interval must be greater than the time between transmitting and receiving echoes. The longer the launch interval, the more reliable the detection (the longer the time, the more the acoustic wave attenuation, the less the multiple reflected signals), but if it is used for robot obstacle avoidance, the slower the robot responds to obstacles and the worse the real-time performance. The transmission waveform collected by the oscilloscope is shown in Figure 3, and 4 pulses are emitted each time. Experiments have shown that the sensor can be made to work by sending only 2 pulses at a time. If the number of transmitted pulses is too large, the transmitted energy increases, the attenuation speed of the ultrasonic wave is slow, and the return signal of multiple refractions may cause the receiving probe to trigger incorrectly. Moreover, the larger the number of pulses, the larger the measurement blind area. Therefore, in the experiment, we choose to use a transmitting pulse.
FIG. 3 Ultrasonic sensor sends pulse and residual vibration signal
A single-chip microcomputer timer is used as the distance measurement counter, and the ultrasonic wave speed is set to 34m/s. According to formula (1), if the timing time is 65536μs, the measured distance is L = 344 ×(01065536/2) = 111272192 m. Of course, the experiment shows that the measurement circuit used, because the transmission power is weak, the farthest measuring distance is about 5m, if you need to measure more distance, the modulation wave output by the single chip microcomputer can drive the ultrasonic probe after boosting the pulse transformer. Because the developed mobile robot is mainly used indoors, the speed is slow, and the detection of obstacles is more than enough at about 5 m, so the modulation wave of the microcontroller port is directly added to the ultrasonic sensor.
2. 5 Ultrasonic receiving circuit design
The ultrasonic receiving and processing circuit adopts the integrated circuit CX20106. CX20106[7] is an application-specific integrated circuit for infrared reception. Here, CX20106 is used as the amplifier and detection installation of the received signal of the ultrasonic sensor, and good results are also achieved. The CX20106 is an 8-pin single-in-line plastic package with pre-amplification, clipping amplification, automatic bias, passband filtering, peak detection, integral comparison and Schmidt shaping output circuits. The CX20106 has a total amplification increase of about 80dB to ensure that its 7-pin output control pulse train signal amplitude is in the range of 315 ~ 5V.
3 Determination of the blind area of the integrated reflective ultrasonic sensor
There are blind areas in integrated reflective ultrasonic sensors, mainly caused by two factors:
(1) Integrated ultrasonic sensor detection requires the controller to control the transmission and reception through the switching circuit, so the switching time interval (CD4066 off the transmission and open the reception time) will form a blind area.
(2) The experiment found that there was residual vibration in the piezoelectric ceramic of the sensor after the transmitting signal (as shown in Figure 3). If the receiving circuit was opened immediately, the residual vibration signal would cause misjudgment. As shown in Figure 4, if the MCU was switched on immediately after the transmitting pulse ended, it would receive a false trigger signal. Therefore, there is also the problem of blind spots, which is the main factor causing blind spots. The strength of the residual vibration is related to the strength of the sensor and the transmitted signal. It can be seen from the oscilloscope that the residual vibration of the selected sensor disappears after about 700μs, so the minimum distance of the blind zone is L = 344 ×(01000 7/2) = 0112 m. In actual use, the blind area should be set larger to improve the reliability of measurement.
4. Multiple reflection problems of the sensor
When the surrounding obstacles are more messy, the ultrasonic wave has multiple reflections. In the experiment, the sensor is pointed at a corner of the laboratory filled with tables, chairs and instruments, and the multiple reflected signals collected by the oscilloscope are shown in Figure 5. After comparing FIG. 4 and FIG. 5, it can be found that when the surrounding environment is very messy, the ultrasonic wave will cause the receiving system to act constantly after multiple refractions. At this time, the impact on a single distance is not large, only need to increase the blind time, after the blind time to sense the first pulse falling edge (the first falling edge is the reflection signal of the nearest object to the sensor) to close the MCU break. However, for continuous ranging, a certain time interval must be maintained between the two ranging, and the next ranging must be started after the basic attenuation of the ultrasonic wave emitted before it disappears.
Figure 5 A variety of reflected signals
The use of CD4066 as the output to input isolation device avoids the trouble of using the pulse transformer, but the experiment finds that the analog switch action in CD4066 will cause the wrong trigger of the receiving circuit. As shown in Figure 6, when the receiving switch SWC and SWD are closed, a voltage will be generated on the signal line within a short period of time, causing CX20106 to trigger incorrectly. Therefore, if SWC and SWD are turned on when transmitting, and SWC and SWD are turned off when receiving, a false trigger signal will be generated. The method of increasing the width of the blind area can be used to avoid the false triggering caused by the closing of the CD4066 analog electronic switch, but the blind area distance is too large, which affects the close detection of the ultrasonic sensor.
Figure 7 shows the schematic diagram of the circuit
6 System software design
The display circuit of the nixie tube is shown in Figure 7. T1 is used to control the transmitting time interval and count the distance of the integrated reflective ultrasonic sensor. The program can use the software flag bit to control the number of T1 counts to increase the launch interval time.
The program defines the nixie segment code query unit and global variables as follows:
unsigned char code disp code [ 10 ] = {0 x18, 0 x7b, 0 x2c, 0x29 , 0x4 b, 0x89 ,0 x88, 0 x3b, 0x08 , 0 x09 }; / / Digital tube characters (0-9)
sbit mA = P1^1; Transmitting port
sbitMB = P1^2; CD4066 Switches SWA control
sbitMC = P1^3; SWD control
sbitMD = P1^4; SWB control
sbitM E = P1^5; SWC control
sbit QA = P2 ^4; Thousand-digit display digital tube position code control
sbit QB = P2^5; Hundred-digit display digital tube position code control
sbit QC = P2^6; Ten digit display digital tube position code control
sb itQD = P2 ^7; Single digit display digital tube position code control
unsigned int dist; / / Distance data
unsigned char aa; / / Data for display
unsigned char res; / / Remainder after distance calculation
The primary test of each register in the main program is as follows: the blind area is set to 700 μs; TMOD = 0x11; IE = 0x8e; IT0 = 1; EX1 = 0; TH1 = 0x00; TL1 =0x00; mA = 0; MB = 0; // On/off for launch; MC = 1; // The switch for receiving is always open; MD = 0; // The transmitter switch is off; ME = 1; // The switch for receiving is always open; QA = 1; QB = 1; QC = 1; QD = 1; TR1 is equal to 1.
7 Detection range and accuracy measurement
Due to the on-resistance of CD4066, the transmitting power of the sensor is reduced, so the detection distance will be slightly affected. In an open area, a 3cm×3cm square plastic plate is moved within the ultrasonic reachable range, and the ultrasonic sensor can stably detect the obstacle at a maximum distance of 5m, and the Angle of the left and right sides of the measurement range is about 60°, then the ultrasonic sensor diffusion Angle is about 60°, and the cone-like sonic field with a spatial shape of 60° is obtained.
Significantly improve the power supply efficiency. If the clamp meter transformer is used, it can be connected in the case of live, which is suitable for temporary capacity verification of various power systems. Minimize unnecessary power outages. To provide reliable scientific means for power management. So the technology is promising.
References:
[1] Tang Lei, Chen Weirong. Discussion on design of transformer remote video monitoring system. Electrical Automatization, 2002 (5) : 34-36.
[2] Liang Ming, Bi Yaxiong, Gu Hongjin, et al. A novel electric power identification and energy management system. Chinese Journal of Electrotechnical Engineering, 2004 (5) : 58-61.
[3] Zhou P. Online monitoring of power grid leakage current. Instrument Technology and Sensor, 2004 (4) : 49-50; 54.
[4] Duan Qian, Li Weijia. Application of USSD in industrial monitoring system communication engineering. Application of Electronic Technology, 2004, 30 (12) : 57-60.
[5] Sun Jianshe. Pulse electric meter data transmission instrument. Chinese Journal of Sensor Technology, 2005, 18 (3) : 646-649.
[6] Li Fuying, Zang Jinkui, Ji Kun. Photoelectric high and low voltage power meter based on DSP. Automation of Electric Power Systems, 2002, 26 (2) : 75-77.
[7] Sun Jianshe, Shi Lei, Chen Luhua. Precision voltage-current amplitude converter based on integrated operational amplifier. Transformers, 2004, 41 (12) : 23-25. (in Chinese)
[8] Zhu Dinghua. Microcomputer principle, assembly and interface technology. Beijing: Tsinghua University Press,2005.
[9] Hong Fan. A verifiable dynamic secret sharing scheme. Computer Engineering and Applications,2004, 40 (9) : 40-41; 114.
[10] Qu, Liu Wenyan, Deng Xinzhong. Interference and its formation mechanism in test system. Application of Electronic Technology, 2002 (10) : 44-46.