Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - ultrasonic ranging
ultrasonic ranging
Ultrasonic wireless distance measurement system for automobile reversing and collision avoidance

Research on ultrasonic ranging system

Abstract: This paper designs an ultrasonic ranging system for automobiles. The system includes a lower computer system and an upper computer system. The lower computer system is mainly composed of ultrasonic transmitting circuit, receiving circuit, wireless communication module and microcomputer. The data of the lower computer system is transmitted to the upper computer system by wireless. The design principle of ultrasonic ranging circuit is analyzed. The design method of data transmission is also introduced. The system has the characteristics of convenient measurement, fast response and stability.

Keywords: wireless communication; Microcomputer; Ultrasonic wave; Distance measurement; temperature compensation

Abstract: This paper introduces an ultrasonic wireless ranging system for automobile reversing collision avoidance. The system consists of a lower computer and an upper computer. The lower computer is mainly composed of ultrasonic transmitting circuit, ultrasonic receiving circuit, wireless transceiver module and single chip microcomputer. The upper computer consists of single chip microcomputer, wireless transceiver module and display circuit. The lower computer and the upper computer transmit information through the wireless transceiver module. This paper analyzes the design method of ultrasonic ranging circuit, and expounds the design idea of using wireless communication technology to realize data remote transmission. The system is convenient, flexible and stable in measuring distance.

Keywords: wireless communication; Single chip microcomputer; Ultrasonic wave; Distance measurement; temperature compensation

1. Introduction

With the development of economy, people's living standards are getting higher and higher. Nowadays, for many people, it is no longer an extravagant hope for cars to enter the home, but the next thing is how to ensure the safety of cars in use, especially how to prevent cars from colliding with other objects. According to preliminary investigation and statistics, l5% of automobile accidents are caused by poor "rear view" when reversing. Therefore, it is very important to enhance the rear-view ability of the car to improve driving safety and reduce the driver's labor intensity and psychological pressure. If the vehicle can detect the distance from the surrounding obstacles in time and give early warning information so that the driver can take action as soon as possible, the collision accident can be avoided.

With the development of science and technology, ultrasonic non-contact measurement has been widely used. Ultrasonic wave is produced by mechanical vibration, which can propagate at different speeds in different media. It has the advantages of good directivity, concentrated energy, small attenuation during transmission, strong reflection ability and certain adaptability in harsh working environment. Therefore, it can be used in liquid level measurement, vehicle automatic navigation [2] and other fields. This paper introduces an ultrasonic anti-collision early warning system for automobile reversing based on wireless data transmission.

2. The principle of ultrasonic ranging

When the emitted ultrasonic wave encounters an obstacle, it will be reflected back, and the reflected wave can be received by the receiver, so as long as the time interval Δ t between the emission point and the ultrasonic reflection is measured, the distance from the emission point to the obstacle can be calculated according to the formula (1).

s = cδt/2( 1)

Where: s is the distance between the ultrasonic emission place and the obstacle.

C—— the propagation speed of ultrasonic wave in medium.

As ultrasonic wave is a kind of sound wave, its sound velocity C is affected by the ambient temperature, and the relationship is shown in Formula (2). Therefore, when ultrasonic ranging is used, the value of sound velocity in formula (1) should be corrected by temperature compensation method.

C=33 1.4+ 0.6 1×T (2)

Where: t-ambient temperature

3. Hardware circuit design

As shown in figure 1, the hardware circuit is mainly composed of single chip microcomputer, ultrasonic sensor, temperature measuring circuit and wireless transceiver module.

The system adopts AT89S5 1 of ATMEL company as the core control chip, which is compatible with the instructions and pins of MCS-5 1 [1], and has the ISP online programming function, which is convenient for system design and debugging.

Ultrasonic sensor is an important component in ultrasonic ranging circuit, and its performance directly affects the accuracy and reliability of ranging. There are usually two kinds of ultrasonic sensors: one is a split ultrasonic sensor whose transmitting circuit and receiving circuit are independent of each other. This kind of sensor has a large effective ranging range, but it does not have dustproof and waterproof performance. The other is an ultrasonic sensor with integrated transceiver, which has both transmitting and receiving functions. This kind of ultrasonic ranging has a small effective range, but it has good dustproof and waterproof performance. The system adopts split ultrasonic sensor.

Considering the directivity of ultrasonic waves, this system installs an ultrasonic transmitter on the left and right sides of the rear of the car respectively.

The sensor can accurately measure steam by properly adjusting the installation position.

Obstacles in the back of the car.

