本科毕业论文(设计)
论 文 题 目 :
姓
学
班
年
专
系
名 :
号 :
级 :
级 :
业 :
部 :
指 导 教 师 :
完 成 时 间 :
武汉工业学院工商学院毕业论文(设计)专用稿纸
作者声明
本毕业论文(设计)是在导师的指导下由本人独立撰写完成的,
没有剽窃、抄袭、造假等违反道德、学术规范和其他侵权行为。对本
论文(设计)的研究做出重要贡献的个人和集体,均已在文中以明确
方式标明。因本毕业论文(设计)引起的法律结果完全由本人承担。
特此声明。
作者专业 :
作者学号 :
作者签名 :
年 月 日
武汉工业学院工商学院毕业论文(设计)专用稿纸
基于单片机的水温水位控制系统
Water Temperature-Level Control System
Based on SCM
武汉工业学院工商学院毕业论文(设计)专用稿纸
摘
要
可编程控制器单片机、PLC 等的出现大大提高了现代工业的自动化程度,改
善了产品的工作性能。本次设计是对水温水位控制系统的智能化改进,采用单片
机对其水温水位参数进行控制,提高了电器的工作稳定性,同时引进了数字传感
器对水温进行数据采集,这样也就提高了系统的控制精度,对水位的控制结构简
单,易于实现,具有很强的现实应用价值。
本设计温度传感器采用 DS18B20,DS18B20 是美国 Dallas 公司生产的一线
数字式温度计芯片,现在已完全取代 DS1820。它具有结构简单,不需要外接元件,
采用一根 I/O 数据线既可以供电又可以传输数据、并可以设有用户设置温度报警
界限等特点。此次设计主控制器采用 Philips 公司生产的 P89V51RD2 单片机,
P89V51RD2 是常用的机型,功能强大,性能稳定。该产品可以广泛应用于各种
环境,例如:铁路路基温度无线采集系统、水温实时检测系统、楼宇内温度监视
系统等。
虽然是对水温水位控制系统的改进,但是这种智能化的改进方法也可以应用
到工业、生活的各个水温和水位控制的环境中去,对于其他相关参数的控制改进
也具有一定的借鉴意义。此次的基于单片机的水温水位控制系统是一个改进性的
智能化产品,以其自身的控制精度高、稳定性好和成本低的独特优点在今后将会
由广泛的实用价值,其基于单片机的改进方法也具用广泛的应用意义。
关键词:单片机;DS18B20;水温水位控制
- 1 -
武汉工业学院工商学院毕业论文(设计)专用稿纸
Abstract
The appearance of BP PLC and PLC has greatly increased the modern industrial
automation and improved the work performance of the product. The design of the
water temperature control system is to improve the intellectualized. A monolithic
integrated circuits is to control the level of parameter and improve the stability of the
electrical work, and meantime, it
introduced a number of the water temperature
sensor for data collection, it also increases the control system to control the level of
accuracy with a simple structure, which is easy to achieve and has great practical
value.
The design temperature sensors used DS18B20 which is a digital thermometer chip
produced by the Dallas company and now completely replaced DS1820. It’s simple
and doesn’t need the components. Just use a piece of I/O data line can not only supply
the power, but the data transmission. Moreover, it has a user setting, you can use it to
set the alarm boundaries. The design of master controller used the Philips company’s
P89V51RD2 monolithic integrated circuits, which is the usual type. It has a powerful
function and reliable performance. It can be widely used in various circumstances.
Such as, railway system, the temperature of real-time testing system, the premises of
the surveillance system and so on.
Though it
is a way to improve the water temperature control system,
the
intellectualized ways of improvement can also be applied to industrial, water and the
level control of the environment. For other related parameters, it also has a certain
meaning using. The revivification of the water control system is an intelligent product.
To its own control of high precision, stability and low cost of the advantages, in the
future there will be a wide range of practical value. What’s more, its based on single
ways of improvement have wide application meaning.
Keywords: singlechip; water level’s examination; water temperature’s examination
- 2 -
武汉工业学院工商学院毕业论文(设计)专用稿纸
目
录
引 论.........................................................................................................1
1 系统设计方案讨论与选择.................................................................... 2
1.1 系统设计方案的选择......................................................................................2
1.2 总体系统设计方框图......................................................................................2
1.3 温度控制系统的设计方案讨论......................................................................3
1.4 水位控制系统的设计方案讨论......................................................................3
1.5 数据显示系统的设计方案讨论......................................................................3
1.6 报警系统的设计方案讨论..............................................................................4
2 系统工作原理.........................................................................................5
2.1 水温控制系统..................................................................................................5
2.2 水位控制系统..................................................................................................5
2.3 水温水位显示系统..........................................................................................5
2.4 报警系统..........................................................................................................5
3 系统单元电路设计.................................................................................6
3.1 单片机最小系统..............................................................................................6
3.2 显示系统设计..................................................................................................9
3.3 水位检测系统设计........................................................................................12
3.4 水温检测系统设计........................................................................................13
3.5 报警系统设计................................................................................................17
3.6 继电器驱动电路设计....................................................................................17
3.7 电源电路........................................................................................................18
4 系统软件设计.......................................................................................19
4.1 系统硬件开机自检程序设计........................................................................19
4.2 系统自动上水程序设计................................................................................20
4.3 水温水位交替显示流程图设计....................................................................21
4.4 系统按键程序设计........................................................................................22
5 系统可靠性处理...................................................................................23
5.1 硬件调试........................................................................................................23
5.2 软件调试........................................................................................................24
结 语.......................................................................................................25
- 3 -
武汉工业学院工商学院毕业论文(设计)专用稿纸
主要参考文献...........................................................................................26
附录、附图...............................................................................................27
附录 1 系统原理图..............................................................................................27
附录 2 基于单片机的水温水位控制系统说明..................................................28
附录 3 部分源程序清单......................................................................................29
- 4 -
武汉工业学院工商学院毕业论文(设计)专用稿纸
引
论
随着电子技术的发展,特别是随着大规模集成电路的产生,给人们的生活
带来了根本性的变化,如果说微型计算机的出现使现代的科学研究得到了质的飞
跃,那么可编程控制器的出现则是给现代工业控制测控领域带来了一次新的革
命。在现代社会中,水位和温度控制不仅应用在工厂生产方面,其作用也体现到
了生活的各个方面。
随着人们生活质量的提高,酒店厂房及家庭生活中都会见到水位和温度控
制的影子,水位和温度控制将更好的服务于社会目前,单片机控制器在从生活工
具到工业应用的各个领域,例如生活工具的电梯、工业生产中的现场控制仪表、
数控机床等。尤其是用单片机控制器改造落后的设备具有性价比高、提高设备的
使用寿命、提高设备的自动化程度的特点。
现代工业设计、工程建设及日常生活中常常需要用到水位和温度控制,早期
水位和温度控制主要应用于工厂中,例如工厂中的大型锅炉,必须实时的掌握锅
炉的水位和温度,确保系统的正常运行。
因此,水温水位控制在改善人们生活质量中起到了非常重要的作用。现在市
面上的电器种类繁多,它们都需要对其主要的水位和水温参数加以控制,实现电
器水温水位控制的自动化。
早期温度和水位的参数控制时通过模拟电路实现的,这种方式不仅电路复
杂,成本高,而且误差大,系统的稳定性不好,单片机及微型计算机技术的发展
和应用有效地解决了这些缺点,特别是传感器的发展,更好的提高了检测参数的
精度。
选择基于单片机的水温水位控制系统,是因为它不仅在人们生活中具有显著
的意义,更重要的是能系统地聚温度和水位参数于一身,对于更好的掌握和认识
单片机的应用和传感器的应用,系统地深刻认识自动控制的实际应用,掌握复杂
的多子系统地设计起到了很强的锻炼作用。
- 1 -