Our Latest News

Development of ultrasonic distance measuring instrument for parking

This paper discusses the basic principle, measurement calculation method, and implementation scheme of the ultrasonic distance meter for parking successfully developed using microcontroller technology. The software calibration is used to improve the measurement accuracy and the reliability of the whole machine. The actual use shows that it greatly improves the safety

This image has an empty alt attribute; its file name is image-415.png

when parking.

I. Preface

With the continuous improvement of living standards, the consumer awareness of cars entering the family is increasing. The number of car ownership in Chinese cities is rapidly increasing. With it, traffic accidents are increasing day by day, especially in cities. The development of intelligent transportation system is an important development direction for transportation in the 21st century. Intelligent Transportation Systems (ITS) can improve transportation efficiency by fully utilizing the potential of existing infrastructure. The excellent effectiveness of ITS in ensuring traffic safety, relieving traffic congestion, and improving urban environment has received wide attention from governments at all levels. The Chinese government also attaches great importance to the research, development and application of ITS. This paper discusses the development of ultrasonic distance meter for parking with an eye on reversing protection, which can realize effective avoidance of obstacles and pedestrians that may cause harm to reversing when reversing. Effectively avoid the economic loss and personal safety problems caused by reversing. Foreign senior cars have been installed with similar systems when the car leaves the factory.

Second, the system composition and achieve indicators

The system consists of three major components, (1), two-way transceiver with the same air ultrasound probe, to achieve the rear of the car left and right after the obstacle detection. (2), the control circuit and ultrasonic transmitting and receiving circuit composed of microcontroller. (3), distance display circuit and sound and light alarm circuit.

The system achieves the following technical indicators; two-way ultrasonic positioning, digital display distance, voice prompts distance range, row of digital tube display distance range.

Specific indicators are: Ⅰ two-way ultrasonic positioning, each detection range angle 14o

Ⅱ three digital tube distance display

Ⅲ four-segment voice distance range prompts, red, green and blue digital tube distance display

Ⅳ Detection distance 0.25m-1.5m

Ⅴ Working temperature -20-60℃

Ⅵ measurement resolution of 1cm, the error is less than 0.5%.

The tester has high measurement accuracy and diversified prompting methods, which can meet the objective needs of different working environments.

Third, the hardware circuit composition and working principle

3.1 Control chip

Using AT89C2051 as the controller, it is used in small intelligent instruments with high cost performance. Instruction system and 8031 fully compatible, except for the absence of P0, P2 port, with 8031 all functional structure, with its composition of the measurement and control system has a simple circuit, high reliability, small size; control and transmitter-receiver circuit volume for, hardware composition block diagram as shown in Figure I.

Microcontroller P1.4, P1.5 port programmed as the output port, alternately output 40KHz square wave, the duration of 0.2ms, every 19.8ms or so and then send the next, that is, the repetition frequency of two-way ultrasound. The propagation speed of ultrasound in the air at room temperature is 340m/s, which determines the maximum detection distance of the instrument is. And the actual situation is that, because the instructions take time to run, and when one way to transmit the reception is complete, the program to send a display. Then when the repetition frequency is about 50Hz, the maximum detection distance is 1.5m. P1.4 and P1.5 port waveforms are shown in Figure 2. P1.6 and P1.7 are programmed as input ports, which receive two ultrasonic echoes accordingly.

P3.2-P3.5 are programmed as output ports. P3.2-P3.4 control the voice data segment of the ISD1110 voice chip, and P3.5 controls when to play the voice.

The display is dynamically scanned, using serial ports RXD and TXD to send display data serially, and P1.0-P1.3 to send display bits. Since P1.0 and P1.1 do not have internal pull-up resistors, the application should be connected to external pull-up 4.7K resistors respectively.

The circuit uses a dedicated MAX810 reset chip. The battery and generator are connected in parallel. The voltage drops to about 6V under severe operating conditions (such as during engine start). The MAX810 can solve this problem very well. Its function is to monitor the power supply voltage of the microcontroller; when the power supply voltage is lower than a set threshold, MAX810 reset and continue for 140ms when the power supply voltage returns to above the threshold. this can be a good solution to the interference caused by the unstable power supply voltage of the microcontroller.

3.2, ultrasonic transmitter-receiver circuit

The two transmitter-receiver circuits are identical in structure and work in turn. The two circuits are identical in structure. The principle is shown in Figure 3.

3.2.1, transmit circuit

Since the microcontroller P1 port can provide 20mA of fill current capability when used as an IO port, and the current absorption capability is small, so an external NPN tube is used to improve its output current capability. Ensure that the 40KHz pulse signal has a certain amount of power.

3.2.2. Receiving Circuit

The receiver circuit consists of preamplification, bandpass filtering amplification, echo shaping and binarization. The preamplifier achieves effective amplification of small signals and improves the input impedance of the entire amplifier circuit. This circuit is designed with two stages of second-order infinite gain feedback bandpass filter amplification, with a center frequency of 40KHz; the first stage of the increase for A1 = -120, the second stage of the gain A1 = -320, to ensure that the microvolts level of signal amplification to the volt level for shaping and binarization processing. Shaping, binarization circuit to complete the function is the first echo signal detection, into a single polarity signal; binarization that a bit of A/D, set the threshold level, the analog echo into a level signal input to P1.6.

