1、 基于基于 51 单片机的超声波测距系统设计单片机的超声波测距系统设计 学 院: 专 业: 姓 名: 指导老师: 信息学院 测控技术与仪器 学 号: 职 称: 中国 珠海 二一二年五月 本科毕业生毕业设计 诚信承诺书诚信承诺书 本人郑重承诺:本人郑重承诺:本人承诺呈交的毕业设计基于 51 单片机的超声波测 距系统设计是在指导教师的指导下,独立开展研究取得的成果,文中 引用他人的观点和材料, 均在文后按顺序列出其参考文献, 设计使用的 数据真实可靠。 本人签名: 日期: 年 月 日 本科毕业生毕业设计(论文) 基于基于 5151 单片机的超声波测距系统设计单片机的超声波测距系统设计 摘摘 要要
2、本次系统的设计主要包括两部分,即硬件电路和软件程序。硬件电路主要包括单片 机电路、发射电路、接收电路、显示电路和电源电路等。本次设计采用以AT89C51单片 机为核心的低成本、高精度、微型化数字显示超声波测距仪的硬件电路。整个电路采用 模块化设计,由信号发射和接收、供电、显示等模块组成。发射探头的信号经放大和检 波后发射出去,单片机的计时器开始计时,超声波被发射后按原路返回,信号被接受电 路接受,然后被单片机接收,计数器停止工作并得到时间。软件程序主要由主程序、预置 子程序、发射子程序、接收子程序、显示子程序等模块组成。它控制单片机进行数据发 送与接收,实现数据正确显示在数码管上。另外程序控制
3、单片机消除各探头对发射和接 收超声波的影响。相关部分附有硬件电路图、程序流程图。 实际的环境对超声波有很大的影响,如外部电磁干扰电源干扰信道干扰等等,空气 的温度对超声波的速度影响也很大,此外供电电源也会使测量差生很大的误差。由于知 识面有限,作品还有许多可以改进的地方,希望在日后的学习中能将作品完善的更好。 关键词:AT89C51;超声波;测距 本科毕业生毕业设计(论文) 51 MCU-based Ultrasonic Ranging System Design Abstract The systems design includes two parts, namely the hardwa
4、re circuit and software program.The hardware circuit includes a microcontroller circuit, the transmitting circuit, the receiving circuit, display circuit and the power supply circuit. The design uses AT89C51 microcontroller as the core of low-cost, high-precision, miniaturization of digital hardware
5、 circuit of the ultrasonic range finder. The entire circuit is modular in design, by the signal transmitter and receiver, power supply, display modules. Transmitted probe signal is amplified and detector were launched out single-chip timer is started, the ultrasonic was launched after the original w
6、ay back, a signal is accepted by a receiving circuit, then MCU receives the counter stop working and time. Software program from the main program, preset subroutine emission subroutine, receive subroutine, subroutines modules. It microcontroller to send and receive data, data display correctly in the digital control. In addition, program-controlled microcontroller to eliminate the impact of the probe for transmitting and receiving ultrasonic waves. With relevant