Design and application analysis of ultrasonic rangefinder based on single chip microcomputer
[ Abstract] This paper uses the relationship between distance and time in ultrasonic transmission, adopts AT89C51 single chip microcomputer for control and data processing, and designs an ultrasonic rangefinder which can accurately measure the distance between two points. The rangefinder is mainly composed of ultrasonic transmitter circuit, ultrasonic receiver circuit, single chip microcomputer control circuit, ambient temperature detection circuit and display circuit. Using the designed ultrasonic range finder, different distances are tested and the error is analyzed in detail.
[ key words] ultrasonic ranging temperature sensor with single chip microcomputer
With the development of society, people have higher and higher requirements for distance or length measurement. Ultrasonic ranging has been paid more and more attention because of its non-contact measurement and relatively high accuracy. The ultrasonic range finder designed in this paper can test different distances and make detailed error analysis.
I. Design principle
The ultrasonic rangefinder measures according to the characteristics of ultrasonic waves reflected from obstacles. The ultrasonic transmitter emits ultrasonic waves in a certain direction, and starts timing at the same time. The ultrasonic waves propagate in the air and return immediately when they encounter obstacles on the way. The ultrasonic receiver immediately stops timing when it receives reflected waves. By continuously detecting the echo reflected by obstacles after the generated wave is emitted, the time difference T between transmitting the ultrasonic wave and receiving the echo is measured, and then the distance L is calculated. The basic ranging formula is: L=(△t/2)*C
where l-the distance to be measured
t-the time interval between the transmitted wave and the reflected wave
c-the sound speed of the ultrasonic wave in the air. After the sound speed of 34m/s
is determined at room temperature, it can be obtained as long as the round-trip time of the ultrasonic wave is measured.
Second, the design goal of ultrasonic range finder
Measuring distance: within 5 meters; The distance between two points can be correctly displayed by LED; The error is less than 5%.
3. Data measurement and analysis
1. Data measurement and analysis
Due to the limitations of the actual measurement work, six distances (3cm, 5cm, 7cm, 8cm, 9cm and 1cm) less than one meter were finally selected for measurement, and each distance was continuously measured for seven times, and the measurement data (temperature: 29℃) was obtained, as shown in the table. As can be seen from the data in the table, the measured values are generally several centimeters larger than the actual values, but the accuracy of continuous measurement is still relatively high.
remove a maximum value and a minimum value from each group of measured data, and then find the average value to be used as the final measured data, and finally make a comparative analysis. It is also scientific and reasonable to process data in this way. From the data in the table, although the ultrasonic wave is compensated for temperature, its relative error is also relatively large in the measurement of relatively short distance. Especially for the distance measurement of 3cm and 5cm, the relative errors are 5% and 4.8% respectively. But from all the measurement results, the absolute error of this design is relatively small and stable. The blind area of this design is about 22.6cm, which basically meets the design requirements.
2. Error analysis
The ranging error mainly comes from the following aspects:
(1) There is a certain angle between the ultrasonic transmitting and receiving probe and the measured point, which directly affects the accurate value of the measuring distance; (2) The sound intensity of ultrasonic echo is directly related to the distance to be measured, so the actual measurement is not necessarily triggered by the zero-crossing of the first echo; (3) Due to the simple tools, the actual measurement distance also has errors. There are many factors that affect the measurement error, including on-site environmental interference, time base pulse frequency and so on.
IV. Application analysis
Measuring the ground distance in the atmosphere by ultrasonic wave is a technology that was formally applied only with the development of modern electronic technology. Because ultrasonic ranging is a non-contact detection technology, it is not affected by light and the color of the measured object, and it has certain adaptability in harsh environments (such as dust). Therefore, it is extremely widely used. For example, surveying and mapping topographic maps, building houses, bridges, roads, excavating mines, oil wells, etc., and measuring the ground distance by using ultrasonic waves are realized by using photoelectric technology. The advantages of ultrasonic rangefinder are that the instrument cost is lower than that of light wave rangefinder, which is labor-saving and convenient to operate.
Ultrasonic rangefinder is also applied in advanced robot technology. The ultrasonic source is installed on the robot, which continuously emits ultrasonic waves around and receives echoes reflected by obstacles at the same time to determine the robot's own position, and it is used as a sensor to control the robot's computer and so on. Because of its easy directional emission, good directivity and good intensity control, the application value of ultrasonic wave has been paid more and more attention.
in a word, from the above analysis, we can see that using ultrasonic ranging has many advantages in many aspects. Therefore, the research of this topic is of great practical and commercial value.
V. Conclusion
The measuring distance of this design meets the market requirements, and the blind area of measurement is also controlled within 23cm. According to the market demand, this design can also increase the transmission power and make the measurement distance farther. In the aspect of display, the program can also be modified appropriately, so that the LED displays the temperature value when the ultrasonic wave is emitted, and when the distance value is calculated after the ultrasonic echo is received, the LED automatically switches to display the distance value, so as to get a more intuitive understanding of the visual effect.
References:
[1] Sun Hanfang and Xu Aiqing: Principle and Application of MCS-51/96 Series Single Chip Microcomputer (Revised Edition) [M]. Beijing: Beijing University of Aeronautics and Astronautics Press .22.46-17
[2] Jin Zhuanzhi and Wang Mingshi: Modern Sensor Technology [M]. Electronic Industry Press Sun Hanfang and Xu Aiqing: Principle and Application of MCS-51/96 Series Single Chip Microcomputer (Revised Edition) [M]. Beijing: Beijing University of Aeronautics and Astronautics Press. 22.46-17
[4] Lu Jinzheng, Wang Jianqin, Yang Shaoguo, Zhao Ke, Zhao Taifei. Design of ultrasonic rangefinder [J]. Sensor technology. 22
For reference only.