3.3、Voice alarm circuit

Voice alarm as the output of the measuring instrument is a very intuitive and easy to understand form, human-machine interface friendly, taking into account that the driver in reverse generally has no time to estimate the instrument in the car, attention in the rear of the car, so the design uses the voice alarm. Voice technology products are currently on the market in many varieties, the circuit uses the ISD1110 voice chip from ISD, the chip uses a (DAST) direct analog storage technology, set a high degree. Record and playback time of 10 seconds, divided into 80 segments, microcomputer control can be flexibly combined to output the required voice signal. The application should be required to develop a system of homemade, using the parallel port of the PC, the voice recording into the chip, connected to the system. A total of 4 segments were recorded, namely; “1.5m zone”; “1m zone”; “0.5m zone”; “limit warning music alarm “. Based on the size of the measurement distance to play the corresponding phrase at regular intervals. If the measurement result is 0.8 meters, report “1 meter zone”. The control circuit interface is shown in Figure 4; A3, A4, A5 of ISD1110 selects the alarm phrase, PLAYE connects to P3.5, and the falling edge triggers the sound release.

3.4, display circuit

In addition to the sound alarm, the light alarm is another effective way to alarm. There are two forms of light alarm in the design. Three digital tubes display the current test distance (unit mm), over-range display “- – -“, reversing distance from the obstacle less than 25mm display “SOS” flashing, voice playback warning music. Rows of digital tubes have two red, two green, two blue, display the relative distance, when the measurement value is greater than 1 meter range, up to two green tube light; when the measurement value is greater than 0.5 meters, two green tube light, up to two yellow tube light; measurement value is greater than 0.3 meters, two green two yellow tube light, up to two red tube light. The row of digital tubes show the relative value of the test distance, the closer the distance, the more bits of digital tube light.

Electrical schematic diagram in Figure V, with RXD serial output display data, TXD output synchronization pulse, a piece of 164 will be converted from serial data to parallel data, with P1.0-P1.3 output as a bit control, take turns to light the digital tube and light-emitting tube row. As P1.0, P1.1 no pull-up resistor, in use as an IO port to connect a 4.7k pull-up resistor, in order to increase the driving capacity, the bit control to add a MC1413.

IV. Software design

The program consists of main program (Figure 6) and interrupt service program (Figure 7) and display subroutine (Figure 8). Use timer T0 timing 10ms, timing start at the same time to P1.4 to send 40KHz pulse, query P1.6 whether there is an echo, there is an echo from T0 timing time t and sound speed V can be obtained (m); if 10ms has arrived and no echo then T0 timing overflow interrupt, in the T0 interrupt service subroutine, write to the display cache display “— “, and set a flag bit, judge the flag bit to determine the exit of the service subroutine, and update the flag bit before returning. The function of the flag bit is to ensure that P1.4 and P1.6; P1.5 and P1.7 are sent and received in turn. The display is dynamically scanned, and the main program sends the display once for each completed way of sending and receiving, and each display starts the serial port four times and sets the corresponding display bit to low. At the same time, according to the measurement results to play the corresponding prompt phrase.

V. Anti-interference measures

The car in the work due to high-voltage electrical fire, there is a strong external electromagnetic radiation, electromagnetic environment is harsh. Therefore, in the hardware and software side on the anti-interference issues have been considered.

Hardware ultrasound reception in the pre-stage is a small signal, the sensor connection using a good quality single-core shielded wire to ensure reliable transmission of small signals, the signal amplification stage using two levels of bandpass filtering, filtering out high-frequency and low-frequency interference. The power supply of the digital part and the analog part are supplied separately. The controller box is shielded from external electromagnetic fields with a metal case. The software uses the coarse and large value rejection method, and each measurement result is grouped into three times, and the coarse and large values are first rejected and then averaged to produce the measurement results for display. The use of three times averaging is to take into account the real-time measurement. Because the reversing process is not very concerned about the exact distance from the obstacle; rather, there is no obstacle and how far from the rear of the car. These measures have proved to be effective in practice.

VI. Conclusion

This instrument has been installed and used to achieve the intended goal. In the process of reversing, the automatic detection of obstacles within 1.5 meters from the left rear and right rear of the car and pedestrians who suddenly break into the danger area is realized, and the driver is warned and prompted to take measures. For new drivers its role is more obvious, in the process of reversing to achieve a clear mind, greatly improving the safety of reversing.

    GET A FREE QUOTE

    FPGA IC & FULL BOM LIST

    We'd love to

    hear from you

    Highlight multiple sections with this eye-catching call to action style.

      Contact Us

      Exhibition Bay South Squre, Fuhai Bao’an Shenzhen China

      • Sales@ebics.com
      • +86.755.27389663