没有合适的资源?快使用搜索试试~ 我知道了~
基于STC89C52单片机设计超声波测距.docx
0 下载量 70 浏览量
2023-07-01
21:04:12
上传
评论
收藏 4.42MB DOCX 举报
温馨提示
试读
69页
基于STC89C52单片机设计超声波测距.docx
资源推荐
资源详情
资源评论
西安工程大学本科毕业设计(论文)
摘 要
随着社会的快速发展,电脑已经在我们生活和学习中得到普及。但是在享受
信息化带来的方便和乐趣的同时,我们不能忽视与之带来的问题,比如长期使用
电脑造成颈椎病、近视眼等一系列疾病。为此,本文提出要开发电脑近距报警器
来改善这种状况。
本设计以 STC89C52 单片机为核心,通过安装在电脑显示器上、中、下三个
HC-SR04 超声波模块测量人的距离,从而得知人的位置,判断人是否离电脑距
离过近,姿势是否正确,通过报警提示用户矫正姿势;通过 DS18B20 温度传感
器采集实时温度,判断环境温度是否正常,为用户提供环境温度参考;对电脑的
使用时间进行记录,以便提醒用户休息;由独立键盘和 LCD1602 组成友好的人机
交互界面,便于用户操作。经过调试,最后验证本设计实现了以上所提到的功能,
具有创新性和使用价值。
经过对设计的功能进行分析,在论文开始得出了该系统的设计方案,接着从
硬件、软件两部分对整个系统的设计方案进行了详细描述,最后通过系统的调试
与分析验证了系统功能。
关键字:单片机,超声波,测距,矫正姿势
西安工程大学本科毕业设计(论文)
ABSTRACT
With the fast development of society, computers have been widely used in our
normal life and study. While we enjoy the convenience in information and fun, we
can't ignore the problems, such as the cervical vertebra disease, myopia, a series of
disease for the long time use of computers. Thus, the alarm for the near distance
between computer and user, which is used to improve this situation is proposed in this
context.
The design is in the core of STC89C52 Single chip microcomputer, measures
people’s distance through the up, middle, down three HC-SR04 ultrasonic wave parts
which are installed on the computer display, according to the records, it'll know the
people's position, judge whether the distance that's between user and computer is too
close, the gesture is right or not, then prompt user to correct gesture through alarm,
it'll judge whether the environmental temperature is normal, in order to apply user the
reference temperature through the DS18B20 temperature sensor to get the actual ones,
the computer’s use time will be recorded to suggest users to get relaxed, the friendly
human computer interaction interface which consist of independence keyboard and
the LCD1602 can be easily used, too. After debugging, it was tested that the design
has accomplished the whole functions, and it's innovative and valuable.
According to the analyze of the application, it comes into being the design
scheme of the system in the beginning, then gives the detail description from
hardware and software both sides, finally gets the verification of the system function
through the system debugging and analyze.
KEY WORDS: microcontroller, ultrasonic, ranging, correct posture
西安工程大学本科毕业设计(论文)
目 录
前 言...............................................................1
第 1 章 绪 论........................................................2
1.1 基本原理.....................................................2
1.1.1 测距的基本原理 .........................................2
1.1.2 人体工程学和舒适度原理 .................................3
1.2 系统方案 ....................................................3
1.2.1 系统功能 ...............................................4
1.2.2 系统方案 ...............................................4
1.2.2.1 系统构架..........................................4
1.2.2.2 器件的选择........................................5
1.2.2.3 相关软件工具.....................................13
1.4 调试方案....................................................14
1.3 论文章节安排 ...............................................14
第 2 章 硬件的设计..................................................15
2.1 系统硬件的功能..............................................15
2.2 硬件总体设计 ...............................................16
2.3 硬件详细设计................................................17
2.3.1 单片机最小系统设计....................................17
2.3.1.2 时钟电路.........................................17
2.3.1.3 复位电路.........................................17
2.3.1.4 电源电路.........................................18
2.3.2 超声波模块电路 ........................................19
2.3.3 温度采集电路 ..........................................19
2.3.4 按键电路 ..............................................20
2.3.5 报警电路 ..............................................20
2.3.6 LCD1602 与单片机接口电路 ..............................21
2.4 系统整体原理图设计 .........................................22
西安工程大学本科毕业设计(论文)
2.5 系统整体 PCB 图设计 .........................................22
第 3 章 软件设计....................................................23
3.1 软件的功能 .................................................23
3.2 软件总体设计 ...............................................24
3.3 软件详细设计................................................25
3.3.1 主程序设计 ............................................25
3.3.2 超声波测距子程序设计 ..................................26
3.3.3 温度采集子程序设计 ....................................26
3.3.4 设置子程序设计 ........................................30
3.3.4.1 报警距离设置.....................................30
3.3.4.2 报警温度设置.....................................30
3.3.5 报警子程序设计 ........................................31
3.3.6 显示子程序设计 ........................................32
3.3.6.1 显示测量距离.....................................34
3.3.6.2 显示实时温度.....................................34
3.3.6.3 显示使用时间.....................................34
3.4 程序代码 ...................................................35
第 4 章 调 试.......................................................36
4.1 调试目的....................................................36
4.1.1 验证超声波测距功能 ....................................36
4.1.2 验证温度采集功能 ......................................36
4.1.3 验证显示功能 ..........................................36
4.1.4 整体调试 ..............................................37
4.2 调试方案....................................................37
4.2.1 验证单个超声波测距模块的工作状态 ......................37
4.2.2 单独验证温度采集的数据 ................................37
4.2.3 通过测距和温度采集验证显示功能 ........................37
4.2.4 整体调试 ..............................................37
4.3 调试过程与结果..............................................38
西安工程大学本科毕业设计(论文)
4.3.1 超声波测距调试 ........................................38
4.3.2 温度采集的调试 ........................................39
4.3.3 显示的调试 ............................................39
4.3.4 整个系统的调试 ........................................40
4.4 结果与分析 .................................................41
第 5 章 结论与展望..................................................43
5.1 结论........................................................43
5.2 展望........................................................43
参考文献...........................................................45
致 谢..............................................................47
附录...............................................................48
附录Ⅰ最小系统电路图 ...........................................49
附录Ⅱ最小系统 PCB 图 ...........................................50
附录Ⅲ超声波测距原理图 .........................................51
附录Ⅳ主程序 ...................................................52
附录Ⅴ温度采集子程序 ...........................................59
附录ⅥLCD 显示子程序............................................61
附录Ⅶ实物图 ...................................................63
剩余68页未读,继续阅读
资源评论
黑色的迷迭香
- 粉丝: 705
- 资源: 4万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功