攀枝花学院本科毕业设计(论文)
基于AT89S52太阳能热 水器控制系统的设计
学生姓名: 刘 欢 学生学号: 201010501040 院(系): 电气信息工程学院 年级专业: 电子信息工程 指导教师: 伍刚 教授 助理指导教师:
二〇一四年六月
攀枝花学院本科毕业设计(论文) 摘要
摘 要
本设计以
AT89S52单片机作为控制核心并协调整个系统的工作,通过
DS18B20传感器检测当前水的温度,通过单片机的处理在LED数码管上显示当前的温度值告知用户,用户通过显示的温度值可以控制电磁开关进行加热或上水以便达到舒适的水温。该系统同时还能对水位进行实时监控,水位的当前值通过数码管显示,当水位为零时,系统会自动开启上水的电磁开关,当水位高于100时,系统会自动关闭上水电磁开关。
关键词 AT89S52单片机,LED,温度控制,水位控制,电磁开关
I
攀枝花学院本科毕业设计(论文) ABSTRACT
ABSTRACT
This design mostly AT89S52 microcontroller core as a control and coordinate the work for the entire system,The DS18B20 sensor to detect the current water temperature,SCM through the processing in the LED digital tube display the current temperature inform users,The user through the display of the temperature value can control the electromagnetic switch heating or water to achieve a comfortable temperature.The system can real-time monitoring of water level, the value level through the digital tube display, when the water level is zero, the electromagnetic switch system will automatically open water, when the water level is higher than 100, the system will automatically shut down the water electromagnetic switch.
Key words AT89S52 MCU, LED, temperature control, water level control, electromagnetic switch
II
攀枝花学院本科毕业设计(论文) 目录
目 录
摘 要 ................................................................................................................................. I ABSTRACT ........................................................................................................................................... II
1 绪论 .............................................................................................................................................. 1
1.1 课题背景 .............................................................................................................................. 1 1.2 课题研究意义 ...................................................................................................................... 1 1.3 国内外研究水平 .................................................................................................................. 1 1.4 本课题发展趋势 .................................................................................................................. 2
2 方案的分析与选择 ................................................................................................................... 4
2.1 方案的分析 .......................................................................................................................... 4
2.1.1方案一........................................................................................................................ 4 2.1.2方案二........................................................................................................................ 5 2.2 方案的选择 .......................................................................................................................... 5
3 硬件设计 ..................................................................................................................................... 7
3.1 系统总体硬件框图与工作原理 .......................................................................................... 7 3.2 温度传感器 .......................................................................................................................... 7 3.3 电磁继电器 ........................................................................................................................ 13 3.4 单片机控制系统 ................................................................................................................ 14
3.4.1 AT89S52的主要性能 .............................................................................................. 15 3.4.2 AT89S52的引脚说明 .............................................................................................. 16 3.5 LED显示 ............................................................................................................................. 18 3.6 按键电路设计 .................................................................................................................... 19
4 软件设计 ................................................................................................................................... 21
4.1 软件设计架构 .................................................................................................................... 21 4.2 主控程序 ............................................................................................................................ 23 4.3 应用程序 ............................................................................................................................ 23
4.3.1 DS18B20的驱动设计 .............................................................................................. 23 4.3.2 按键控制的软件设计 ............................................................................................. 26 4.3.3 LED显示程序的设计 ............................................................................................ 28
5 电路仿真 ................................................................................................................................... 30
5.1 keil的使用 ....................................................................................................................... 30
1
攀枝花学院本科毕业设计(论文) 目录
5.2 proteus的仿真 ................................................................................................................. 34 5.3 系统的仿真 ........................................................................................................................ 35 5.4 仿真结果的分析 ................................................................................................................ 38 5.5 PCB的制作 ......................................................................................................................... 38
6 系统的调试 ................................................................................................................................. 39
6.1 硬件的调试 ........................................................................................................................ 39 6.2 硬件的调试 ........................................................................................................................ 40
结 论 ................................................................................................................................................. 41 参考文献 .......................................................................................................................................... 42 附录A:系统原理图 .................................................................................................................... 43 附录B:系统程序 ......................................................................................................................... 46 致 谢 ................................................................................................................................................. 54
2