As shown in figure 1, pins P 1. 1 and P 1.2 of the lower computer are used to control two ultrasonic waves, INT0 and INT 1 are used to detect two ultrasonic signals, and P 1.3 is used to detect the temperature. Serial ports RXD and TXD are connected to the input and output terminals of wireless transceiver module a, respectively. Similarly, the serial ports RXD and TXD of the upper computer are respectively connected to the input and output terminals of the wireless transceiver module B. When receiving the measurement data sent by the lower computer, the lower computer processes it, then displays the measurement results, and sends out an alarm signal when the distance between the vehicle and the obstacle exceeds the safety warning line.

In actual installation, the lower computer part of the system is installed in the rear of the car, and the upper computer part is installed in the cab.

3. 1 Ultrasonic transmitting circuit

The ultrasonic transmitting circuit consists of an ultrasonic transducer (or ultrasonic vibrator) and an ultrasonic generator. The circuit is shown in Figure 2. The ultrasonic transducer in the system is CSB40T, which converts the electrical signal provided by the ultrasonic generator into mechanical vibration and emits it. 40KHz ultrasonic signal is generated by the oscillation of NE555 time base circuit, and the oscillation frequency is f ≈1.44/((R22+2× R23 )× C21). The signal frequency is adjusted by R23 to make it consistent with the natural frequency of the sensor of 40KHz. When working, the lower computer sends a control signal to the ultrasonic generator circuit through the P 1. 1 port, and the ultrasonic generator circuit generates a modulation pulse of 40KHz, which is converted into an ultrasonic signal by the transducer and transmitted to the front space.

3.2 Ultrasonic receiving circuit

The ultrasonic receiving circuit adopts integrated circuit CX20 106A. CX20 106A is an infrared remote control signal receiving integrated circuit produced by Sony Corporation of Japan, which consists of preamplifier, automatic bias control, amplitude amplifier, peak detection and shaping circuit. The infrared emission frequency of the integrated circuit is 38KHZ, and the natural frequency of the ultrasonic transducer is 40KHz. If the peripheral circuit parameters of CX20 106A are properly designed, it can be used for receiving and amplifying ultrasonic waves. As shown in Figure 3, pin 1 is the signal input end of CX20 106A, pin 2 is the RC network connection end of CX20 106A, and pin 3 is.

Pin 4 is the grounding terminal of CX20 106A, pin 5 is the central setting terminal of CX20 106A bandpass filter, pin 6 is the connection terminal of CX20 106A integral capacitor, pin 7 is the signal output terminal of CX20 106A, and pin 8 is CX20/KLOC-0.

In operation, the transducer CSB40T converts the received weak acoustic vibration signal into an electrical signal and sends it to the input end of CX20 106A 1. When CX20 106A receives the signal, pin 7 will output a low level, which can be used as the interrupt signal source of the lower computer. When the lower computer receives the interrupt signal, it means that the reflected ultrasonic wave is detected. The lower computer enters the interrupt state, starts the distance calculation, and sends the calculation result to the upper computer.

3.3 Temperature detection circuit

The temperature detection circuit adopts 1 line bus device DS 18B20 digital temperature sensor of DALLS company. The circuit connection is very simple, but the timing must be strictly synchronized with the single chip microcomputer. The conversion accuracy of DS 18B20 is 9, 10,1and 12 bits. Without programming, the default precision is 12 bits, and the measurement precision is generally 0.5℃. After software processing, it can reach 0. 1℃. The temperature output is provided in the form of binary number with 16 bit sign extension, with the low-order priority expressed in the form of 0.0625℃/ LSB, and the high-order five bits are extended sign bits. The conversion period is related to the setting of conversion accuracy. When the accuracy is 9 bits, the maximum conversion time is 93.75ms;; When the accuracy is 12 bits, the maximum conversion time is 750 ms This system adopts the default precision of 12 bits. For the usage of DS 18B20, please refer to related books.

3.4 Data Wireless Transceiver Module

In order to avoid laying cables in the car, the upper computer and lower computer of the system adopt wireless communication.

The wireless communication module adopts PTR2000, which is a wireless communication module working in the international general data transmission frequency band of 433MHz. The highest transmission rate can reach 20Kbit/s, and the power consumption is low, only 8μA in standby state, which can be directly connected with the serial port of single chip microcomputer. The pin definition of PTR2000 is as follows: TXE is the sending control terminal; PWR is the energy-saving control terminal; DI is the data input end; DO is the data output end; CS is a channel selection terminal.

