0 Introduction
Ultrasonic radar, also known as parking assistance system, is a kind of ultrasonic principle. The probe mounted on the rear bumper of the car sends ultrasonic waves to hit the obstacle, and then reflects the sound wave probe to calculate the distance between the car and the obstacle. The reversing radar mainly consists of three parts:
Sensor (probe), host, display device. The sensor sends and receives ultrasonic signals, then transmits the obtained signals to the computer in the host for analysis, and then displays them on the display device. With the increasing demand for the ease of use of automobile driving assistance systems, the continuous decline in the price of single-chip microcomputers and the development of automotive electronic systems, new reversing radars are all intelligent distance measurement sensing systems with single-chip microcomputers as the core. This article introduces an ultrasonic reversing radar monitoring and alarm system based on MSP430 single-chip microcomputer.
1 System Hardware Design
This reversing radar is mainly used to display the scene behind the car and measure the distance to the obstacle. The whole design is mainly composed of MSP430 single-chip microcomputer, ultrasonic generator module, ultrasonic receiver module, video acquisition module, LCD display module and voice alarm module. The single-chip microcomputer peripherals expand a series of functional modules such as LCD, USB interface, etc. The USB host interface connects the camera module to collect video image information system, combines with ARM processor to realize video/image acquisition and compression, and sends the collected data to the receiving end and displays it through LCD.
1.1 Overall structure of reversing radar
The design of the reversing radar consists of five parts: ultrasonic generating module, ultrasonic receiving module, camera video acquisition system, LCD display module, and voice alarm system. The overall architecture is shown in Figure 1.1.
Figure 1.1 Overall design of the system
The specific tasks completed by each module are as follows:
1.1.1 Distance measurement system: It consists of an ultrasonic generating module, an ultrasonic receiving module, and a single-chip microcomputer control system, and is used to measure the distance between the car and the obstacle.
1.1.2 Display alarm system: mainly composed of USB camera, control system, display module and voice alarm, used to display the detailed scene behind and on the side of the vehicle through color LCD display, and at the same time give voice prompt alarm.
1.1.3 Control system: It is the core of this system and uses MSP430 single chip microcomputer to control the operation of the whole system and various interface circuits.
1.2 Ultrasonic emission and reception
The monostable trigger receives the 40ms pulse wave output from the P1.3 port of the S430F1101. After the voltage boost and pulse width control of the trigger, the output frequency remains unchanged and the high level width is 160us. The square wave period is 40ms. This pulse signal is used as the setting pulse of the 555 oscillator. During the setting period, the 555 generates a 40kHz oscillation signal at a fixed time, and the ultrasonic transmitter T40K converts the electrical signal into ultrasonic waves and transmits them. The ultrasonic transmitter then emits a pulse train with 7 pulses (1/40kHz=0.25ms). The sound waves of the ultrasonic transmitter propagate to the reflector, and then are reflected by the reflector to the receiver.
The echo signal received by the ultrasonic receiver UCM-R40 is converted into a voltage signal. After two-stage amplification and voltage shaping circuit, the DC voltage after shaping is not smooth, and a capacitor C5 needs to be added for filtering. The voltage range after filtering is basically stable. This voltage is used to drive the light-emitting diode of the optocoupler device SFH65A-1. At this time, the phototransistor is turned on, and a level signal is output through an inverter. Then, the level signal is basically stable through another inverter. The level signal is directly input into the external interrupt entry of the single-chip microcomputer. The high level is used as the interrupt signal of the external interrupt of MSP430 to cause the single-chip microcomputer to interrupt, stop the timing of the counter in the interrupt service program, and calculate the relevant data.
1.3 Display Circuit Design
The use of real-time image video is intuitive, vivid, fast, convenient, and rich in content, which makes it easy for drivers to grasp the surrounding environment in a timely and detailed manner and make accurate judgments. A USB camera is used as the image acquisition device of this system. The main control chip model is selected as the ZC301 of SMIC. The camera communicates with AT91RM9200 through the USB interface. After the corresponding data processing, ARM displays it in real time on the LCD screen. [page]
2 System Software Design
2.1 Overall idea
The software design adopts modular design, including main program design, T1 interrupt service subroutine, INT0 external interrupt service subroutine, distance calculation subroutine, display subroutine, delay subroutine and alarm subroutine design.
After the system is initialized, timer T1 is started to count from 0. At this time, the main program enters the waiting state. When it reaches 65 ms, T1 overflows and enters the T1 interrupt service subroutine. In the T1 interrupt service subroutine, a new ultrasonic emission will be started. At this time, a 40 kHz square wave will be generated on the P1.0 pin, and timer T0 will be started at the same time. In order to avoid the diffraction of the direct wave, it is necessary to delay 1 ms before enabling the INT0 interrupt. After the INT0 interrupt is enabled, if a low level appears on the P3.2 (INT0) pin at this time, it means that the echo signal is received, and an interrupt request will be made to enter the INT0 interrupt service subroutine. In the INT0 interrupt service subroutine, the timer T0 will be stopped, the time value of the timer T0 will be read into the corresponding storage area, and the reception success flag will be set. Once the main program detects the reception success flag, it will call the temperature measurement subroutine to collect the ambient temperature during ultrasonic ranging, and convert the accurate sound speed and store it in RAM. The MCU then calls the distance calculation subroutine to calculate the distance between the sensor and the target object. After that, the main program calls the display subroutine to display. If the minimum alarm distance is exceeded, the speaker alarm will be activated. After the transmission, reception, and display process is completed, the system will delay 100 ms to reset T1 to the initial value, and start T1 again to overflow and enter the next distance measurement. If the obstacle is too far away and exceeds the range, so that the echo has not been received when T0 overflows, "ERROR" will be displayed and the main process will be returned to enter a new round of testing.
2.2 Ultrasonic transmission and reception software
The method of receiving ultrasonic waves and judging the distance between the obstacle and the car, and triggering the alarm according to the judged distance, is shown in the flowchart of its working principle in Figure 2.1.
Figure 2.1 Ultrasonic ranging flow chart
The task of the ultrasonic emission subroutine is to control the time base circuit to output a number of ultrasonic waves and start T0 to start timing at the same time. In this process, the timing should use operations such as shielding interrupts and opening interrupts to avoid external interrupts affecting the effective execution of the subroutine.
This system uses an interrupt, namely, the external interrupt INTO is the indication signal of the effective return of ultrasonic wave. When the interrupt is triggered, the transmission distance of ultrasonic wave can be calculated according to the time difference. The internal timer TO is used for timing. When the transmission subroutine starts, T0 is started to work. When the INTO interrupt service program is executed, T0 timing is stopped and the timing value is read to calculate the distance.
The distance subroutine is calculated based on the transmission time provided by the MSP430 chip counter, and the transmission distance of the ultrasonic wave is calculated based on the calculation. According to the needs of the main program, the relevant data is stored in the relevant unit for the main program to process in the next step. The INTO interrupt service program stores the value in the timer in the two registers R1 and R0, and obtains the time difference based on the modulus value minus the value obtained by the disposal. The transmission distance is calculated according to the formula S=V*T. The distance value of the target object is also calculated according to the formula, where T is the measured time difference of the counter, in us. The distance between the target object and the car can be calculated using this formula.
3 Conclusion
The system uses the transmissibility of ultrasound in the air to measure the propagation time and propagation speed of ultrasound in the air in real time. Based on the principle of multiplying time and speed to get distance, an ultrasonic reversing radar monitoring and alarm system based on MSP430 is designed to measure the distance between the rear of the car and the obstacle in real time, display the distance value on LCD, and provide the distance value to the driver. The system has the advantages of low cost, non-contact, fast speed, strong reliability, good adaptability, easy operation, and has broad application prospects.
Practical application shows that the design has certain value in both production application and scientific research. On the one hand, the human-machine interface of the product design is more user-friendly. The driver can directly observe the detailed situation behind the car through the LCD display screen, and can reverse without looking back, which greatly reduces the workload of the car driver and avoids traffic accidents caused by the guide car accidentally; on the other hand, the system continuously collects the distance between the car and the obstacle, and reminds the driver in real time through the voice alarm system, which provides a safer guarantee for our reversing, making it more convenient and faster, and also safer and more reliable when we reverse.
Previous article:Design of an intelligent car based on the black line motion of two-dimensional objects
Next article:Design of intelligent vehicle control system based on MC9S12DG128 single chip microcomputer
Recommended ReadingLatest update time:2024-11-16 15:34
- Popular Resources
- Popular amplifiers
- MSP430 series single chip microcomputer system engineering design and practice
- oled multi-chip calling program
- Microcontroller Principles and Applications Tutorial (2nd Edition) (Zhang Yuanliang)
- Getting Started and Improving MSP430 Microcontrollers - National Undergraduate Electronic Design Competition Training Course
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
- MSP430F5529 generates PWM waves with CCS
- When communicating in 485 network, sometimes the slave does not return data after the host asks
- Detailed explanation of the working principle of linear regulated power supply
- Detailed explanation of MSP430F149 serial port receiving and sending program
- Embedded Development Electronic Technology Classic Data 12G
- The new TMS320F28377S cannot connect to the emulator, what should I do?
- 【EasyARM-RT1052 Review】 + cJSON transplantation and use
- EEWORLD University ---- FPGA-based SOPC development process (Intel official tutorial)
- The difference between the input and output voltages of the voltage follower is so large that I was confused for several days. Please help me.
- Use of Inductor