摘 要
本课题设计的是一套计算机控制的温度、湿度实时监测与报警系统,可应用于多种需要采集温湿度数据的场合,本文完成了整个系统的软硬件设计。
系统采用单总线传感器网络和 RS485 传输网络的设计思想。其中温度、湿度传感器都以智能终端的形式挂接到单总线上,多条单总线汇总到一起,由一台数据采集器集中控制,每台数据采集器负责一定区域内的温湿度监测。数据采集器的核心部件为单片机,主要完成对其所连接传感器件的测量与控制以及与主机的通信等功能。各采集器以网络结点的方式挂接到 RS485 传输网络上,传输距离远,还可有效的抑制共模干扰。设计中的 RS232/RS458 转换器用来实现 RS485 总线网络与主机 RS232 串口通信的相互转换。系统中为主机与各采集器之间的数据通信制定了完备的通信协议,采用主机调度工作形式,CRC 技术校验数据,以保证通信的可靠性。用 Delphi 开发了具有温湿度数据显示、告警、历史数据和曲线显示与打印等功能的主机用户管理软件。
关键词: 单总线, 单片机, 循环冗余码校验, 通信协议
Abstract
This paper introduces a kind of real-time monitoring system for temperature and humidity controlled by computer, which is can be used for many applications. The paper completes both the software and hardware design.
The system adopts 1- Wire sensor net and RS485 transmission net technique. Many sensors are connected to 1- Wire bus as intelligent terminals. The data collection station gathers all buses. Each data collector is responsible for a region. The kernel of data collector is MCU, which takes charge of measurement, control and communication with the host controller. The RS485 transmission net is made up of the data collection station, which can transmit for remote distance and restrain common mode interference. The RS232/RS485 converter is used for conversion between RS485 and RS232, which is used by the host controller, computer. A self-contained serial communication protocol is defined, which can help the host controller communicate with the data collector. The host controller works as a dispatcher. CRC technology is adopted to verify data and guarantee the dependability in the communication. The Delphi is used to design the user interface for display and monitoring of temperature and humidity information, showing and printing for historical records and curves etc.
Key words: 1- Wire, MCU, CRC, Communication Protocol
目 录
摘 要I
AbstractII
1 绪论1
1.1 课题研究的目的和意义1
1.2 温度、湿度数据采集与监测技术的发展历程1
1.3 本课题的主要特点2
2 系统的总体设计3
2.1 系统功能3
2.2 系统主要技术指标3
2.3 系统的总体结构4
2.4 系统的工作过程5
3 单总线与温度、湿度传感器6
3.1 温