Design of Ultrasonic Reversing Radar System Based on 51 Single Chip Microcomputer

Publisher:快乐奇迹Latest update time:2011-10-06 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction

Ultrasonic waves are mechanical vibrations in elastic media. They are often used to measure distances due to their strong directivity, slow energy consumption, and long propagation distance. The reversing radar system designed in this paper uses the above characteristics of ultrasonic waves to detect the reversing distance in real time and with high precision. At the same time, this system has low cost, simple design, good precision and stability, and is expected to be widely used, thereby reducing the occurrence of traffic accidents.

1 Principle of Ultrasonic Distance Measurement

The principle of ultrasonic ranging is to use the time it takes for ultrasonic waves to propagate from emission to reception to calculate the propagation distance. The reversing radar system in this article adopts the method of reflecting and receiving echoes. Let l be the measured distance, t be the round-trip time difference, and the propagation speed of ultrasonic waves be c, then t=2l/c, and the transmission rate of sound waves in the air is . Where T is the ambient temperature; cO is the speed at absolute temperature, which is a constant. It can be deduced from the above two formulas that the distance measured by ultrasonic waves is related to time and ambient temperature. In this system, the timer in AT89S52 is used to measure the ultrasonic propagation time, and DSl8820 is used to measure the ambient temperature, thereby improving the ranging accuracy.

2 Hardware Design

2.1 Overall design of system hardware

As shown in Figure 1, the hardware of this system consists of AT89S52 controller, ultrasonic transmitting circuit, receiving circuit, temperature measurement circuit, sound alarm circuit and LCD display circuit. When the car is moving, the LCD displays the ambient temperature. When reversing, the transmitting and receiving circuits work, and the distance is also displayed on the LCD after AT89S52 data processing. If the distance is less than the set distance, the alarm circuit will sound to remind the driver to pay attention to the distance between cars. AT89S52 is the main control chip, which supports online program download and is convenient for debugging. It has 8kB Flash, 32 I/O ports, three 16-bit timers/counters, eight interrupt sources, full-duplex UART serial port and watchdog timer, etc. It is rich in resources and meets both the design requirements of this system and the needs of future expansion.


2.2 Ultrasonic transmitting circuit

The ultrasonic transmitter consists of two parts: ultrasonic generation circuit and ultrasonic emission control circuit. The ultrasonic probe is CSB40T. Ultrasonic waves can be generated by software generation method and hardware method. This system uses software to generate 40kHz ultrasonic signals, which are output to CSB40T after being amplified twice and reversely driven by 74HC04, as shown in Figure 2.


74HC04 is a high-speed CMOS six-phase inverter with symmetrical transmission delay and conversion time, and its power consumption is much reduced compared to LSTTL logic IC. For HC type, its operating voltage is 2~6V, it has high noise immunity and is compatible with direct input LSTTL logic signals and CMOS logic inputs.

2.3 Ultrasonic receiving circuit

As ultrasonic waves propagate in the air, their energy decreases as the transmission distance increases. The echo signal reflected from a distant obstacle is generally weak. Therefore, when designing an ultrasonic receiving circuit, a larger amplification factor is required. In order to reduce the impact of environmental noise on the echo signal, a circuit with better filtering characteristics should also be considered to make the echo easy to detect. The ultrasonic receiving circuit uses the integrated circuit CX20106A, which can be used to complete signal amplification, limiting, bandpass filtering, peak detection and waveform shaping, as shown in Figure 3.



The preamplifier has an automatic gain control function, which can ensure that when the ultrasonic sensor receives a weak voltage from a distant reflected signal, the amplifier has a higher gain, and the amplifier will not be overloaded when the input signal is strong at a close distance; the center frequency of the bandpass filter can be adjusted by the external resistor at pin 5 of the chip, and no external inductor is required, which can avoid the interference of the external magnetic field on the circuit and has high reliability. The CX20106A has high sensitivity and anti-interference ability in receiving ultrasonic waves, which can meet the requirements of the receiving circuit. At the same time, the use of integrated circuits can also reduce mutual interference between circuits and reduce electrical noise. When a 40kHz signal is received, a short low level will appear at pin 7 of the chip, and connecting to the microcontroller can cause the microcontroller to interrupt.

2.4 Temperature measurement circuit

Since the propagation velocity v of ultrasound is affected by temperature, humidity, pressure, etc., among which the influence of temperature is particularly serious, in situations where high measurement accuracy is required, the propagation velocity of ultrasound should be corrected through temperature compensation to reduce the error.

This system uses DALLAS's DS18820 digital temperature sensor for temperature measurement. The temperature value it measures is directly represented by a 9-bit binary number. These values ​​are directly input into the CPU through the DS18820 data bus, without A/D conversion, and the read and write instructions and temperature conversion instructions are all transmitted to the DS18820 through the data bus, without external power supply. Compared with temperature sensors such as AD590 and LM35, the DS18820 digital temperature sensor has a comparable temperature measurement range and accuracy, and has the advantages of accurate temperature measurement and no external interference. The hardware structure is shown in Figure 4.


2.5 Display Circuit

The display part of this system uses 1602 LCD liquid crystal display. The specific interface is shown in Figure 5.

As shown in the figure above, there are two sets of power supplies, one is the power supply of the module and the other is the power supply of the backlight panel, both of which are powered by 5V. R3 is the pin for adjusting the contrast. Adjusting the voltage on this pin can change the black and white contrast. RS is a pin on many LCDs. It is the command/data selection pin. When the level of this pin is high, it means that data operation will be performed; when it is low, it means command operation. RW is also a pin on many LCDs. It is the read-write selection terminal. When the level of this pin is high, it means that the LCD is to be read; when it is low, it means that a write operation is to be performed. Similarly, many LCD modules have an E pin. Usually, a positive pulse is given to notify the data to be read after the signal on the bus is stable. When this pin is at a high level, the bus is not allowed to change. DO~D7 8-bit bidirectional parallel bus, used to transmit commands and data. BLA is the positive pole of the backlight source, and BLK is the negative pole of the backlight source.

3 Software Design

The software design of this system adopts modular design, which consists of main program, ultrasonic emission subroutine, ultrasonic receiving subroutine, temperature compensation subroutine, alarm subroutine and display subroutine. The main program flow chart is shown in Figure 6.


The most important thing about the ultrasonic reversing radar system is the control of the transmission signal and the timing of receiving and measuring. In the design, the control of the transmission by AT89S52 is the control of the 40kHz square wave generating circuit. The ultrasonic transmission circuit is controlled by the Pl.0 port of AT89S52 to transmit in a sequence of 6 pulses, which is realized by delay in the program. The pulse transmission starts the timer T0 at the same time to start timing. After the transmission, wait for 1ms to open the external interrupt INT0 and wait for the echo to be reflected to the receiving probe. The reason for waiting for 1ms is that the ultrasonic wave emitted by the ultrasonic transmitting probe generally has residual wave interference. Some sound waves will be directly transmitted to the receiving probe. After amplification by the receiving circuit, the system will mistake it for the detected echo signal. Waiting for 1ms after the transmission can avoid detecting the residual wave signal. Of course, this will also lead to the existence of a blind area in the measurement.

4 Conclusion

In order to prove the reliability of the reversing radar system designed in this paper, field measurements were carried out internally. The range of this system is 0.2~5m. The maximum error is less than 3cm. Therefore, this system has the characteristics of stable operation, strong anti-interference ability and high sensitivity.

Reference address:Design of Ultrasonic Reversing Radar System Based on 51 Single Chip Microcomputer

Previous article:Design of dimming controller based on 51 single chip microcomputer
Next article:Application of 51 chip internal timer

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号