Design of Temperature and Humidity Monitoring System

Publisher:Lihua521Latest update time:2011-03-31 Source: 电子科技 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract A design and implementation method for real-time monitoring of temperature and humidity is proposed. The design process is explained and a hardware connection diagram is given. In order to realize the transmission of measurement data, some software design schemes are introduced. The designed measurement system can meet the real-time monitoring of temperature and humidity.
Keywords Temperature and humidity measurement; SHTll chip; MSP430F149 chip This paper will introduce a temperature and humidity measurement system implemented by a digital temperature and humidity sensor SHTll and an ultra-low power microcontroller MSP430F149. The system can conveniently realize real-time monitoring of temperature and humidity. 1 Chip Introduction SHTll is a digital temperature and humidity sensor produced by Sensirion. It is a fully calibrated digital output sensor that integrates temperature sensitive elements, humidity sensitive elements, signal amplifiers and conditioners, 14-bit A/D converters and two-wire serial interface circuits. The chip can directly provide a digital output with a resolution of 14 bits in the temperature range of -40 to 120°C and a digital output with a resolution of 12 bits in the humidity range of 0 to 100% RH. Since the chip has the advantages of fast response speed, strong anti-interference ability and high cost performance, the SHTll chip is used as the measurement unit. The SHTll chip also has a heater inside, which can be used to achieve the following functions. (1) The comparison of the relative temperature and humidity values ​​measured before and after heating can determine whether the sensor is in a normal working state. (2) Using a heater in a humid environment can avoid condensation of the sensor, and at the same time can shorten the response time and improve the measurement accuracy. (3) A heater is also required when achieving high-quality dew point measurement. 2 Hardware Design In the hardware design, the temperature and humidity signals are converted into analog voltage signals through the temperature sensitive element and humidity sensitive element inside the SHTll. The analog voltage signals are amplified by the signal amplifier and conditioner inside the SHTll, and then converted to digital, calibrated and corrected by the A/D converter. Finally, the relative temperature or humidity data is transmitted to the ultra-low power microprocessor MSP430F149 through the bidirectional data port DATA of the two-wire serial interface. When the MSP430F149 microprocessor receives the data, it displays the temperature and humidity values ​​through the P4 and P5 ports via LEDs. Since the P1 port has an interrupt function, the specific parameters of the alarm can be input through the matrix keyboard. After comparison, if an alarm is required, the temperature and humidity alarms are output through the P3 port through the relevant peripheral circuits. The specific hardware connection is shown in Figure 1. Because SHTll is accessed through a two-wire serial interface, the hardware interface circuit is very simple. It should be noted that the DATA data line requires an external resistor. The clock line SCLK is used for synchronous communication between the ultra-low power microprocessor MSP430F149 and SHTll. Since the interface contains completely static logic, there is no requirement for the minimum frequency of SCLK.













a.JPG

The temperature and humidity values ​​can be displayed by LED. If you need to save pins, you can use a shift register to realize the static display of LED. For example, the 8-bit shift register SN74HC595D chip. The operating voltage of this chip is 2~6 V, and it can be directly connected to the MSP430 series microcontroller. Part of the connection circuit is shown in Figure 2.
b.JPG

Among them, the serial cascade is realized through the serial output pin of SN74HC595D, so that the display of two digital segments can be controlled. P4.1 and P4.2 of the microprocessor are respectively connected to the latch input signal port RCLK and the shift clock signal port SRCLK to generate latch signals and shift clock signals respectively. OE is grounded to enable the output. Based on the above circuit, the number of displayed bits can be increased by increasing the number of SN74HC595D.
The matrix keyboard consists of row lines and column lines. The input of the keyboard is mainly captured by scanning. Scanning means that the microcontroller continuously sets the row lines to low level in turn, and then checks the input status of the column lines. Figure 3 is the keyboard circuit.

c.JPG
3 Software Design
3.1 Measurement Design
At the beginning of the program, the microprocessor first uses a set of "start transmission" timing to indicate the initialization of data transmission, and then issues an 8-bit command code, which contains 3 address bits (must be set to 000) and 5 command bits. After sending the command code (the meaning of the command code is shown in Table 1), the DATA data line is set to the input state to wait for the response of SHTll. After SHTll receives the above address and command code, it pulls down the DATA data line to a low level at the 8th clock falling edge as a response signal. After the 9th clock falling edge, SHTll restores the DATA data line to a high level, which indicates that the measurement instruction has been correctly received. After the DATA data line is restored, SHTll starts to measure the current temperature or humidity. After the measurement is completed, the DATA data line is pulled down to a low level again, which indicates that the measurement has ended. After the microprocessor detects that the DATA data line is pulled low, it gives a clock signal. SHTll then transmits 2 bits of measurement data and 1 bit of verification data.
The microprocessor needs to confirm each byte by pulling down the DATA data line. First, the high byte data is output at 8 clock falling edges. At the 9th clock falling edge, the microprocessor pulls the DATA line low as a response signal, and then releases the DATA line. At the next 8 clock falling edges, SHTll sends low byte data; at the next clock falling edge, the microprocessor pulls the DATA line low again as a response signal for receiving data. At the last 8 clock falling edges, SHTll sends verification data. If the microprocessor does not respond, it means that the communication is over. After the measurement and communication are completed, SHTll automatically enters sleep mode. After testing, the system can monitor temperature and humidity.
d.JPG

3.2 LED display design
The microprocessor outputs data to SN74HC595D serially through the P4.0 port. After outputting one byte, if a latch signal is given, the SN74HC595D will output in parallel and display the data on the digital tube. If no latch signal is given, but the second byte continues to be output, then the first SN74HC595D outputs the previous byte of data to the input pin of the second SN7 4HC595D through the serial output pin. When the output is finished, the two SN74HC595Ds store two bytes of data respectively. At this time, if the microprocessor gives a latch signal, the two SN74HC595Ds display the data on the two digital tubes through parallel output.
3.3 Keyboard input design
Since all column lines are pulled up to 3.3 V, all column lines are high when no key is pressed. If a low level is output on the P1.7 pin and a high level is output on other pins of the row line, when the "S01" key is pressed, P1.0 is low; when the "S02" key is pressed, P1.1 is low; when the "S03" key is pressed, P1.2 is low; when the "S04" key is pressed, P1.3 is low. By setting the output of a row line, the corresponding state on the column line can be obtained, thereby obtaining the keyboard input value. Similarly, if a low level is output on other column lines in turn, the input values ​​of other keys can be obtained. Through this scanning method, keyboard input can be achieved. The keyboard scanning result is shown in Figure 4.

e.JPG


It can be seen that when the 4, 0, 5 and 6 keys of the keyboard are pressed, the single chip microcomputer can receive accurate data. After the parameters are entered, the microprocessor will compare the data with the stored parameters each time it measures the data, and an alarm will be issued if it exceeds the limit.

4 Conclusion
This paper introduces the implementation scheme of the digital temperature and humidity monitoring system, the hardware connection and the design of each functional part. After testing, the system can realize real-time measurement and monitoring of temperature and humidity, meeting the design requirements.

Reference address:Design of Temperature and Humidity Monitoring System

Previous article:Design of CMOS Pseudo-Differential Class E RF Power Amplifier
Next article:Design of educational robot hardware system based on TMS32OLF24O7A

Latest Industrial Control 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号