摘 要:近年来,随着计算机领域和工业领域的不断发展,非接触测距与识别在生产和生活中变的尤为重要。由于人工测距与识别的局限性,因此人们迫切需求一款可以实现非接触测距与识别的系统。本文介绍了基于单片机的超声波测距系统设计,其中硬件部分的电路采用模块化设计,由电源电路、超声波测距电路、报警电路、数码管显示电路等模块组成。系统整体设计以STC89C52单片机为主控制芯片,加入数码管以清晰的显示出测距的实测距离,并且添加了报警功能,当测得距离小于设定报警值时,STC89C52发出指令控制蜂鸣器报警。本系统可以实现短距离非接触式测距,性能优良,系统结构简单,易操作,具有良好的应用前景。59075
毕业论文关键词:STC89C52,超声波,测距,报警
Abstract:In recent years, with the continuous development of computer field and industrial field, non-contact distance measurement and identification becomes especially important in the production and life. Given the limitations of manual ranging and recognition, people urgently need a system which can realize non-contact distance measurement and identification. This thesis introduces a design of ultrasonic range finder based on single chip microcomputer, The part of hardware circuit uses modular design, composed of a power supply circuit,ultrasonic ranging circuit, alarm circuit, digital display circuit module, etc. The design of the whole system adopts the STC89C52 single-chip as the main control chip, adding the digital tube to clearly show the range of the measured distance, and add the function of alarm, when measured distance is less than the set alarm value, STC89C52 seeds out a command to control buzzer alarm. The system structure is simple, easy to operate and has good application prospect.
Key words: STC89C52, Ultrasonic wave, Measure distance,A alarm
1 绪论 5
2 超声波测距仪工作原理 5
2.1 超声波简介 5
2.2 超声波测距仪原理 5
3 系统硬件电路设计 6
3.1 总体方案设计 6
3.2 主要元器件介绍 7
3.3 电源电路设计 7
3.4 超声波模块设计 7
3.5 显示电路设计 8
3.5.1 显示电路功能实现 8
3.5.2 数码管结构和工作原理 9
3.6 复位电路设计 9
3.7 蜂鸣器报警电路设计 10
3.8 按键电路设计 10
4 系统软件程序设计 11
4.1 软件开发环境 11
4.2 软件总体方案设计 11
4.3 超声波模块子程序设计 12
4.4 测距子程序设计 13
5 系统调试与分析 14
5.1 系统调试 14
5.2 调试故障及原因分析 15
5.3 调试结果及误差分析 15
结 论 16
参考文献 17
致 谢 18
附 录