基于单片机的汽车倒车系统设计(超声测距报警)(C语言程序)
资料介绍:
基于单片机的汽车倒车系统设计(超声测距报警)(C语言程序)(任务书,毕业论文22000字)
摘要
本设计是以单片机技术为基础,实现对前方物体距离的测量。根据超声波指向性强,能量消耗慢,在介质中传播距离远的特点,利用超生波传感器对前方物体进行感应,经过单片机中的程序对超声波传感器发射和接收的超声波信号进行分析和计算处理,最后将处理结果在LCD1602上显示。STC89C52单片机的超声波测距系统,此系统根据超声波在空气中传播反射原理,把超声波传感器作为接口部件,利用超声波在空气中传播的时间差来测量距离,设计了一套超声波检测系统。该系统设计主要由主控制器模块、超声波发射模块、超声波接收模块和显示模块等四个基本模块构成,用接收部分接收超声波。本设计利用两个中断,在发射信号时,打开定时器中断0和外部中断0使定时器计时,接收到发射超声波信号时,外部中断0关闭中断,这时定时器中断0计录的时间就为超声波传播经过测距仪到前方物体的来回时间。利用公式S=T×V/2(V为超生波传播速度,本设计设定值340m/s),经过单片机处理得到距离值S并且通过LCD1602显示出来。当超声波模块与障碍物之间的距离超过设置的上限值或者下限值时,蜂鸣器发出报警。除此外,系统还能显示系统的实时温度。
关键词:STC89C52,超声波,LCD显示,蜂鸣器。
Abstract
The design is based on single-chip technology, to achieve the object in front of the distance measurements. According to the ultrasonic directivity, energy consumption slow propagation distance in the medium characteristics, the use of ultrasonic wave sensor for sensing objects in front of, the procedures after the microcontroller transmitting and receiving ultrasonic transducer for ultrasonic signal analysis and calculation, and finally the results will be displayed on the LCD1602. STC89C52 microcontroller ultrasonic ranging system, which spread in the air, according to the ultrasonic reflection principle, the ultrasonic sensor as the interface unit, the use of ultrasound propagation in the air of the time difference to measure distance, designed a set of ultrasonic detection system. The system is designed primarily from the main controller module, ultrasonic transmitter module, ultrasonic receiver module and display module of four basic modules, a receiving portion receives ultrasonic waves. This design uses two interrupts, the transmit signal, turn the timer interrupt 0 and external interrupt 0 enable timer timing, the received ultrasonic signal transmitter, the external interrupt 0 to disable interrupts, then the timer interrupt 0 Total recorded time the ultrasonic range finder to propagate through the round-trip time in front of the object. Using the formula S = T × V / 2 (V for the ultrasonic wave propagation velocity, the design setpoint 340m / s), from the value obtained after the single-chip processing and by S LCD1602 display. When the ultrasonic distance between the module and the obstacle exceeds the upper limit or lower limit, the buzzer alarm. In addition, a system can display real time system temperature.
Keywords: STC89C52, ultrasound, LCD display, buzzer.
[版权所有:http://DOC163.com]