Design of a high-precision ultrasonic ranging system

introduction

In engineering practice, ultrasonic waves are often used for distance measurement due to their strong directivity, slow energy consumption and long distance of propagation in the medium. It is mainly used in the development of reversing radar, range finder, level measuring instrument, mobile robot, building construction site and some industrial sites, such as: distance, liquid level, well depth, pipeline length, flow rate and other occasions. The use of ultrasonic detection is often relatively quick and convenient, and the calculation is simple and easy to achieve real-time control. It can also meet the industrial practical requirements in terms of measurement accuracy, so it has been widely used.

The basic principle of ultrasonic ranging

The ultrasonic generator sends out an ultrasonic signal at a certain moment. After encountering the measured object, it is reflected back and received by the ultrasonic receiver. As long as the time from the transmission of the ultrasonic signal to the reception of the echo signal is calculated, and the propagation speed in the medium is known, the distance from the measured object can be calculated:

d = s / 2 = (vt) / 2 (1)

Where d is the distance between the measured object and the rangefinder, s is the distance that the ultrasonic wave travels back and forth, v is the propagation speed of the ultrasonic wave in the medium, and t is the time it takes the ultrasonic wave to transmit to receive. In order to improve the accuracy, it is necessary to consider the relationship between the propagation speed of ultrasonic waves in the air at different temperatures with temperature:

v = 331.4 + 0.61T (2)

In the formula, T is the actual temperature (℃), and the unit of v is m / s.

The principle of piezoelectric ultrasonic sensor

At present, ultrasonic sensors can be roughly divided into two categories: one is ultrasonic waves generated by electrical means, and the other is ultrasonic waves generated by mechanical means. The electrical methods include piezoelectric type, magnetostrictive type and electric type, etc .; the mechanical methods include Galton whistle, liquid whistle and air flow whistle. The frequency, power and sound wave characteristics of the ultrasonic waves generated by them are different, so their uses are also different. In engineering, piezoelectric ultrasonic sensors are currently commonly used.

Piezoelectric ultrasonic sensors actually use the resonance of piezoelectric crystals to work. There are two piezoelectric wafers and a resonance plate inside the piezoelectric ultrasonic generator. When a pulse signal is applied to its two poles and its frequency is equal to the natural oscillation frequency of the piezoelectric wafer, the piezoelectric wafer will resonate and drive the resonance plate to vibrate, thus generating ultrasonic waves. Conversely, if no voltage is applied between the two electrodes, when the resonance plate receives ultrasonic waves, it will press the piezoelectric wafer to vibrate and convert the mechanical energy into electrical signals. This is the ultrasonic receiver.

Hardware circuit design of reflective ultrasonic rangefinder

The hardware circuit of this system is composed of the minimum system of the single chip microcomputer, the temperature compensation circuit, the ultrasonic transmitting circuit, the ultrasonic receiving circuit, and the display circuit, as shown in Figure 1.


The specific working process of the ultrasonic distance meter is as follows. After the reset signal is generated by the single chip microcomputer, a control signal is generated by the MC9S12DG128B to control the peripheral circuit to generate 40kHz ultrasonic waves. . At the same time, count the timer inside the MC9S12DG128B, measure the time it takes for the ultrasonic signal to be sent to receive, and amplify, filter, and shape the ultrasonic signal received through the ultrasonic transducer R, and use it as the received signal to start the input of the timer Capture function, complete the time operation of ultrasonic ranging. At the same time, the current ambient temperature is measured by the temperature sensor DS18B20, read into the microcontroller, and then processed by it, and the corresponding measured value and current temperature are displayed on the liquid crystal display.

Microcontroller MC9S12DG128B

MC9S12DG128B is a 16-bit microcontroller in the S12 controller launched by Freescale. It has high integration and rich on-chip resources. Interface modules include SPI, SCI, I2C, A / D, PWM, etc. It has strong functions in FLASH storage control and encryption.

MC9S12DG128B microcontroller adopts enhanced 16-bit S12 CPU, the on-chip bus clock frequency can be up to 25MHz; on-chip resources include 8kB RAM, 128kB FLASH, 2kB EEPROM, SCI, SPI and PWM serial interface module; PWM module can be set to 4-channel 8-bit or 2-channel 16-bit, the clock frequency can be selected in a wide range; it also provides two 8-channel 10-bit precision A / D converters, controller area network CAN and enhanced capture timer, and supports background debugging mode ( BDM).

Square Glass Panoramic Elevator

Glass Lift,Sight Seeing Elevator,Square Panoramic Elevator,Square Panoramic Elevator With Glass

XI'AN TYPICAL ELEVATOR CO., LTD , https://www.chinaxiantypical.com