Analysis of temperature and humidity monitoring system based on MSP430

Publisher:csZhouLatest update time:2013-08-06 Source: dzscKeywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  0 Introduction

  With the development of social economy and the continuous progress of science and technology, the temperature and humidity of the environment need to be limited in many cases. Therefore, in order to detect the ambient temperature and humidity at any time for monitoring and reduce the economic losses caused by temperature and humidity to the project, this paper designs a system for measuring temperature and humidity based on SHT11, which can realize the monitoring of ambient temperature and humidity.

  1 System Hardware Design

  1.1 Overall structure

  The temperature monitoring system is based on msp430 and uses temperature and humidity sensor SHT11 to measure temperature and humidity. The system consists of temperature and humidity data acquisition module, main control module, display module and key module. The temperature and humidity data acquisition module collects data and sends it to the microcontroller. After processing, the corresponding temperature and humidity display is completed according to the key operation, and it has the function of over-limit alarm. Figure 1 is the system structure diagram.

  

  1.2 Hardware Selection

  1.2.1 Main control module

  MSP430 microcontroller is a series of ultra-low power microprocessors launched by TI. Its notable features are ultra-low power consumption, with 5 low-power modes to choose from; the digitally controlled oscillator can quickly convert the hardware from the low-power state to the wake-up state, and can reach the activation working mode in less than 6μs; the development language has the characteristics of assembly language and C language. The above features make it the preferred microprocessor for battery-powered portable devices.

  1.2.2 Temperature and humidity monitoring module

  This design uses SHT11 sensor to measure temperature and humidity. The temperature and humidity measurement chip consists of a capacitive polymer humidity measuring element and an energy gap temperature measuring element, and is seamlessly connected to a 14-bit analog-to-digital conversion chip and a serial interface circuit. Therefore, compared with other similar chips, this chip has the advantages of strong anti-interference ability, high measurement accuracy, extremely short response time, and high cost performance.

  The internal hardware structure of SHT11 is shown in Figure 2.

  

  The default accuracy of the SHT11 sensor for measuring temperature and relative humidity is 14 bits and 12 bits respectively. If the status register is set, the accuracy can be reduced to 12 bits and 8 bits. The temperature range that can be measured is -40 ~ 123.8℃. If the accuracy is set to 14 bits, the temperature resolution is 0.01℃; the humidity range that can be measured is 0% ~ 100%RH. If the accuracy is set to 12 bits, the humidity resolution is 0.03%RH. The SHT11 sensor chip is extremely accurately calibrated for humidity before leaving the factory, and the calibration coefficient is stored in the OTP memory as a program. During the measurement process, the program can automatically calibrate the relative humidity. The calibration of the sensor signal is related to the calibration coefficient. The SHT11 chip uses the relative temperature and relative humidity analog signals generated by the temperature and humidity sensor, respectively, and amplifies the signal through the amplifier, then performs analog-to-digital conversion, signal calibration and error correction through the analog-to-digital conversion chip, and finally transmits the relative temperature and humidity to the MSP430 microcontroller for processing through the RS232 serial interface. [page]

    As shown in Figures 3 and 4, the transmission process of SHT11 is that when SCK is high, the DATA line is low, then SCK gives a low pulse, and when SCK is high again, DATA rises again. The subsequent command sequence consists of three address bits (currently only 000 is supported) and five command bits. SHT11 indicates the correct reception of the command by pulling down the DATA pin after the eighth SCK clock falling edge. At the ninth falling edge of the SCK clock, the DATA line is released (raised to a high level), as shown in Figure 4. To transmit two bytes of measurement data and one byte of CRC checksum, the μC must receive each byte through the pull-down pin of the DATA line.

  

  When the communication between the external and SHT11 sensor chip is suddenly interrupted, the serial port can be reset according to the following timing: As shown in Figure 4, set the DATA line to a high level, trigger the SCK pulse more than 9 times, and then transmit a "transmission start" command sequence on the SCk line. After executing the temperature (humidity) measurement command sequence, the temperature and humidity measurement controller needs to complete the measurement before accepting new commands. When using 12-bit and 14-bit measurement accuracy, the measurement time is 55 and 210ms respectively. When a measurement is completed, the SHT11 chip will set the data line to a low level. At this time, the temperature and humidity measurement controller must restart the SCK signal and transmit 2 bytes of random measurement data and 1 byte CRC checksum. The temperature and humidity measurement controller must confirm each byte received by setting the DATA line to a low level. The received data is transmitted in MSB sequence. The temperature and humidity measurement controller stops working after confirming that the CRC data is correct. If the CRC-8 checksum does not exist or is not received, the temperature and humidity measurement controller keeps the SCK line high to stop data transmission after receiving the LSB bit. The SHT11 chip returns to sleep mode to automatically save energy after measuring the temperature and humidity and completing data communication.

  1) Display and button module

  The display module of the system adopts 8-bit digital tube display, plus 4*1 key module control. K1 and K2 respectively display the current temperature and humidity on the digital tube, and K3 and K4 display 0, which is convenient for hardware debugging.

  2) Alarm module

  The system uses sound and light alarm. If the system detects that the temperature and humidity of the surrounding environment exceed or fall below the required range, the single chip microcomputer drives the LED of the P3.5 interface to flash, and the buzzer sounds to remind the alarm.

  2 System Software Design

  The whole program mainly includes the design of main program, temperature and humidity data acquisition, digital tube display, key processing, sound and light alarm and other modules.

  Figure 5 is the main program flow chart of the monitor. The key selection structure is used in the program design, mainly for the temperature and humidity display selection. After the key is pressed, the single-chip computer system determines that if it is K1, the current temperature is displayed; if it is K2, the current humidity is displayed; if it is K3 or K4, "0" is displayed. Finally, it is determined whether the temperature and humidity are out of limit. If they are, the sound and light alarm is activated, the LED flashes and the buzzer sounds; if normal, the temperature and humidity are continued to be measured.

  

  In the temperature and humidity measurement module of this system, the I2C port of the SHT11 chip is connected to the general I/O port of the MSP430 microcontroller to transmit data commands. The temperature and humidity measurement program is placed in the interrupt service program of the timer. After the system automatically determines the event, it calls the "write" command subroutine, "read" command subroutine, numerical calculation subroutine and display subroutine, and finally stores the actual temperature and humidity values ​​in two fixed storage units, with temperature and humidity occupying one unit each.

  3 System Testing and Analysis

  In order to verify the correctness of the temperature and humidity displayed by SHT11, an alarm clock that can display temperature and humidity is placed next to hot water heated to a certain temperature with this system, and the reading changes are observed and recorded. Table 1 is a comparison of the temperature and humidity recording results monitored by the alarm clock and this system.

  

  Parameters of temperature and humidity alarm clock:

  Temperature measurement range: -20℃~ +60℃

  Temperature and humidity measurement accuracy: ±1.0℃ (15℃~30℃)

  ±5%RH (40%RH ~ 80%RH)

  Temperature resolution: 0.1℃

  Humidity measurement range: 10%RH ~ 99%RH

  Humidity resolution: 1%RH

  From the experimental results, it can be seen that the temperature value measured by the system is very close to the value displayed by the alarm clock, while the relative temperature has an error of about 1% to 2% with the displayed value of the alarm clock, but it is within the error range of the measurement accuracy of the temperature and humidity alarm clock. When using two different instruments to measure temperature and humidity, this system displays the current temperature and humidity in real time and can obtain real-time values ​​more quickly, while the temperature and humidity alarm clock requires 5s of sampling and refreshing, so it takes a longer time for the system to obtain the current temperature and humidity, and the measurement data is not as accurate as this system.

  4 Conclusion

  This design improves on the traditional temperature and humidity monitoring and alarm system and designs a low-power temperature and humidity monitoring system. Through software and hardware testing, it is proved that the system can operate safely and reliably with small measurement errors and good application effects.

