单片机的超声波测距以及报警

目录
Abstract II
一、绪 论 1
(一) 研究的背景 1
(二)研究的主要内容 1
(三)应解决的关键问题 1
二、电路方案论证 2
(一)方案比较 2
1、激光测距 2
2、超声波测距 2
(二)电路总体方案 2
(三)超声波测距模块 3
1、 超声波传感器介绍 3
2、 HC-SR04超声波测距模块的性能特点 3
3、 HC-SR04的管脚排列和电气参数 3
4、 超声波时序图 4
三、 系统硬件电路的设计 5
(一)单片机最小系统 5
1、单片机的选择 6
2、 复位电路 7
3、晶振电路 7
(二) 驱动显示电路及报警电路 8
1、 1602LCD液晶显示屏 8
2、 蜂鸣器报警 8
(三) HC-RS04超声波测距原理 9
(四)温度检测电路 9
四、系统程序的设计 11
(一)系统主程序设计 11
(二)系统子程序设计 12
1、显示数据子程序 12
2、报警子程序 13
3、按键子程序 14
五、结束语 15
六、答谢词 16
参考文献 17
附录A 18
a.电路仿真图 18
b.电路原理图 19
附录B 20
摘 要
超声波有很多的优点,比如:能量耗的很慢,方向性好,在很远的地方都能收到信号,一半在传感器和自动控制相结合中,用的比较多,超声波在测量距离方面用的还是比较多的,也很广泛。
本次设计为了完成基于单片机的超声波测距,特地选用了STC89C51单片机,本次论文当中会有适当的说明此单片机的特征和相关性能,并且通过建立在超声波测距的理论依据上,来指出说明了设计此次的测距系统的一些缺点,后续查阅相关资料,考虑到因为温度不同引起的误差会对测试的精度产生影响,所以
 *好棒文|www.hbsrm.com +Q:  3_5_1_9_1_6_0_7_2 
能收到信号,一半在传感器和自动控制相结合中,用的比较多,超声波在测量距离方面用的还是比较多的,也很广泛。
本次设计为了完成基于单片机的超声波测距,特地选用了STC89C51单片机,本次论文当中会有适当的说明此单片机的特征和相关性能,并且通过建立在超声波测距的理论依据上,来指出说明了设计此次的测距系统的一些缺点,后续查阅相关资料,考虑到因为温度不同引起的误差会对测试的精度产生影响,所以加入温度补偿功能来进行改善。在本系统中,我用的是STC89C51单片机,之所以用51单片机是因为它的价格便宜,而且控制的精度还是特别的高,测得的数字在液晶上面显示出来,而且测得的距离准确,精度还比较高。还可以自动报警。
关键词:测距,单片机,液晶显示, 报警
Abstract
Ultrasound has strong directivity, the energy loss is slow, and therefore, the use of distance measuring sensors in the program, by far the most widely used mode or an ultrasonic distance measuring current practice in society he is widely used in reversing radar, building inspection and monitoring, measuring water level positions as well as someindustrial scene.
In order to complete this design microcontroller based ultrasonic ranging, specially chosen STC89C51 microcontroller, which this paper will be an appropriate description of this microcontroller and related performance characteristics, and by building on the theoretical basis of ultrasonic ranging to indicate instructions the design of some of the disadvantages of distance measuring system,taking into account the different causes of error because the temperature will affect the accuracy of the test, so the added temperature compensation feature to make improvements. The graduation project is also given to the hardware circuit low cost,fast detection speed and distance range to achieve the alarm warning can be regulated
Keywords: ranging , microcontroller,alarm,LCD display
一、绪 论
(一) 研究的背景
因为单片机的主要特点是价格低廉、工作安全稳定、工作效率高,所以它在实际生活中的使用也是很广的。日常生活中,单片机集成性很高,,具有较强的可扩展性。它的数据处理功能和一般计算机是相类似的,想要获得很强的数据处理能力,可以通过使用一些科学的算法来实现。所以单片机在实际使用中,占用的空间很小,但是呢,处理东西的能力特别的高,而且效率那是特别的快。
同时,随着社会的不断发展和进步,超声波测距系统因为它的技术难度系数比较低,而且它的成本比较低廉等特点,所以在实际生活中显得日益重要,实际应用范围也在迅速扩

版权保护: 本文由 hbsrm.com编辑,转载请保留链接: www.hbsrm.com/dzxx/txgc/1426.html

好棒文