1、 本 科 毕 业 设 计 ( 论 文 ) 基于单片机的超声波车间距测量系统设计基于单片机的超声波车间距测量系统设计 学院名称: 汽车与交通工程学院 专 业: 汽车服务工程 班 级: 学 号: 姓 名: 指导教师姓名: 指导教师职称: 讲师 二一七 年 六 月 i 基于单片机的超声波车间距测量系统设计 摘 要:本文基于 STC89C52 单片机设计了一种超声波车间距测量系统。系统设计包 括硬件电路设计和软件程序设计两部分,其中硬件电路设计部分主要包括单片机系统电 路、超声波发射电路、超声波检测电路、显示电路、电源电路,复位电路和 LED 控制 电路。软件程序设计部分主要包括主程序、超声波发射子程
2、序、超声波接收中断程序和 显示子程序。系统工作时,由超声波发射器发射出超声波,单片机的计时器开始计时; 超声波接触到障碍物反射回来,被超声波接受装置接收; 接收信号被传送至单片机, 计时 器停止工作并得到时间,结合温度测量模块对周围环境温度的测量提供较为准确的超声 波波速,最终计算出合理的车距。此外,该系统还具有适时声光报警的功能。 关键词: STC89C52;超声波;测距 Design of Ultrasonic Vehicle Spacing Measurement System Based on Single Chip Microcomputer Abstract: In this wo
3、rk, an ultrasonic vehicle spacing measurement system is presented based on STC89C52 single-chip microcomputer (SCM). The system design includes the hardware circuit design part and the software program design part. The hardware circuit design part mainly includes the SCM system main circuit, the ult
4、rasonic emitting circuit, the ultrasonic detection circuit, the display circuit, the power supply circuit, the reset circuit and the LED control circuit. The software program design part mainly includes the main program, the ultrasonic transmitting subprogram, the ultrasonic receiving interrupt prog
5、ram and the design of a subroutine. When the system is working, the ultrasonic transmitter transmits ultrasonic, and the ultrasonic will be reflected back to the ultrasonic device when it encounters the obstacle. SCM is used to record the time difference of launching ultrasonic wave and receiving th
6、e echo and then calculate the vehicle spacing based on the obtained temperature-dependent ultrasonic velocity. Besides, the present system also has an additional function of the acousto-optic alarm in time. Keywords: STC89C52; Ultrasonic; Vehicle spacing measurement I 目 录 第 1章 绪论 1 1.1 课题背景及重要意义 . 1 1.2 课题主要研究内容 . 1 1.3 课题需要解决的问题 . 5 第 2章 超声波测距原理与方法 . 6 2.1 超声波简介 . 6 2.1.1 超声波的产生方式 . 6 2.1.2 超声波的主要特点 . 6 2.1.3 超声波的主要应用 . 7