Shenzhen ZTRON Microelectronics Co., Ltd
Telephone
0755-8299 4126

MCU

Intelligent temperature and humidity control system


Intelligent Temperature and Humidity Control System Based on SCM Technology


In the field of measurement object, temperature and humidity are very important. Whether it is human survival or living environment, industrial and agricultural production, military, meteorological observation, temperature measurement and control, and humidity measurement and control are all very important links. With the advancement of computer technology, communication technology, electronic technology, sensor and sensor material technology, both temperature and humidity detection have achieved leapfrog development. It is also very meaningful to measure and monitor temperature and humidity.


Through the research on the characteristics of the intelligent temperature and humidity sensor, a reasonable hardware circuit is designed, and efficient processor software is written to display the temperature and humidity information, and then control the heating and ventilation device according to the temperature and humidity information. The temperature and humidity information is obtained by the sensitive element of the sensor, and its output is amplified, linearized, and interfered with by the signal conditioning circuit to obtain an analog signal compatible with the A/D converter, which is converted into a micro Processor accepts digital signals. The software and hardware processing circuit with the single-chip microcomputer as the core processes the collected signals and outputs them to the display module to reflect the temperature and humidity values in real time. The SHT11 produced by Swiss Sensiri-on company is a single-chip fully calibrated digital new relative temperature and humidity sensor with a two-wire serial interface. It integrates sensor technology with CMOS chip technology, and can be used to measure parameters such as zero point, relative temperature, and relative humidity. It has the characteristics of digital output, calibration-free, peripheral circuit-free, debugging-free, and full interchangeability. , High reliability, high integration temperature and humidity measurement and control system provides a solution.


1. Hardware design of intelligent temperature and humidity control system


1.1 Overall hardware design


This design takes the AT89C52 single-chip microcomputer system as the core. Firstly, the temperature and humidity data of the scene are collected through the SHT11 temperature and humidity sensor, and then converted into digital codes through the A/D converter of the SHT11 temperature and humidity sensor itself; Set the upper and lower limits at the same time for the temperature and humidity value; when the current temperature and humidity exceed the preset upper limit, the alarm will be activated and the light will be on, and the heating and ventilation device will be activated at the same time; gas unit works. Different limit values can be set according to different requirements so that its wide temperature and humidity measurement range can be widely used in temperature and humidity monitoring.


1.2 Temperature and humidity collection


(1) Introduction to SHT11: SHT11 launched by Swiss company Scnsirion is a digital temperature and humidity sensor chip integrating temperature sensor and humidity sensor. Therefore, the SHT11 sensor is used in the real-time temperature and humidity monitoring system, which has the characteristics of low cost, small size, high precision, and simple interface. Moreover, the anti-interference ability of the SHT11 chip is also higher than that of similar chips, because the chip integrates a 14-bit A/D converter and uses digital signal output.


(2) Interface circuit between SHT11 and MCU: MCU (MCU) and SHT11 sensor communicate using serial two-wire interface DATA and SCK, where DATA is the data line and SCK is the clock line. However, the I2C protocol and the second-line serial communication protocol are Incompatible. At the beginning of the program, the MCU needs to use a set of "start transfer" timing to indicate the start of data transfer. As shown in Figure 2-3, when the SCK clock is high, DATA flips to low; then SCK becomes low, and then becomes high again; when the SCK clock is high, DATA again flipped high.


As shown in Figure 2-4, it is the interface circuit between the SHT11 sensor and the microcontroller. SHT11 has only two pins, one digital serial pin is connected to the P1.0 port of the microcontroller, and the SCK pin is connected to the P1.1 port of the microcontroller. A 4K resistor R2 should be connected between the power supply and the digital serial pin. R2 is a pull-up resistor, because the P1 port drive capability of the microcontroller is limited, the purpose is to make the data received by the sensor reliable.


2. Software design of intelligent temperature and humidity control system


2.1 Overall software design