When the hardware is connected, TXE, PWR and CS are controlled by three general I/O ports of single chip microcomputer, and the serial port of single chip microcomputer is connected with DI and DO. When TXE is 1, it is in the transmitting state, and when TXE is 0, it is in the receiving state. The state transition takes 5 milliseconds. When PWR is 0, it is in power-saving standby state, and the module cannot receive or send at this time.

Wireless communication has the advantages of no wiring, convenient installation and strong flexibility. However, data will inevitably produce error code in the transmission process, and the probability of error code is much higher than that of wired network. The occurrence of error code is related to many factors and there is great uncertainty. Therefore, the error control mechanism must be adopted, and the system adopts stop-and-wait protocol to realize error control. In addition, the checking mechanism is used to determine when retransmission is needed. CRC has strong error detection ability, which can detect not only discrete transmission errors, but also burst transmission errors. Considering the overhead of hardware and transmission, CRC 16 check code is adopted.

PTR2000 is very sensitive, and random data will be generated without carrier at the receiving end, so it is necessary to formulate a transmission protocol, the format of which is shown in table 1. In the communication protocol, two or more fixed leading characters must be added as synchronization signals before the valid data, so that the receiver can distinguish the beginning of the valid data.

The leading characters are 0xAA, 0xAA, 0xFF and 0x00***4 bytes, in which the first two bytes are synchronization signals and the last two bytes are frame start marks. As long as the receiver can receive 0xAA, 0xAA, 0xFF and 0x00, it can be considered that a new frame has started. Frame types are divided into data frames, ordered data frames, control command frames, confirmation frames and other frame types. The frame number is optional and related to the frame type. It is only valid when the frame type is ordered data frame. The check code is 2 bytes of CRC 16. End of frame flag: 0x00.

4. Software design

4. 1 lower computer programming

The lower computer program mainly consists of data communication program, distance calculation program and temperature compensation program.

The flow chart of the distance calculation program is shown in Figure 4.

There are usually two methods for temperature compensation: one method is to calculate the current sound velocity c according to the formula C=33 1.4+ 0.6 1×T each time to compensate the temperature. Its characteristic is to get the accurate speed of sound according to the temperature at that time, so the calculated distance value is more accurate, but the program involves floating-point operation and is realized by microprocessor system, which is difficult. Another method is to list the corresponding relationship between temperature and sound speed as a two-dimensional table of temperature and sound speed and solidify it into the system. In temperature compensation, according to the temperature-sound velocity table, the sound velocity value corresponding to the temperature closest to the current temperature is found, and this sound velocity value is taken as the current sound velocity. Its characteristic is to avoid complex floating-point operation and the extraction operation of each byte after floating-point operation, which not only ensures a certain precision requirement, but also avoids floating-point operation. Therefore, this system adopts the second method for temperature compensation. The program flow chart is abbreviated.

4.2 Host Program Design

When the upper computer communicates with the lower computer, the upper computer sends a start measurement command to the lower computer according to the communication protocol format. After receiving the command, the lower computer began to measure the distance between the car and the obstacle, and then sent the measurement results to the upper computer. The upper computer first judges the leading character to determine whether it is valid data. If it is valid data, unpack and perform the corresponding operation. Otherwise, the data packet is discarded, and the upper computer continues to send commands and receive data in the same way until the correct data is received. The program flow chart is shown in Figure 5.

5 concluding remarks

Through the reasonable design of the hardware circuit and software of the system, the system can work normally between-20℃ and 50℃, and the three-digit digital tube displays the distance in centimeters, which can accurately judge the objects within the range of 1.5 meters from the car and give an alarm in time, thus improving the safety of car reversing. The innovation of this paper is that the automobile anti-collision system adopts the data wireless communication strategy, which reduces the wiring in the car.

References:

[1]MCS-5 1 series single chip microcomputer application system design, He Limin, Beihang Press, 1990.

Development of high-precision ultrasonic rangefinder, Zhao Ke, Xiang Ying, etc. , Sensor Technology, No.2, 2003.

[3] Application of wireless communication in embedded system, Cao Lingzhi, Shi Jun, etc. , Microcomputer Information,No. 1 1 in 2005.

About the author:

Cao Lingzhi, female, born in 1965, master, associate professor, mainly engaged in remote measurement and control technology research.

Contact: School of Electrical and Information Engineering, Zhengzhou Institute of Light Industry, office zip code 450002.

E-mail :caolingzhi@zzuli.edu.cn

Ren Yaping, female, born in 1973, is a master student, mainly engaged in computer technology research.