1、 2015 届 本 科 毕 业 设 计 题目:题目: 基于单片机的温度控制系统基于单片机的温度控制系统 Title: Temperature control system based on MCU 院系名称院系名称:物理与通信电子学院物理与通信电子学院 学生姓名学生姓名: 学生学号学生学号: 专专 业业: 电子信息工程电子信息工程 指导老师指导老师: 完成时间完成时间: 20152015 年年 4 4 月月 I 摘要 本文主要介绍了基于单片机的温度控制系统的工作原理、 硬件电路的设计和 软件设计。该温度控制系统由单片机核心处理模块、温度采集模块、控制执行模 块,LCD 显示模块组成。能够完成温
2、度的设定、采集、显示、控制等功能。 关键词:温度控制,单片机,PID II Abstract This paper is specification of a design of temperature control system based on the single-chip, mainly introduced the work principle of temperature control system, the design of the hardware circuit and the C51 software design . The temperature control
3、system is composed of a single-chip microcomputer core processing module, a temperature acquisition module, a keyboard input module, LCD module, control module, serial communication module . It can realize the temperature acquisition ,setting, display , control and other functions. Key words: temper
4、ature control, MCU, PID 1 目录目录 摘要摘要 I I AbstractAbstract IIII 1 1 引言引言 2 2 2 2 设计要求设计要求 2 2 3 3 方案论证方案论证 2 2 3.1 3.1 方案论证与比较方案论证与比较 3 3 3.2 3.2 核心处理模块的方案核心处理模块的方案 3 3 3.33.3 温度采集模块的方案温度采集模块的方案 4 4 3.43.4 控制执行的方案控制执行的方案 4 4 3.5 3.5 显示模块显示模块 4 4 4 4 系统设计系统设计 5 5 4.14.1 单片机模块单片机模块 5 5 4.14.1.1.1 复位电路的设
5、计复位电路的设计 5 5 4.1.2 4.1.2 时钟电路设计时钟电路设计 5 5 4.1.34.1.3 单片机的单片机的 I/OI/O 口的分配口的分配 6 6 4.2 LCD 16024.2 LCD 1602 显示模块显示模块 6 6 4.2.1 16024.2.1 1602 接口信号说明接口信号说明 8 8 4.2.2 16024.2.2 1602 操作时序操作时序 8 8 4.3 DS18B204.3 DS18B20 温度采集模块的设计温度采集模块的设计 9 9 4.3.1 DS18B204.3.1 DS18B20 的分辨率的分辨率 1010 4.3.2 DS18B204.3.2 DS
6、18B20 工作时序图工作时序图 1010 4.44.4 控制执行模块控制执行模块 1111 4.54.5 加热模块加热模块 1212 4.6 PID4.6 PID 控制算法控制算法 1212 4.7 4.7 增量式增量式 PIDPID 算法的参数确定算法的参数确定 1313 5 5 软件设计软件设计 1414 5.1 5.1 主程序流程图主程序流程图 1414 5.25.2 子程序设计子程序设计 1515 5.2.15.2.1 温度采集模块子程序温度采集模块子程序 1515 5.2.2 LCD5.2.2 LCD 显示程序显示程序 1616 6 6 实测结果实测结果 1616 7 7 总结总结 1919 参考文献参考文献 2020 附录一:电路图附录一:电路图 2121 附录二:源程序附录二:源程序