基于单片机和组态王的温度控制系统设计 毕业设计 联系客服

发布时间 : 星期日 文章基于单片机和组态王的温度控制系统设计 毕业设计更新完毕开始阅读4b48f8bf8ad63186bceb19e8b8f67c1cfbd6ee59

河南理工大学毕业设计(论文)说明书

摘 要

在工、农业生产和日常生活中,各个环节都与温度紧密相连,温度的测量及控制占有极其重要的地位。温度已成为大多数仪器正常工作的前提,而且对温度的要求也越来越严格。因此,温度检测与控制方法的研究也越来越受到人们的重视。

本文介绍的温度控制系统为两层结构,上位机由组态软件完成对下位机的监控。下位机利用数字温度传感器DS18B20,结合单片机组成传感器网络,设计了相关硬件和软件,实现多点温度测量和控制。论文中介绍了DS18B20进行循环温度检测的方法和采用增量式PID控制算法和PWM调功方式,通过控制固态继电器在一定周期内的通断占空比,最终实现对电烤箱的温度控制。其中控制范围为室温到120℃,误差小于0.5℃。上位机PC与单片机之间通过RS232串口实现数据交换,又组态软件King View具有强大的数据采集、处理功能和友好的人机界面,故基于单片机和组态王的温度控制系统,可以理想地实现对相关设备的实时监控。

此系统具有成本低、可靠性高、使用方便等特点,可广泛用于仓库测温、楼宇空调温度控制、生产过程监控等。

关键词: AT89S52;DS18B20;温度控制;组态王;RS232

河南理工大学毕业设计(论文)说明书

Abstract

In industrial and agricultural production and daily life,all sectors are closely related to temperature.Temperature Measurement and Control occupy a very important position. At present,temperature measurement and control equipment has become normal working majority of the premise that and the temperature requirements more stringent. Therefore,the temperature measurement and control method of attracting increasing attention.

The paper introduces a temperature control system,the detection and control of the controlled objects are accomplished by slave computers,and the supervision of the controlled objects and slave computers is implemented in the host computer based on King View.DS18B20 and Microprocessor AT89S52 build up sensor networks,which achieve the design of hardware and software for multiple spots temperature detected and control system.The Paper describes the DS18B20 temperature measurement method and application of incremental PID loop control algorithm and mode of PWM power by controlling the solid state relay must cycle on/off duty cycle, and ultimately to electric oven temperature control.The entire temperature detected and control system is capable of detecting and controlling multiple-point temperature for accurate measurement,the controlling range from the room temperature to 120℃,control error is less than 0.5℃.The communication between PC and microprocessor based on RS2332 is described in detail in the paper.King View software supports a powerful platform for real time detection project.It supports powerful function for data acquisition and management and man-machine interface.The state detection for temperature detected and control system based on Microprocessor and King View software is designed to detect the devices and make sure the devices work in a reliable,effective and secure way.

With low cost,high reliability and convenience of operators,the system can be used in many fields such as the temperature measurement system of warehouse,the air conditioning control of building and the monitor of productive process.

Keywords: AT89S52; DS18B20; Temperature control; King View; RS232

河南理工大学毕业设计(论文)说明书

目录

1 绪论 .................................................................. 1 1.1课题背景及现状 ...................................................... 1 1.1.1温度测量方面 ..................................................... 1 1.1.2温度控制方面 ..................................................... 2 1.2研究意义 ............................................................ 2 1.3课题要求 ............................................................ 3 2 方案论证与主要器件选型 ................................................ 4 2.1方案比较与选择 ...................................................... 4 2.1.1温度测量方案选择 ................................................. 4 2.1.2温度控制方案的选择 ............................................... 5 2.2主要器件的选择 ...................................................... 6 2.2.1传感器 ........................................................... 6 2.2.2主控元件 ......................................................... 8 2.2.3显示器件 ......................................................... 9 2.2.4控制模块 ......................................................... 9 2.2.5通信模块 ........................................................ 11 2.3上位机组态监控 ..................................................... 12 2.4系统总体设计框图 ................................................... 12 3 系统硬件电路设计 ..................................................... 14 3.1系统硬件电路框图 ................................................... 14 3.2单片机最小系统设计 ................................................. 14 3.3多点测量电路设计 ................................................... 16 3.3.1.读序列号电路的设计 ............................................. 16 3.3.2.温度测量电路的设计 ............................................. 16 3.3.3 DS18B20使用中注意事项 .......................................... 18

河南理工大学毕业设计(论文)说明书

3.4显示和键盘电路设计 ................................................. 18 3.4.1显示和键盘电路图 ................................................ 18 3.4.2显示部分设计 .................................................... 19 3.4.3键盘电路设计 .................................................... 20 3.5控制模块电路设计 ................................................... 21 3.5.1控制执行电路 .................................................... 21 3.5.2报警电路 ........................................................ 21 3.6串口通讯电路 ....................................................... 22 4系统软件部分设计 ...................................................... 23 4.1软件总体设计 ....................................................... 23 4.2 DS18B20的测温程序 ................................................. 24 4.2.1 DS18B20常用指令 ................................................ 24 4.2.2 初始化子程序 ................................................... 24 4.2.3 读子程序 ....................................................... 25 4.2.4 写子程序 ....................................................... 25 4.3显示和键盘扫描程序 ................................................. 26 4.3.1显示扫描程序流程图 .............................................. 26 4.3.2键盘扫描程序流程图 .............................................. 26 4.4控制执行程序 ....................................................... 27 4.4.1控制思路及其流程图 .............................................. 27 4.4.2 PID控制算法 .................................................... 28 4.4.3 PID参数的整定 .................................................. 29 4.4.4 PWM波的设计 .................................................... 30 4.5通讯程序 ........................................................... 30 4.6组态王监控界面设计 ................................................. 34 5 系统调试 ............................................................. 36 5.1 硬件部分调试 ....................................................... 36 5.2 软件部分调试 ....................................................... 37

2