Software design is carried out on the basis of hardware design, and good software design is an important part of realizing system functions. Whether the system can run normally, in addition to the reasonable design of the hardware, largely depends on the software design with perfect functions and advanced algorithms. This system uses AT89C52 as the core of the hardware design system. The system software mainly includes data acquisition module, data display module, and alarm module. The data acquisition module includes temperature and humidity acquisition, data processing A/D conversion, and the alarm module includes alarm indication. and alarm handling. The data acquisition module collects the received analog signal from the sensor to the single chip microcomputer. The data processing module performs real-time processing and conversion on the received sampling signal, and finally realizes data communication, drive display, etc. The software system block diagram is shown in the figure below: These programs are independent of each other and are called sequentially in the main program. The single-chip microcomputer processes the digital signal, and the digital signal can be obtained by collecting the received data; the data processing module is realized by the single-chip microcomputer, which performs real-time control, data communication, drive display, drive operation, etc. of the sampling signal; the display part mainly uses LCD display, The LCD is driven by a microcontroller.


2.2 Flow chart of software design program


(1) Main program flow chart: The main program is the main body of the design and is composed of subroutines with different functions. The operation of the main program of this system is as follows: serial port initialization. After the initialization operation is completed, the keyboard is scanned in a circular manner. If the setting range is exceeded, an alarm will be given, and the alarm indicator light will be on, the buzzer will alarm, and the heating and ventilation circuit will be started at the same time.


(2) Alarm circuit program flow chart: The alarm module has two functions, namely alarm light and sound alarm. The sound alarm alerts the user audibly, while the alarm light alerts the user visually. When the read temperature value exceeds the upper and lower limits, the red light is on and an alarm is given; when the humidity value exceeds the upper and lower limits, the yellow light is on and an alarm is given.


(3) SHT11 reads the temperature and humidity program flow chart: the communication between the MCU and SHT11 uses a two-wire serial digital interface, and the I/0 port of the MCU needs to be used to simulate the communication sequence, because this communication protocol is different from the general I2C bus protocol. Compatible. For the control of SHT11, the MCU is realized through five six-digit command codes. The meanings of the command codes are: 00101: measure humidity; 00011: measure temperature; 00110: write internal status register; 00111: read internal status register; 11110: Reset command to restore the default value of the internal status register; others to set the resolution.


At the beginning of the program, first initialize the temperature and humidity sensor SHT11 to check whether it is working normally, then the MCU sends an instruction to connect with SHT11 to measure the temperature and humidity, then the temperature and humidity sensor SHT11 performs temperature and humidity calculation and A/D conversion, and then sends it to the host, and calls it repeatedly Reset, write and read data subroutines, and then through data conversion, displayed by the digital tube, continuous cycle.


The program first initializes the LCD1602 to check whether it is busy, if not, the host sends a mode setting command or a display command to write into the LCD1602, then specifies the actual address of the character display, writes the data into the LCD1602, and displays the temperature and humidity.


3. Simulation debugging of intelligent temperature and humidity control system


The hardware simulation of this design is realized by Protues software, the software debugging is realized by KeilC51 software, and the simulation of the overall design is realized through the combination of software and hardware.


Summarize


Since the core of the system is a high-efficiency single-chip microcomputer, the main acquisition and measurement system is SHT11, which integrates temperature sensors and humidity sensors, and has its own A/D converter, so the temperature and humidity controller has small size, low cost, and high precision High, simple interface and good anti-interference ability, coupled with the optimization program, this system has high practicability in a certain sense.


The above is the design process of the intelligent temperature and humidity control system based on single-chip technology introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions of Jieli, Ankai, Quanzhi, realtek and other series, and also develop BLE Bluetooth IC, dual-mode Bluetooth module, wifi module, and Internet of Things module. We have hardware design and software development capabilities. Covering circuit design, PCB design, single-chip microcomputer development, software custom development, APP custom development, WeChat official account development, voice recognition technology, Bluetooth development, wifi technology, etc. It can also undertake the research and development of smart electronic products, the design of household appliances, the development of beauty equipment, the development of Internet of Things applications, the design of smart home solutions, the development of TWS earphones, the development of Bluetooth earphone speakers, the development of children's toys, and the development of electronic education products.


  • TOP