Design of an intelligent temperature and humidity controller

Abstract: Introduces a design method and application of an intelligent temperature and humidity controller, which can achieve up to three-way temperature and humidity measurement and control; combined with RS485 bus technology and host computer software, data and status information can be remotely transmitted to meet low voltage distribution The demand for intelligent and networked development.
Keywords: SHT11, STC89C58RD +, temperature and humidity control, RS485

0 Introduction As the scale of the power system grows larger and the voltage level becomes higher and higher, the reliability of power supply is also stricter. The temperature and humidity of the power supply and distribution equipment environment are important factors that affect the operation of the equipment. Excessive temperature will accelerate the aging of instrument equipment components, shorten their service life, and even directly cause equipment damage; low temperature, humidity, and condensation on the surface of the equipment may cause accidents such as creepage and flashover.
Based on the above considerations, temperature and humidity control is very necessary in power supply and distribution equipment such as medium and high voltage switchgears, box transformers, and terminal boxes. This article will introduce a design method of WHD intelligent temperature and humidity controller, which can realize the measurement and control of up to three channels of temperature and humidity; combined with RS485 bus technology and host computer software, it can realize the remote transmission of data and status information to meet low voltage distribution The demand for intelligent and networked development.

1 Hardware circuit design
1.1 The general idea of ​​hardware design The hardware system takes the single chip microcomputer as the core, which can be divided into five parts according to functions: power supply, temperature and humidity measurement, control output, human-machine dialogue and communication, as shown in Figure 1.
The power supply circuit converts AC220V or other types of auxiliary power to the DC power required by the system. The single chip microcomputer compares and processes the temperature and humidity values ​​measured by the sensor, determines the working state of the relay of the output control part, and displays and sends the temperature and humidity values ​​and the working state information of the output control part. The man-machine dialogue part has the function of inputting key information. The user can set the working parameters of the system through key programming according to the actual situation.

1.2 The specific circuit and principle of hardware The core single-chip microcomputer uses STC's STC89C58RD + type single-chip microcomputer. It is an enhanced 8-bit machine compatible with 51 cores. It has rich on-chip resources and outstanding anti-interference ability. STC89C58RD + (D version) supports 6 clocks / machine cycles, contains 32K bytes of user program space, on-chip integrated 1280 bytes of RAM, 16K bytes of EEPROM space; supports ISP / IAP function, no special programmer is needed; on-chip also integrated Gate dog circuit and MAX810 dedicated reset circuit.
The measurement of temperature and humidity uses the digital temperature and humidity integrated sensor chip SHT11 developed by SENSIRION. The sensor can measure temperature and humidity at the same time, and provide the data output of the full calibration, so using this sensor can not only reduce the hardware cost, but also facilitate the whole machine test. The technical parameters are shown in the following table:

Temperature parameters:

parameter

condition

typical

unit

Resolution

 

0.01

℃

Accuracy

0 ~ 60

± 1

℃

Measuring range

 

-40 ~ 120

℃

Humidity parameters:

parameter

condition

typical

unit

Resolution

 

0.03

% RH

Accuracy

20% ~ 80%

± 3

% RH

Measuring range

 

0 ~ 100

% RH

The communication between the sensor and the CPU uses a two-wire system, namely DATA (data) line and CLK (synchronous clock pulse) line. When measuring three-way temperature and humidity, the connection circuit of CPU and sensor is shown in Figure 2. P1.0 and P1.1, P1.2 and P1.3, P1.4 and P1.5 in the CPU general-purpose I / O port are connected to the three-way temperature and humidity sensor SHT11, of which P1.0, P1.2, P1 .4 as the DATA (data) line of each communication, P1.1, P1.3, P1.5 as the CLK (synchronous clock) line of each communication, DATA line needs to add 10KΩ pull-up resistor to increase the signal High level (please refer to SHT11 data sheet for details). In actual use, the sensor and the controller (that is, the dotted line in the figure) are connected with a shielded wire. It has been verified that the maximum communication distance between the CPU and the sensor is 10 meters. If you use 74HC245 or other chips to improve the drive capability of the I / O port, you can increase the communication distance, but it will reduce the anti-interference performance of the system, so it is not adopted.

The system uses LED digital tubes to display temperature and humidity values, and the interface is simple and clear. The temperature and humidity values ​​measured by the three-way sensor are displayed sequentially in a cyclic manner. The display part has a total of 7 digital tubes, of which 4 are used to display the temperature value (display range: -40.0 ~ 100.0), and the menu and For parameters, 2 digits are used to display the humidity value (display range: 0 to 99), and 1 digit is used to display the number of the sensor currently displayed or operated (1 to 3). The digital tube display adopts dynamic scanning mode, and its driving circuit is composed of integrated circuits 74HC595 and 74HC164. 74HC595 is an 8-bit serial input, parallel output (or serial output) shift register with output door lock function for segment drive of the digital tube; 74HC164 serial input and parallel output functions are used for scanning Display each nixie tube, as shown in Figure 3.
The system uses a relay or thyristor as the control output, the power supply part uses a switching power supply scheme, and the communication part uses an RS485 interface. For specific circuit design, please refer to related books, which will not be repeated here.

