A design of reversing radar based on MSP430

Publisher:心若清泉Latest update time:2010-07-17 Source: 今日电子 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

With the increasing requirements for the intelligence of automobile assisted driving systems and the networking development of automobile electronic systems, new reversing radars should be able to continuously measure and display the distance to obstacles, and have communication functions to send data to the vehicle bus.

Previous reversing radar designs used many components and had simpler functions. This article introduces a reversing radar based on the new high-performance ultra-low power microcontroller MSP430F2274, which can make up for the shortcomings of previous products.

Overall system design

The system adopts the principle of ultrasonic ranging. Ultrasonic ranging instruments are generally composed of three parts: a transmitter, a receiver, and a signal processor. When working, the ultrasonic transmitter sends out ultrasonic pulses, and the ultrasonic receiver receives the reflected waves reflected by obstacles, accurately measuring the time from the ultrasonic wave being emitted to the reflected waves being reflected by obstacles. According to the propagation speed of ultrasonic waves, the distance of obstacles can be calculated. As a non-contact detection method, ultrasonic waves have the characteristics of small air propagation attenuation, strong reflection ability and penetration. Ultrasonic ranging has the advantages of being unaffected by light, rain, snow and fog within a short range, simple structure, convenient production and low cost. High-performance single-chip microcomputers combined with ultrasonic ranging can realize powerful and easy-to-use reversing radars. TI's 16-bit single-chip microcomputer MSP430F2274 has extremely low power consumption and rich on-chip resources. At the same time, using JTAG interface technology, the on-chip flash memory can be easily programmed, which is convenient for software upgrades. It is very suitable as a microcontroller for reversing radar systems. The block diagram of the reversing radar system is shown in Figure 1.


Figure 1 Block diagram of the reversing radar system


Hardware system design

The system is based on the MSP430F2274 microcontroller. The peripheral circuit consists of five parts: ultrasonic transmitting circuit, ultrasonic receiving circuit, sound and light alarm circuit, communication interface circuit, and keyboard LCD display circuit. They are introduced one by one below.


Figure 2 Main control circuit diagram of reversing radar system

The main control circuit diagram of the system is shown in Figure 2. The MSP430F2274 chip selected in this system has 32Kb flash memory and 1Kb RAM, so there is no need for external memory expansion. The external 32.768kHz crystal oscillator is used as the clock source of the Basic-Timer in the CPU shutdown state, and is also used as the system's on-board clock.

The ultrasonic transmitter module circuit is shown in Figure 3, which consists of two parts: ultrasonic generation and emission. There are two methods for generating ultrasonic waves: hardware generation and software generation. The commonly used hardware generation method often adopts the following scheme: the ultrasonic wave is generated by the oscillator composed of CD4011, and is emitted by driving the ultrasonic transducer through the step-up conversion. The start and stop of the oscillator are controlled by the single-chip microcomputer. This design adopts the software generation method, because the software generation method can not only reduce the complexity of the hardware and the cost of the system, but also has the advantages of strong flexibility, easy implementation and good stability. This system uses the timer function of the MSP430F2274 single-chip microcomputer to generate a stable PWM (40Hz) pulse wave, and outputs it to the ultrasonic emission part through the I/O port P2.3. In the ultrasonic emission circuit, CD4049 includes a total of 6 NOT gates, and only 3 are used in the circuit in Figure 3. In order to prevent interference or electrostatic breakdown that causes damage to the entire CD4049, the 3 NOT gates on the unused side are connected in series for grounding. When the control end outputs a series of fixed frequency pulses, the piezoelectric ceramic ultrasonic transmitting transducer UCM-40-T adds positive and reverse voltages at a fixed frequency to emit high-power ultrasonic waves. The resulting waveform is more ideal than other methods.


Figure 3 Reversing radar ultrasonic transmission module

[page]

