Design of reversing radar based on MSP430 microcontroller

Publisher:心满意足Latest update time:2012-05-25 Source: 科技信息Keywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Keywords:MSP430 Reference address:Design of reversing radar based on MSP430 microcontroller

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

MSP430 ADC12 1602 display
#include /*Two channels of data acquisition, one of which is very stable, with one or two jumps, but the other channel jumps a lot. My processing method is: 1. Connect all the extra channels, sort them after acquisition, take the middle one or several middle ones, add them and average them, which is suitable for in
[Microcontroller]
Design of non-invasive visual pulse oximeter based on MSP430 series MCU
A pulse oximeter is a medical device used to monitor a patient's blood oxygen levels. The device measures blood oxygen levels and heart rate and generates an alarm when levels drop below a predetermined threshold. This type of monitoring is extremely useful for newborn babies and during surgical procedures. The
[Microcontroller]
Design of non-invasive visual pulse oximeter based on MSP430 series MCU
Several situations of MSP430 reset
---------------------------------------------------------------------- 1. Watchdog timeout reset The watchdog overflow reset is caused by not feeding the watchdog in time or not turning off the watchdog at the beginning of the program. The watchdog should be shielded during the debugging phase and the watchdog should
[Microcontroller]
MSP430 IO port current source and sink problem
Digital input/output ports have the following features: □  Each input/output bit can be programmed independently. □  Any combination of input and output is allowed. □  All  8  bits of   P1  and  P2  can be set as interrupts. □  The input and output data registers can be operated independently. □  Pull-up or pull-d
[Microcontroller]
MSP430 IIC bus program
#ifndef _I2C_H  #define _I2C_H  #define SDA_1       P4OUT|=0x02               //SDA = 1  #define SDA_0 P4OUT&=~0x02 //SDA = 0  #define SCL_1 P4OUT|=0x01 //SCL = 1  #define SCL_0 P4OUT&=~0x01 //SCL = 0  #define SDA_IN P4DIR&=~0x02; //I/O port is input  #define SDA_OUT P4DIR|=0x02 //I/0 port is output  #define J_SDA_1_o
[Microcontroller]
MSP430 Functional Module Detailed Explanation Series - System Clock
1. Clock source types LFXT1CLK low-frequency clock source - each MSP430 device has XT2CLK high frequency clock source——available in X13X, X14X, X15X, X16X, X43X, X44X, etc. DCOCLK digitally controlled RC oscillator 2. Clock Source Description ACLK auxiliary clock: ACLK is obtained by dividing the LFXT1CLK (low-frequen
[Microcontroller]
MSP430 key interrupt
#include msp430f149.h      typedef unsigned char uchar;   typedef unsigned int uint;   #define then (P1IN & 0X0F)   #define wei_h P5OUT |= BIT5   #define wei_l P5OUT &= BIT5   #define duan_l P6OUT &= ~BIT6   #define duan_h P6OUT |= BIT6      uchar table = {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x
[Microcontroller]
Using MSP430F41 MCU timer to realize signal sampling and PWM control
PWM control is widely used in various control systems, but the adjustment of pulse width is generally implemented by hardware. If a PWM controller is used or a PWM circuit is added to the system , the cost is high, the response speed is slow, and there are compatibility issues between the PWM controller and the system.
[Microcontroller]
Using MSP430F41 MCU timer to realize signal sampling and PWM control
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号