2 Software design method System software design includes the following four parts: main program, measurement control module, display module and communication module.
The main program completes functions such as power-on or reset initialization, resetting the watchdog, and querying key information. The program design flow is shown in Figure 4.

Program initialization includes configuring the SFR of the CPU, setting the initial state of the I / O port, reading operating parameters from the EEPROM, and setting the reset time of the watchdog timer. It should be noted that generally only the dog is fed in the main program, and the reset time of the watchdog should be set longer than the longest waiting time that may occur in the measurement program. The following is part of the C language source code of the main program.
void Main ()
{
WDT_CONTR = 0x00; // Close the watchdog
InitialEeprom (); // Read EEPROM
InitialIO (); // Initialize I / O state
InitialSFR (); // Set SFR
InitialSHT11 (); // Initialize the sensor
InitialComm (); // Initialize the communication port
WDT_CONTR = 0x35; // Feed the dog for 1.25 seconds
while (1)
{
WDT_CONTR = 0x35;
KeyScan (); // Key query KeyProcess (); // Key information processing}
}
Communication transceiver processing, display, and temperature and humidity measurement control are all implemented in an interrupted manner. The priority order is: serial communication interruption (highest) → display interruption → measurement control interruption (lowest).
The system communication adopts the standard MODBUS-RTU protocol, which is convenient for the design of the host computer management software, and can be used in networking with other network instruments to achieve complete monitoring of the power supply and distribution system.

3 The product is applied in the power supply and distribution environment for temperature and humidity control, and the scheme shown in Figure 5 is generally adopted.

Collect temperature and humidity information in the switchgear or box-type substation through the temperature and humidity sensor, output the relay contact signal (opened or turned on) after being processed by the controller, and then connect the contact signal to the temperature and humidity adjustment equipment Heater or fan) in the power supply circuit to control its operation or stop to achieve intelligent control of temperature and humidity.
The general technical indicators of WHD intelligent temperature and humidity controller are as follows:

technical parameter

index

controlled object

1 ~ 3 road temperature and humidity

Features

Warm up

Setting range: -10 ℃ ~ 10 ℃

Cool down

Setting range: 30 ℃ ~ 45 ℃

Dehumidification

Setting range: 75% ~ 90%

Output

Contact

Quantity

Each group of temperature and humidity corresponds to 2 contacts

capacity

250V / 5A

communication

interface

RS485

protocol

Standard MODBUS-RTU

Baud rate

1200, 2400, 4800, 9600, 19200

Auxiliary power

AC / DC220V, allow 85 ~ 270V

This type of temperature and humidity controller can control one, two or three channels of temperature and humidity. Each channel of temperature and humidity sensor corresponds to a set of (two) relay output contacts, one of which is used to control the heater to achieve heating or dehumidification control. , Another contact is used to control the fan to achieve exhaust control. When the sensor or heater fails, the controller will issue an alarm signal.
The hysteresis of temperature and humidity control can also be set in the controller, that is, the difference between the start condition and the stop condition of the adjustment device. As shown in Figure 6, taking heating as an example, when the ambient temperature drops below the preset "heating start temperature", the controller outputs the contact conduction signal, the heater works, and the ambient temperature gradually rises; when the ambient temperature rises to When the "heating stop temperature" is above, the controller outputs a contact opening signal and the heater stops heating. According to experience, the hysteresis is generally set within the range of 4 ~ 10 (℃ or RH%).

Aluminum alloy heaters are the most commonly used temperature and humidity adjustment equipment in power supply and distribution systems. The following is the relationship between the size of the environmental space and the heater power selection summarized by experience for readers' reference.

Environmental space size (m3)

Heater power (W)

≤0.5

50 ~ 75

0.5 ~ 1

100 ~ 150

1 ~ 1.5

Around 200

1.5 ~ 2

Around 250

2 or more

300 or greater

WHD intelligent temperature and humidity controller can remotely transmit the measured temperature and humidity values ​​and various status information in the control system to the host computer through the RS485 communication interface. Development requirements.

4 Conclusion This paper introduces the design method and application of an intelligent temperature and humidity controller, which can achieve the maximum three-way temperature and humidity collection and control, and has programming parameter settings and RS485 (MODBUS-RTU) communication function. It has been verified by practice that the WHD series products designed according to this method are easy for users to use in practical applications, and the temperature and humidity control effects are remarkable. At the same time, the product's anti-electromagnetic interference performance is outstanding, for example, the 5kHz and 100kHz frequency band anti-burst interference can reach three levels, suitable for use in electrical equipment with relatively harsh electromagnetic environments.

The article comes from: "Electrical Technology", 2006, Issue 10.

references
[1] Digital temperature and humidity sensor SHT1X / SHT7X application guide, Swiss SENSIRION company, 2005
[2] STC89C51RC / RD + series single chip microcomputer manual, Hongjing Technology, 2006
[3] Dai Jia, Dai Weiheng 51 single chip C language application programming, 2006

About the Author:

Yu Jing, female, undergraduate, engineer of Wuhan Ankerui Electric Co., Ltd., the main research direction is intelligent power monitoring and power management system

Linear Stepper Motor

Linear Stepper Motor,Linear Actuator Motor,Nema Stepper Motor,Linear Drive Motor

Changzhou Sherry International Trading Co., Ltd. , https://www.sherry-motor.com

Posted on