基于单片机的超声波测距系统的设计

 2022-11-26 12:11

论文总字数:21746字

摘 要

本课题研究了基于单片机STC89C52的超声波测距系统的方案设计,硬件电路和软件设计功能实现。研究过程中发现了一些误差因素,比如因为温度引起的误差考虑在内并且通过增加温度补偿系统减小误差,温度补偿系统用了温度传感器DS18B20采集温度数据,用了1602LCD液晶显示屏显示最后得到的距离值,环境温度及设置阈值。本系统的电路性能良好、在测距时的检测反应速度很快、逻辑计算简单,并在测量精度方面能达到工业使用的级别。

这个方法具有计算简单、实时控制简单、测量精度高、精度强、功耗低、介质扩展路径长等优点,正因为这些优点,超声波测距系统可以解决生活中不容易测距的情况或者需要紧急测距的情况。而超声波测距系统比一般的测距系统更迅速、更便捷。

关键词:STC89C52;超声波;测距;温度补偿;液晶显示

Design of Ultrasonic Distance Measurement System based on MCU

Abstract

This paper studies the scheme design, hardware circuit and software design of ultrasonic distance measurement system based on STC89C52. Some error factors are found in the research process, such as the error caused by temperature is taken into account, and the error is reduced by adding a temperature compensation system. The temperature compensation system uses a temperature sensor DS18B20 to collect temperature data, and uses a 1602 LCD to display the final distance value, ambient temperature and setting threshold. The circuit performance of the system is good, the detection reaction speed is fast, the logic calculation is simple, and the measurement accuracy can reach the level of industrial use.

This method has the advantages of simple calculation, simple real-time control, high measurement accuracy, high precision, low power consumption, long medium expansion path and so on. Because of these advantages, the ultrasonic ranging system can solve the situation that is not easy to measure or needs emergency ranging in life. The ultrasonic ranging system is faster and more convenient than the general ranging system.

Keywords:STC89C52;Ultrasonic;Ranging;Temperature compensation;LCD

目 录

基于单片机的超声波测距系统的设计 I

摘 要 I

Abstract II

第一章 引 言 1

1.1 选题背景与意义 1

1.2 研究的主要内容 1

1.3 要解决的主要问题 1

第二章 超声波测距的方案设计 2

2.1 设计方案论证与比较 2

2.1.1 显示模块的方案论证与比较 2

2.1.2 测温模块的方案论证与比较 2

2.2 系统总体方案 2

第三章 超声波测距的硬件电路设计 3

3.1 单片机模块 3

3.1.1 STC89C52主要性能 3

3.1.2 STC89C52内部组成 3

3.2 超声波测距模块 4

3.2.1 超声波传感器介绍 4

3.2.2 HC-SR04超声波测距模块的性能特点 5

3.2.3 HC-SR04与单片机的接线图 5

3.2.4 超声波时序图 6

3.2.5 HC-RS04超声波测距原理 6

3.3 复位电路 7

3.4 晶振电路 7

3.5 驱动显示电路及报警电路 8

3.5.1 1602LCD液晶显示屏 8

3.5.2 蜂鸣器报警 8

3.6 5V稳压电路 9

3.7 温度检测电路 9

3.7.1 温度检测方案的分析 9

3.7.2 数字温度传感器DS18B20简介 9

3.7.3 DS18B20的结构及电路 10

第四章 软件设计 11

4.1 主程序 11

4.2显示数据子程序 11

4.3 报警子程序 11

4.4 按键子程序 12

4.5 超声波测距程序 12

4.6软件开发平台介绍 13

第五章 制作流程与调试结果 14

5.1 制作流程 14

5.2 调试 14

5.3 实验结果 14

5.4 误差分析 15

5.4结束语 16

致 谢 17

参考文献(References) 18

附录一 19

附录二 19

第一章 引 言

1.1 选题背景与意义

现在科技的快速更新迭代,高科技产品价格一天比一天低,尤其是芯片,此外它实用性日益提升,同时,用新技术来给我们的生活带来的便利更是数不胜数,超声波测距就是其中之一,(距离是表示两坐标之间距离的物理量,是生活中比较重要的物理性质之一),在平时我们工作生活中难免会有一些危险环境,这时候测距就不能人工去操作,会有危险,因此有了超声波测距,它特别方便,可以达到快、准、狠的效果,效率及高,特别是比如有一些恶劣环境,如强毒强酸强电强干扰的环境,因此它的设计具有一定价值意义。

本课题所研究的系统,可以被应用在倒车报警系统,液位测量等领域,这个系统把测距和超声波结合于一身,可以利用本系统去完成往返时间的测量,用的是以现在市面上常用的单片机为核心处理器,从而进行物体间距离的测量,完成一套实时,测量精度高的超声波测距系统。

1.2 研究的主要内容

剩余内容已隐藏,请支付后下载全文,论文总字数:21746字

您需要先支付 80元 才能查看全部内容!立即支付

该课题毕业论文、开题报告、外文翻译、程序设计、图纸设计等资料可联系客服协助查找;