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.
Previous article:Design of dimming controller based on 51 single chip microcomputer
Next article:Application of 51 chip internal timer
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- STM32 sets different input and output modes for different pins of the same IO port
- [SC8905 EVM Evaluation] Power Supply Ripple Test
- Mbed OS changes the way it is released
- STM32MP157A-DK1 Evaluation + SPI Device
- How to define a const structure variable
- [Silicon Labs BG22-EK4108A Bluetooth Development Review] Received the fastest, unboxing
- Introduction to three interrupt debugging methods of ARM
- Ask a superconductivity question
- CC2640R2F Single Carrier Code
- Essential PCB wiring rules for electronic hardware engineers: basic theories of right-angle routing, differential routing, and serpentine routing