摘要:本文针对现在浴缸水温经常有过热和过凉的情况,以及水位经常有过高和不足的现状提出了一个基于单片机的浴缸水位温度控制系统。此系统以单片机作为核心控制,通过DS18B20采集水温,LCD12864显示温度,水位检测电路检测水位,语音进行提示加水或排水,然后将水位控制在适宜的范围,温度和温度上下限的比较进行加热水或者冷水将水温控制在自己设定的温度。在文中提出了这个水位温度控制系统的整体设计方案,对各个模块的设计方案进行了论证,完成了硬件和软件的设计。
关键词:89S52单片机,DS18B20传感器,温度控制,水位控制
I
Bath crock water level and temperature control
system that based on MCU
Abstract:In this paper according to the situation that the bath crock water temperature there are often too hot and too cold,water level often too high or too low put forward the water level and temperature system that based on MCU.This system with the MCU as the core control,through DS18B20 collecting temperature environment LCD12864 display temperature,water level detection circuit detection water level voice prompt add water or drainage ,control Water level in the appropriate range ,temperature and the temperature of upper and lower compared to heat water or cold water to set the temperature control in the purpose of setting the temperature of the himself.In this paper puts forward the overall design scheme of water level and temperature control system,demonstrates the design of each module, completed the design of the hardware and software.
Keywords: 89s52 micro computer,DS18B20 sensors,temperature control,water level control
II
目录
第一章 绪 论 ................................................................................................................................... 1
1.1 选题的意义与目的 ............................................................................................................ 1 1.2 研究现状与发展趋势 ........................................................................................................ 1 1.3 本文的主要工作 ................................................................................................................ 3 第二章 系统方案论证和硬件概述 ................................................................................................. 4
2.1 系统方案设计与论证 ........................................................................................................ 4 2.2 AT89S52单片机概述 ......................................................................................................... 5 2.3 DS18B20传感器概述 ........................................................................................................ 6 2.4 其它硬件概述 .................................................................................................................... 6 第三章 系统硬件设计 ..................................................................................................................... 7
3.1系统硬件的整体框图 ......................................................................................................... 7 3.2 系统子模块设计 ................................................................................................................ 7
3.2.1温度采集电路 .......................................................................................................... 7 3.2.2 键盘电路 ................................................................................................................. 8 3.2.3 显示电路 ................................................................................................................. 9 3.2.4 水位检测电路 ......................................................................................................... 9 3.2.5 水位控制电路 ....................................................................................................... 10 3.2.6 水温控制电路 ....................................................................................................... 10 3.2.7 单片机最小系统 ................................................................................................... 11 3.2.8 语音电路 ............................................................................................................... 11
第四章 系统软件设计 ................................................................................................................... 13
4.1 主程序流程图 .................................................................................................................. 13 4.2 键盘扫描流程图 .............................................................................................................. 13 4.3 显示处理流程图 .............................................................................................................. 14 4.4 水位温度控制流程图 ...................................................................................................... 15 4.5温度采集电路流程图 ....................................................................................................... 15 4.6液晶显示流程图 ............................................................................................................... 16 4.7系统调试 ........................................................................................................................... 16 第五章 总结及实验结果 ............................................................................................................... 17
5.1设计总结 ........................................................................................................................... 17 5.2 实验结果 .......................................................................................................................... 17 参考文献......................................................................................................................................... 18 结束语 ............................................................................................................................................ 19 致谢 ................................................................................................................................................ 20 附录 ................................................................................................................................................ 21
III