文档介绍:基于单片机的温度控制系统设计与实现
——下位机系统
摘要
温度的测量与控制在工业生产和日常生活中应用广泛。本文介绍了一个基于单片机STC89C52的简单温度控制系统,该系统由上下位机两级组成,上位机采用PC机运行温度监控程序,对温度进行实时监控,同时设定下位机的控制参数,可实现对温度数据的存储管理。下位机由单片机构成温度现场采集与控制终端,负责现场温度的采集与控制。本文着重介绍了下位机系统的设计方案与软硬件实现。下位机系统采用8051单片机组成温度现场测控单元,使用DS18B20数字式温度传感器进行温度测量,温度的实时测量数据通过RS-232上传至上位机,进行实时监视,同时接收上位机的控制指令,通过继电器控制电加热丝的通断,实现对温度的控制。实验表明该系统能够实现对温度的控制,具有一定的控制精度。该系统测温电路简单、连接方便,可用于简单温度控制的场合。
关键词:单片机;温度控制;温度传感器;串口通讯
Based on a Temperature Control System Design and Implementation - Controller System
Abstract
The application about temperature measurement and control is normal in the area of industry and daily life. A simple temperature control system, based on the STC89C52 MCU,is introduced in this paper, which include puter and slave one. The host one, that is PC, runs temperature monitor software which monitors real-time temperature value, sets the control parameters to the slave, and save the data. The slave is temperature field collection and control posed by MCU, the digital temperature sensor, DS18B20, is used for the temperature measurement, the real-time data is transferred to the puter by RS-232 for the online monitoring, the control instruction downloaded from the host is used to control temperature by means of heating wire make-break controlled by relay. The experiment shows that the system can control the temperature with the better control precise. With the simplicity of the temperature measurement circuit and the convenient connection procedure, this system may be adaptable for the situations needed simple temperature control.
Keywords: MCU; Temperature control; Temperature sensor; munication
目录
1 绪论 1
温度控制系统的发展现状 1
课题的内容及要求 3
论文的内容及安排 4
2 温度控制系统总体方案设计 5
系统总体方案设计 5
硬件总体方案设计 5
软件总体方案设计 7
3 温度控制系统硬件系统设计 8
单片机最小系统设计 8
测温电路设计 10
DS18B20的介绍 10
测温电路设计 13
控温电路设计 14
电平转换及串口通信电路 15
电平转化电路 16
串口通信电路 16
4 温度控制系统的软件方案设计 19
初始化子程序设计 19
DS18B20测温子程序设计 19
串口通信子程序设计 22
控制部分子