南京工程学院
康尼学院
本科毕业设计(论文)
题 目 : 家电热水器控制系统设计
专 业: 自动化(数控技术)
班 级: 数控 XX 学 号:XXXXXXXX
学生姓名: XXX
指导教师: XXX 实验师
起迄日期: XXXXXXXXXXXXX
设计地点: 实 验 楼 _
Graduation Design (Thesis)
Design of Microwave Oven Operating System
By
XXXXX
Supervised by
ExperimentalistXXXX
School of Automation
Nanjing Institute of Technology
June, 2014
南京工程学院康尼学院毕业设计(论文)
I
摘 要
随着社会的发展,人类科技的进步,各行各业都在使自己的产品智能化、数
字化,因老式的热水器使用煤气或天然气对水进行燃烧加热,用手动的方式调节
温度,不仅不能够精确的确定使用者需要的水温,而且还存在一定的危险性。
电热水器是一种可供浴室、洗手间及厨房使用的家用电器,随着人们生活质
量的提高,现代的家用电热水器已经摒弃了以前的做法,而采用一种更加精确、
安全的实施方案。
C 语言对单片机编程有诸多优点,例如:便于移植、句法检查时错误少、坚
固性好、头文件种类诸多,能够方便快捷使用各种函数等。
本文采用 AT89S52 单片机作为控制器,使用 C 语言编写程序,设计了一款智
能家用电热水器。使用按键键盘输入温度,温度可以精确到 0.1 摄氏度,并使用
LED 灯显示,能够提供用户所需温度的温水。采用 DS18B20 采集温度,使用 LED
灯显示,显示出采集的水温。当所需温度高于当前采集的水温时,触发加热,当
水温达到设定温度时,则停止加热。基本实现了智能控制功能。
关键词:单片机;C 语言;采集;家用电热水器
南京工程学院康尼学院毕业设计(论文)
II
Abstract
With the development of social and program of human technology, every trade
all transfer own product into intelligence, digitize, because the water heater of old
style uses gas or natural gas to heat water and manually adjust mode conditioning
temperature, not only unable to sufficiently accurately recognize the user need of
water temperature, but also exist some certain risk.
The electrical water heater is a kind of home appliances that bathroom, loo and
kitchen can use, with raising of quality of human live, the modernistic household
electrical water heater has abandonned the past way, but adopts a kind of
implementation scheme of more accurate ,safety.
C language possess many merits for programming of singlechip, such as:Is easy
to ransplant, having little bug when sentence construction review, fastness good, the
head document type is so many that expediently quickly using various function etc.
The writer adopts an AT89S52 singlechip to be the controller and using C
languages to write programming ,design a style of intelligence household electrical
water heater.Use array form keyboard input temperature, the temperature can be
accuratly recognized to 0.1 ℃, and use LED light display it, can provide to the warm
water of temperature that user needs.Adopt DS18B20 to collect temperature, use LED
light display, the accurately displays to collect water temperature.When the
temperature needed higher than to collect water temperature at present, lead to
heating , when the temperature needed is lower than the collect water temperature at
present, stop heating.The simply carry out intelligence control function.
Key Words: singlechip; C language; collect; household electric water heater
南京工程学院康尼学院本科毕业设计(论文)
III
目录
摘 要 .............................................................................................................I
ABSTRACT ....................................................................................................II
第一章 绪 论...................................................................................................1
1.1 引言..............................................................................................................................1
1.2 选题的背景及意义......................................................................................................1
1.3 国内外研究状况和成果..............................................................................................2
1.4 整体设计方案 ..............................................................................................................3
第二章 系统硬件设计.....................................................................................4
2.1 单片机的最小系统 ......................................................................................................4
2.1.1 AT89S52 单片机 ..............................................................................................4
2.1.2 AT89S52 定时器/计数器 ................................................................................7
2.1.3 复位电路和晶振电路........................................................................................8
2.2 温度检测电路 ..............................................................................................................9
2.2.1 数字式温度传感器 DS18B20 .........................................................................10
2.2.2 DS18B20 的初始化与读写操作 ....................................................................12
2.2.3 DS18B20 的指令 .............................................................................................14
2.3 键盘接口电路设计 ....................................................................................................15
2.4 数码管 ........................................................................................................................16
2.4.1 数码管简介......................................................................................................16
2.4.2 数码管的显示.................................................................................................17
2.5 继电器电路 ................................................................................................................19
2.6 电源电路....................................................................................................................19
第三章 系统软件设计...................................................................................21
3.1 PROTEUS(ISIS)和 KEIL 简介 .................................................................................21
3.2 程序设计 ....................................................................................................................21
3.2.1 主程序的流程图..............................................................................................23
3.2.2 读温度子程序的流程图..................................................................................24
3.2.3 电加热继电器控制子程序流程图..................................................................25