The ultrasonic receiving circuit is shown in Figure 4. This is a difficult point in the design and debugging of this system. The piezoelectric ceramic ultrasonic receiver UCM-40-R receives the reflected ultrasonic wave and converts it into a 40kHz millivolt voltage signal, which needs to be amplified and processed before it can be used to trigger the interrupt of the single-chip microcomputer. On the one hand, the output signal of the sensor is weak. Due to different reflection conditions, the required amplification factor range is about 100 to 5000. On the other hand, the output impedance of the sensor is large, and a multi-stage amplifier circuit with high input impedance is required, and high input impedance is easy to receive interference signals. Two solutions are usually adopted: one is to use an operational amplifier to form a multi-stage frequency selection amplifier circuit; the other is to use a dedicated integrated preamplifier. The first solution is prone to self-oscillation. To make the receiving circuit achieve good sensitivity and anti-interference effect, the circuit debugging is more difficult. This system uses a dedicated integrated circuit preamplifier CX20106, which consists of a preamplifier, a limiting amplifier, a bandpass filter, a detector, an integrator, and a shaping circuit. The preamplifier has an automatic gain control function, which can ensure that the amplifier has a higher gain when the ultrasonic sensor receives a weak voltage from a distant reflected signal, and the amplifier will not be overloaded when the input signal is strong at a close distance. By adjusting the external resistor R3 of the chip pin 5 and setting the center frequency of its filter to 40kHz, a good effect is achieved. When a signal matching the center frequency of the filter is received, its output pin 7 outputs a low level, and the output pin 7 is directly connected to P2.2 of the MSP430F2274 to trigger an interrupt.


Figure 4 Reversing radar ultrasonic receiving module


Figure 5 Reversing radar sound and light alarm circuit diagram

The alarm module uses a simple sound and light alarm circuit, as shown in Figure 5. First, a critical value is set. When the distance between the rear of the vehicle and the obstacle is less than the set minimum distance, the red indicator light flashes and the green indicator light goes out. The microcontroller sends PWM pulses to its port. As the distance decreases, the duty cycle of the PWM pulse is controlled to increase the frequency of flashing and buzzing, thereby alerting the driver.


Figure 6 Reversing radar communication interface circuit diagram

[page]

The communication interface circuit is shown in Figure 6. Using Maxim's MAX3232 chip, the peripheral circuit is very simple, requiring only five 0.1μF capacitors. This circuit isolates the microcontroller serial port output signal and transforms it into an RS-232 signal and sends it to the car bus. At the same time, it can also realize the communication between the system and the computer.


Figure 7 Reversing radar keyboard display circuit diagram


The keyboard and display circuit is shown in Figure 7, which consists of a keyboard and a liquid crystal display. The keyboard uses independent keys, with 3 keys, a setting key, an up key, and a down key. It can set various parameters such as alarm value, working mode, clock, etc. The liquid crystal display circuit uses ZJM12864BSBD, a low-power dot matrix LCD with a display format of 128 dots (columns) × 64 dots (rows). It has multi-function instructions and is easy to use. It can display clock, distance and alarm prompt information in real time, which is convenient and intuitive.

System software design

The software adopts modular design. The program consists of multiple modules such as the main program, distance measurement subroutine, keyboard display subroutine, clock display subroutine, etc. During the debugging process, each functional module and subroutine is debugged one by one. After each subroutine completes the specified function, comprehensive debugging is performed. The software flow of the system is shown in Figure 8.


Figure 8 System software flow chart

The counter starts counting when the ultrasonic transmitting circuit emits ultrasonic waves. When encountering an obstacle, the feedback signal is sent to the ultrasonic receiver. After being processed by the CX20106 receiving circuit, a low pulse is generated. The signal is transmitted to the single-chip microcomputer to generate an interrupt, call the distance measurement subroutine, calculate the measured distance, call the display subroutine, and display the distance and alarm on the LCD according to different measured values. When the distance is greater than 2m, "safe" and the measured distance are displayed, and the measurement continues; when the distance is less than 1m, "danger" and the measured distance are displayed, and the buzzer alarm is driven by P1.2; when the distance is less than 2m and greater than 1m, "caution" and the measured distance are displayed. In order to enhance the anti-interference ability, the system continuously transmits ultrasonic measurements three times, removes the maximum and minimum values, and takes the middle value to calculate the accurate distance. In this way, about three data can be measured per second, which can still meet the real-time requirements.

Conclusion

The reversing radar uses the high-performance MSP430F2274 microcontroller and makes full use of its on-chip resources to enrich the system functions, reduce the use of peripheral chips, and improve the system reliability. The reversing radar is used in cars. When the driver is reversing, he can see the distance of the obstacle from the car at a glance on the LCD screen, overcoming the shortcomings of small rearview mirrors and narrow field of view, and eliminating the potential accidents caused by reversing.

Reference address:A design of reversing radar based on MSP430

Previous article:SMARTCAR software platform realizes the overall design of automotive electronic system software
Next article:Design and implementation of CAN bus hybrid electric vehicle electronic control system

Latest Automotive Electronics Articles
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号