Design of environmental temperature and humidity measurement system using SHT11 digital temperature and humidity sensor

Publisher:SparklingBeautyLatest update time:2023-05-30 Source: elecfansKeywords:SHT11 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

In order to effectively carry out basic research on the durability of modern concrete structures, reveal the damage evolution rules of concrete structures throughout their life, fundamentally improve the durability of concrete projects, and ensure their due service life, the temperature and humidity of the concrete usage environment are measured. seems particularly important


Thermistors and humidity-sensitive capacitors are usually used to measure temperature and humidity respectively, and then sent to the computer after A/D conversion. However, this measurement method generally requires the design of corresponding signal conditioning circuits and a complex calibration process. Accuracy is difficult to guarantee. This system for measuring temperature and humidity can still be used when the number of measurement points is small and the accuracy requirements are not high. However, when multiple points of measurement are required and the accuracy requirements are high, its shortcomings will become apparent. Moreover, when it comes to monitoring two parameters, each measurement point must use two independent sensors and independent signal conditioning circuits. This not only greatly increases the cost and volume of the measurement system, but also increases the cost to a certain extent. the complexity of system design. This article will use the SHT11 chip to achieve a more optimized design.


SHT11 internal structure and working principle

SHT11 digital temperature and humidity sensor is manufactured using CMOSens (Ce-mo-Sens) patented technology (the fusion of CMOS and sensor technology). Its features are: full-scale calibration, second-line digital output; humidity measurement range is 0~100%RH, The temperature measurement range is -40℃~+123.8℃, the humidity measurement accuracy is ±3.0% RH, the temperature measurement accuracy is ±0.4℃, the response time is <4s; low power consumption (30mW), and can be fully immersed. Its overall dimensions are only 7.5mm×5mm×2.5mm, and its volume is similar to that of a large match head. The chip can output fully calibrated relative humidity and temperature digital signals to facilitate system integration.


SHT11 internal structure

Its internal structure is shown in Figure 1. It mainly includes: relative humidity sensor, temperature sensor, amplifier, 14-bit ADC, calibration memory E2PROM, RAM, CRC (cyclic redundancy check code) register, two-wire serial interface and low-voltage monitoring circuit, etc.

Design of environmental temperature and humidity measurement system using SHT11 digital temperature and humidity sensor

Figure 1 Internal structure of SHT11

The DATA pin of this chip changes state after the falling edge of the SCK clock and is valid only after the rising edge of the SCK clock, so the microcontroller can read the data when SCK is high, and when it sends data to SHT11, It must be ensured that the level state on DATA is stable in the SCK high level segment. When it is necessary to output a high level, the microcontroller will be set to a high-impedance state, and the external pull-up resistor will pull the signal to a high level, thereby achieving a high-level output.


working principle

First, two sensors generate relative humidity and temperature signals respectively. After amplification, they are sent to a 14-bit ADC for A/D conversion, standardization and error correction. Finally, the relative humidity and temperature data are transmitted through a two-wire serial interface. It is sent to the microcontroller, and then the microcontroller is used to complete nonlinear compensation and temperature compensation.


Temperature and humidity measurement system

Hardware circuit design

This system uses PIC16F73 microcontroller as the microcontroller. PIC16F73 is an 8-bit 28-pin microprocessor with 4KB of FLASH program memory; 22 bidirectional programmable I/O lines; 192-byte data memory; 3 timers; 5 8-bit A/D channels.


The system consists of three parts: measurement, display and communication. Since PIC16F73 has an I2C bus interface, virtualization is not required. Connect a 4.7KW pull-up resistor to the DATA terminal and a 0.1mF decoupling capacitor to the VDD and GND terminals. The hardware connection diagram is shown in Figure 2.

Figure 2 System hardware circuit diagram

SHT11 adopts a two-wire data transmission method. In order to save limited I/O port resources, the following connection method is adopted: connect the SCK line of each SHT11 to the same I/O port line of the microcontroller, and the DATA line Then they are respectively connected to different I/O ports. At the same time, this wiring method has another advantage: since multiple SHT11s share one SCK line, measurement instructions can be issued at the same time in each measurement. In this way, each sensor measures at the same time, and only one waiting time is needed to complete the entire process. Collection of data. The data collection time is shortened, thereby providing conditions for rapid response of the control system.


The display circuit is implemented using a 4-bit LED control driver ZLG7219 with a high-speed serial interface. The interface uses the synchronous serial peripheral interface SPI, which is easy to program and saves I/O ports. The temperature and humidity displays each use 4 digits. By changing the resistance value connecting the power supply and the ISET port, the display brightness of the digital tube can be adjusted.


The data communication part with the host computer adopts the RS-232 communication method implemented by the interface chip MAX232.

In order to improve the reliability of the system, a watchdog circuit is composed of MAX813LEUA to prevent the program from running away and causing the system to lose control. If PIC16F73 does not send a trigger signal to the WDI input within 1.6s, it means that the program has run away, and MAX813LEUA will send a reset signal to reset the system again.


Design of temperature and humidity measurement system software

There are programs for data collection and display written inside the microcontroller, which can display the current temperature and humidity values ​​on site in real time. In addition, the temperature and humidity values ​​are sent to the PC through the RS-232 bus interface, and the VB program is run to monitor the temperature and humidity values. displayed on the interface. The flow of the microcontroller software is shown in Figure 3.

Figure 3 Software flow chart

In order to realize temperature and humidity measurement, the host computer display screen was written using VB, which can display the temperature and humidity value of each point on the current site in real time. The following is part of the program for converting temperature and humidity:

Select Case

MSComm1.CommEvent

Case comEvReceive

Label11.Visible = True

Label12.Visible = True

buffer = MSComm1.Input

arr = buffer

For i = 1 To 11

w_1(i) = arr(i - 1)

Text1.Text = Text1.Text +

" " + w_1(i)

Next i

Humidity = Str$((Val(w_1(4))*256 + Val(w_1(5)))/100)

Temperature = Str$(((Val(w_1(6))) * 256 + Val(w_1(7))) - 27315) / 100)

Label2.Caption = Humidity

Label10.Caption = Temperature

End Select

Figure 4 is a picture of collecting one of the points. In the picture, there are settings such as serial port number, baud rate, check bit, data bit and stop bit. The current temperature and humidity of the measured point can be seen at a glance.

Figure 4 Temperature and humidity display interface

What is displayed here is only one point. Of course, multiple points to be displayed can also be displayed together, or you can switch to the historical temperature and humidity value curve of each point, as long as you make some modifications in the program.

Conclusion

This article uses PIC16F73 microcontroller and SHT11 temperature and humidity sensor and related peripheral chips to form a high-performance temperature and humidity acquisition system, and uses VB to realize real-time communication between the data site and the host computer, so as to easily know the temperature and humidity status of each point on site. , which provides a strong basis for the use of concrete structures.


Keywords:SHT11 Reference address:Design of environmental temperature and humidity measurement system using SHT11 digital temperature and humidity sensor

Previous article:Connect DHT11 to PIC16F877A to measure temperature and humidity
Next article:Design of miniature pressure measurement device based on AT45DB161B memory and PIC16LC73B microcontroller

Recommended ReadingLatest update time:2024-11-24 18:06

Solar Energy Environmental Parameters Tester Based on AT89S52 Single Chip Microcomputer
introduction In order to ensure that the solar power generation system can work normally, it is necessary to measure the various environmental parameters of the solar power generation system so as to effectively control its operation. This paper introduces a solar parameter tester based on a single-chip mic
[Microcontroller]
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号