Design of Reversing Radar Based on MSP430F2274 MCU

With the improvement of people’s intelligent requirements for automotive assisted driving systems and the development of networked automotive Electronic systems, the new type of parking radar should be able to continuously measure distances and Display the distance of obstacles, and have communication functions, which can send data to the car bus. . In the past, the design of reversing radar used more components and simpler functions. The reversing radar based on the new high-performance ultra-low-power microcontroller MSP430F2274 introduced in this paper can make up for the deficiencies of previous products.

With the improvement of people’s intelligent requirements for automotive assisted driving systems and the development of networked automotive electronic systems, the new type of parking radar should be able to continuously measure distances and display the distance of obstacles, and have communication functions, which can send data to the car bus. . In the past, the design of reversing radar used more components and simpler functions. The reversing radar based on the new high-performance ultra-low-power microcontroller MSP430F2274 introduced in this paper can make up for the deficiencies of previous products.

Overall system design

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

Design of Reversing Radar Based on MSP430F2274 MCU
Figure 1 Block diagram of parking radar system

hardware system design

The system takes MSP430F2274 microcontroller as the core, and the peripheral circuit consists of five parts: ultrasonic transmitting circuit, ultrasonic receiving circuit, sound and light alarm circuit, communication interface circuit, and keyboard liquid crystal display circuit, which are introduced one by one below.

Design of Reversing Radar Based on MSP430F2274 MCU
Figure 2 The main control circuit diagram of the reversing radar system

The main control circuit diagram of the system is shown in Figure 2. The MSP430F2274 selected in this system has 32Kb flash memory and 1Kb RAM on-chip, so there is no need to expand the memory. The external 32.768kHz crystal oscillator is used as the clock source of the Basic-TImer when the CPU is turned off, and it is also used as the on-board clock of the system.

The ultrasonic transmission module circuit is shown in Figure 3, which consists of two parts: ultrasonic generation and emission. There are two kinds of ultrasonic generation methods: hardware generation method and software generation method. The commonly used hardware generation method often adopts the following scheme: the ultrasonic wave is generated by the oscillator composed of CD4011, and the ultrasonic transducer is pushed out by the boost conversion, and the starting and stopping 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, reduce the cost of the system, but also have the advantages of strong flexibility, easy implementation and good stability. This system utilizes the timer function of MSP430F2274 single-chip microcomputer to generate stable PWM (40Hz) pulse wave, and output it to the ultrasonic transmitting part through I/O port P2.3. In the ultrasonic transmitting circuit, CD4049 includes a total of 6 NOT gates, and only 3 are used in the circuit in Figure 3. In order to prevent the entire CD4049 from being damaged due to interference or electrostatic breakdown, the 3 NOT gates on the side that are not used are connected in series Get up and do grounding. When the control terminal outputs a series of fixed frequency pulses, the piezoelectric ceramic ultrasonic transmitting transducer UCM-40-T applies positive voltage and reverse voltage at a fixed frequency to emit high-power ultrasonic waves, and the obtained waveform is better than other way is more effective.

Design of Reversing Radar Based on MSP430F2274 MCU
Figure 3 Reversing radar ultrasonic transmission module

The ultrasonic receiving circuit is shown in Figure 4. This is a difficult point in the system design and debugging. The piezoelectric ceramic ultrasonic receiver UCM-40-R receives the reflected ultrasonic wave and converts it into a voltage signal of 40kHz millivolt level, 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 range of magnification required 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 the high input impedance is easy to receive interference signals. . Two schemes are usually used: one is to use an operational amplifier to form a multi-stage frequency selective amplifier circuit; the other is to use a dedicated integrated preamplifier. The first scheme is easy to produce self-excited oscillation, and it is difficult to debug the circuit to achieve good sensitivity and anti-interference effect of the receiving circuit. The system uses a dedicated integrated circuit preamplifier CX20106, which consists of a preamplifier, a limiting amplifier, a band-pass filter, a detector, an integrator, and an integer 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 distant reflected signal and outputs a weak voltage, and the amplifier will not be overloaded when the input signal is strong at a short distance. Adjust the external resistor R3 of pin 5 of the chip, and set the center frequency of its filter to 40kHz, which achieves a very good effect. When receiving a signal consistent with the center frequency of the filter, 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.

Design of Reversing Radar Based on MSP430F2274 MCU
Figure 4 Reversing radar ultrasonic receiving module

Design of Reversing Radar Based on MSP430F2274 MCU
Figure 5 Reversing radar sound and light alarm circuit diagram

The alarm module adopts a simple sound and light alarm circuit, as shown in Figure 5. First set a critical value, 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 single-chip microcomputer sends PWM pulses to its port, and as the distance decreases, the frequency of flashing and buzzing is increased by controlling the duty ratio of the PWM pulses, thereby prompting the driver.

Design of Reversing Radar Based on MSP430F2274 MCU
Figure 6 Circuit diagram of the reversing radar communication interface

The communication interface circuit is shown in Figure 6. Using Maxim’s MAX3232 chip, the peripheral circuit is very simple, only 5 capacitors of 0.1μF are needed. The circuit isolates and converts the serial output signal of the single-chip microcomputer into an RS-232 signal and sends it to the car bus, and can also realize the communication between the system and the computer.

Design of Reversing Radar Based on MSP430F2274 MCU
Figure 7 Reversing radar keyboard display circuit diagram

The keyboard and display circuit are shown in Figure 7, which consists of two parts: the keyboard and the liquid crystal display. Among them, the keyboard adopts independent keys, there are 3 keys, a setting key, an up-turn key, and a down-turn key. Various parameters such as alarm value, working mode and clock can be set. The liquid crystal display circuit adopts ZJM12864BSBD, a low-power dot matrix LCD with a display format of 128 dots (columns) × 64 dots (rows), with multi-function commands, easy to use, and real-time display of clock, distance and alarm prompts information, convenient and intuitive.

System software design

The software adopts modular design. The program consists of main program, ranging subprogram, keyboard display subprogram, clock display subprogram and other modules. During the debugging process, each functional module and subprogram is debugged one by one. After completing the specified functions, perform comprehensive debugging. The software flow of the system is shown in Figure 8.

Design of Reversing Radar Based on MSP430F2274 MCU
Figure 8 System software flow chart

When the ultrasonic transmitting circuit sends out ultrasonic waves, the counter starts to count. When encountering obstacles, the feedback signal is sent to the ultrasonic receiver to receive. After being processed by the CX20106 receiving circuit, a low pulse is generated. Calculate the measurement distance, call the display subroutine, and display the distance and alarm on the LCD according to different measurement values. When the distance is greater than 2m, “safe” and the measurement distance are displayed, and the measurement is continued; when the distance is less than 1m, “danger” and the measurement distance are displayed, and the buzzer alarm is driven by the P1.2 bit; when the distance is less than 2m and greater than 1m, the Displays “Attention” and measures distance. In order to enhance the anti-interference ability, the system continuously transmits ultrasonic waves to measure three times, remove the maximum and minimum values, and calculate the precise distance by taking the middle value. In this way, about three data can be measured per second, which can still meet the real-time requirements.

Epilogue

The reversing radar adopts the high-performance MSP430F2274 single-chip microcomputer, and makes full use of its on-chip resources to enrich the system functions, reduce the number of peripheral chips used, and improve the system reliability. The reversing radar is used in automobiles. When the driver is reversing, he can know the distance of the obstacle from the car at a glance from the LCD screen.

The Links:   FF600R16KF4 2DI200A-050

Related Posts