Keywords:MSP430 Reference address:Analysis of temperature and humidity monitoring system based on MSP430

Previous article:Application of AT45DB021B in power parameter monitoring
Next article:Design of portable weather instrument based on MSP430 microcontroller

Recommended ReadingLatest update time:2024-11-17 05:42

Temperature and humidity sensor detection program based on 51 single-chip microcomputer SHT11 (including circuit diagram)
Here is the schematic: Below is a typical circuit for connecting SHT11 to MCU: Here is the source code: #include reg52.h #include intrins.h   /****************************************************** ******* Macro Definition *************************************************** ******/ #define ui
[Microcontroller]
Temperature and humidity sensor detection program based on 51 single-chip microcomputer SHT11 (including circuit diagram)
Design of CCD camera dimming photoelectric control system based on MSP430 microcontroller
  1. Introduction   Since the first large-scale theodolite was developed in my country, photography has been the main means of measuring and recording aircraft (missiles, rockets, and spacecraft) with film theodolites. Whether the content recorded by photographic film can be discovered during interpretation is close
[Microcontroller]
Design of CCD camera dimming photoelectric control system based on MSP430 microcontroller
nRF24L01 MSP430 Transmit Receive Driver
nrf24l01.c Zhixinrui Electronic Technology Forum: http://www.zhixinrui.com #include "nrf24l01.h"       unsigned char flag=0; //Status register (STATUS) flag   unsigned char success=0; //Send or receive success flag, 0 for failure, 1 for successful sending, 2 for successful receiving   unsigned char TXBuf ={0
[Microcontroller]
Virtual Oscilloscope Based on MSP430 Single Chip Microcomputer
0 Introduction The rapid development of information technology has put forward the requirements of digitalization, miniaturization and low power consumption for new technical equipment, and the virtual oscilloscope is designed to adapt to this development. MSP430 microcontroller has the characteristics of hi
[Microcontroller]
Virtual Oscilloscope Based on MSP430 Single Chip Microcomputer
Horizontal intelligent control system of rice transplanter based on MSP430F149
With the development of agricultural mechanization and intelligence in my country, the requirements for agricultural machinery are getting higher and higher. When the traditional rice transplanter is working, the planting depth is at the same horizontal plane. When the field is sunken, the depth of the seedlings int
[Microcontroller]
Horizontal intelligent control system of rice transplanter based on MSP430F149
Development of high-precision steam flow meter based on IAPWS-IF97
introduction   At present, most intelligent instruments have adopted certain flow compensation technology, but the process of establishing the mathematical model of compensation is not very comprehensive, and the measurement accuracy is still not high. In view of this situation, this paper, based on the traditional
[Microcontroller]
Development of high-precision steam flow meter based on IAPWS-IF97
Explanation of DEFC DEFW and surrounding in the msp430 header file
Phenomenon:         See DEFC DEFW from here #define __MSP430_HAS_SD16_A1__              #define SD16INCTL0_                (0x00B0u)  DEFC(    SD16INCTL0              , SD16INCTL0_) #define SD16AE_                        (0x00B7u)  DEFC(    SD16AE                      , SD16AE_) #define SD16CONF0_ 
[Microcontroller]
Application of FLASH in MSP430F149 Embedded System
NAND Flash is a non-volatile memory using NAND structure technology. It has the characteristics of ROM memory. The data stored in the chip can be maintained for 10 years without loss in the case of power failure, and the chip pins and access have similar characteristics to RAM. NAND FLASH memory multiplexes the data
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号