Design of environmental temperature and humidity monitoring system based on GPRS

Publisher:技术掌门Latest update time:2011-04-11 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: A design scheme for an environmental temperature and humidity monitoring system based on GPRS is proposed. For environments with requirements for temperature and humidity, the environmental temperature and humidity data are collected through a data acquisition terminal with a high-precision temperature and humidity sensor, and then the data is transmitted to the computer in the monitoring room for real-time display via a GPRS wireless module. The TCP point-to-point network connection method is adopted, which is mainly for monitoring centers without a network environment. Customers do not need to apply for a public network IP address or open a dedicated APN. They only need to connect a receiving module to the monitoring terminal to easily realize long-distance data transmission. The entire data acquisition terminal is controlled by an MSP-430 microcontroller. Without changing the hardware, only by modifying and adjusting the software, it can meet the communication under different GPRS network access methods and has good expansion performance. Experimental tests show that the system has high accuracy, stable operation, and meets the system design requirements.
Keywords: temperature and humidity monitoring; GPRS; SIM300; 430 microcontroller

Today's modernization construction and national economic development are rapid, and society's requirements for production environment and living environment awareness are getting higher and higher. People's daily life is closely related to the temperature and humidity of the surrounding environment. The fields of petroleum, chemical industry, aerospace, pharmaceutical, archive storage, grain storage, etc. also have high requirements for temperature and humidity. Therefore, the monitoring and control of temperature and humidity has become a very important technology in the production process. The rapid development of wireless networks has made remote data transmission widely used. GPRS communication technology has its unique advantages such as no need to set up communication lines, flexible and convenient networking, and wide coverage, making it more and more valued in wireless data transmission systems.
To this end, this paper proposes a GPRS-based environmental temperature and humidity monitoring system. The MSP430 microcontroller and SIM300 wireless communication module are used to form a data acquisition terminal, which can continuously and real-time monitor the environmental temperature and humidity of the monitoring site. The host computer software of the monitoring center is implemented in C++ programming, which can remotely control the data acquisition terminal.

1 Overall composition of the monitoring system
This solution is aimed at monitoring centers that have no network environment or unstable network environment and cannot directly access the Internet. There is no need for a public network IP address or an APN dedicated line. Two GPBS wireless modules are used for sending and receiving, and data communication can be completed through a point-to-point TCP connection in the GPRS intranet.
The monitoring system consists of two parts: the data acquisition terminal and the monitoring center server. The data acquisition terminal is responsible for the collection and transmission of temperature and humidity data. The monitoring center server uses a GPRS wireless module as the receiving end to transmit the received data to the monitoring center PC. Through the analysis and processing of the host computer software, the real-time display, curve display, data storage and other functions of the collected data are realized. The overall structure of the system is shown in Figure 1.

a.JPG



2 System Hardware Design
The system hardware is the data acquisition terminal, with the MSP430 microcontroller as the core, including a high-precision temperature and humidity sensor AM2303, power module, serial port module, GPRS communication module SIM-300, etc. The MSP430 microcontroller collects the signal of the digital temperature and humidity sensor AM2303 through the I/O port, analyzes and processes it, and then sends the temperature and humidity data to the SIM300 wireless module through the RS-232 serial port, which then sends it to the monitoring center server through the GPRS network. The hardware structure block diagram is shown in Figure 2.

b.JPG
2.1 Power supply module
The external input voltage of the system is 5 V. Since the power supply voltage of the temperature and humidity sensor AM2303 is 3.3~6V, the operating voltage of the MSP430 microcontroller is 3.3 V, and the operating voltage of the GPBS wireless module SIM300 is 4.2 V, this system needs to provide 3.3 V and 4.2 V voltages. The temperature and humidity sensor AM2303 directly uses a 5 V input voltage: the 3.3 V power supply part uses the SM1117 chip of SM Company; for the 4.2 V power supply used by the SIM300 module, since the output current of this power supply part must reach 2 A, the MIC29302 chip of MICREL Company is used. The specific circuit diagrams are shown in Figures 3 and 4 respectively.

c.JPG


2.2 Temperature and humidity sensor module
AM2303 digital temperature and humidity sensor is a temperature and humidity composite sensor with calibrated digital signal output. The sensor includes a capacitive humidity sensing element and an NTC temperature measuring element, and is connected to a high-performance 8-bit microcontroller.
The calibration coefficients are stored in the OTP memory in the form of a program, and these calibration coefficients can be called at any time during the processing of the detection signal inside the sensor. AM2303 uses a single-wire serial interface, and the system integration is simple. The temperature and humidity measurement ranges are -40~125℃ and 0~99%RH respectively.
2.3 GPRS wireless module
The GPRS wireless module uses SIMCOM's SIM300 module. SIM300 is a three-band GSM/GPBS module that can provide up to 10 GPRS multi-channel types. The module also integrates the TCP/IP protocol stack and expands the TCP/IP AT commands to facilitate users to develop data transmission equipment. The system uses a ZIF connector to connect to the SIM card. The microcontroller communicates with the SIM300 by sending AT commands to achieve network connection, data transmission and other functions.

3 System software design
The system software consists of two parts: the lower computer software and the upper computer software. The lower computer software, i.e., the software of the data acquisition terminal, is written in C language, and the upper computer software, i.e., the software of the monitoring center server, uses Bodand's C++Builder as the development platform.
3.1 Data acquisition terminal software design
The entire data acquisition terminal software includes several parts such as the initialization program, the digital temperature and humidity sensor acquisition program, the serial port program, the network connection command sending and receiving program, and the test program. The overall program flow chart is shown in Figure 5.

d.JPG


The MSP430 microcontroller communicates with the SIM300 wireless module via the RS-232 serial port in the form of AT commands. If the microcontroller sends the correct command, the SIM300 module will return "OK", and if it is wrong, it will return "ERROR" or other formats of commands. The microcontroller determines the next program to be executed by judging the command returned by the wireless module until the GPRS network is successfully connected. The network connection program flow chart is shown in Figure 6.

e.JPG


This system uses TCP point-to-point connection for GPRS connection. The data acquisition terminal needs to obtain the IP address of the server first, so the server sends the local IP to the data acquisition terminal in the form of SMS. After the data acquisition terminal extracts the IP address, it performs local settings and initiates the connection.
The data acquisition program consists of two parts: data acquisition and data conversion. Data acquisition obtains 40-bit temperature and humidity data from the sensor. Data conversion mainly performs decimal conversion, ASCII encoding and positive and negative temperature judgment. The temperature and humidity sensor AM2303 uses a single bus data format. The communication time is about 5 ms. After the host (MCU) sends a start signal, AM2303 switches from low power mode to high speed mode. After waiting for the host start signal to end, AM2303 sends a response signal, sends out 40 bits of data, and triggers a signal acquisition. The AM2303 communication sequence is shown in Figure 7.

f.JPG


3.2 Design of monitoring center server software
In this paper, the monitoring center software development platform is designed with C++Builder. A GPRS wireless module is connected to the server as the receiving end, and the MSCOMM serial port control in C++Bulkler is used to complete the serial port communication and read the data. At the same time, the returned data can be analyzed, displayed in real time and graphically, and the collection time interval of the data collection terminal can be controlled to achieve the purpose of remote monitoring. The monitoring center software also establishes a database, which can call and view the saved data and graphic records, and print them. The software interface consists of three parts: real-time monitoring unit, historical data unit and GPRS connection unit. The monitoring center interface is shown in Figure 8.

g.JPG



4 Experimental results and analysis
This system was used to measure the standard temperature source and humidity source. The measurement results are shown in Figures 9 and 10.

h.JPG i.JPG


As can be seen from the data in the figure, the temperature measurement error does not exceed ±0.2℃, the humidity error does not exceed ±2%RH under ideal conditions of 25℃, and does not exceed 3%RH under low temperature conditions, which can meet the needs of practical applications. At the same time, through long-term stability tests, long-term data collection is stable, the drop rate is low, and because there is no direct access to the Internet, the traffic is small. If data is collected every one minute, the data traffic for continuous collection for one month does not exceed 45M.

5 Conclusion
This system is mainly aimed at monitoring centers without network environments, and the hardware access is simple. By modifying the software, it can also meet the application of different GPRS access methods, with good expansion performance. At the same time, it has functions such as automatic reconnection after disconnection and battery power monitoring, and can be widely used in various temperature and humidity monitoring environments.
The data acquisition program consists of two parts: data acquisition and data conversion. Data acquisition obtains 40 bit temperature and humidity data from the sensor, and data conversion mainly performs decimal conversion, ASCII encoding and positive and negative temperature judgment. The temperature and humidity sensor AM2303 uses a single bus data format, and the communication time is about 5 ms. After the host (MCU) sends a start signal, AM2303 switches from low power mode to high speed mode. After waiting for the host start signal to end, AM2303 sends a response signal, sends out 40 bits of data, and triggers a signal acquisition. The AM2303 communication timing is shown in Figure 7.

f.JPG


3.2 Design of monitoring center server software
In this paper, the monitoring center software development platform is designed with C++Builder. A GPRS wireless module is connected to the server as the receiving end, and the MSCOMM serial port control in C++Bulkler is used to complete the serial port communication and read the data. At the same time, the returned data can be analyzed, displayed in real time and graphically, and the collection time interval of the data collection terminal can be controlled to achieve the purpose of remote monitoring. The monitoring center software also establishes a database, which can call and view the saved data and graphic records, and print them. The software interface consists of three parts: real-time monitoring unit, historical data unit and GPRS connection unit. The monitoring center interface is shown in Figure 8.

g.JPG



4 Experimental results and analysis
This system was used to measure the standard temperature source and humidity source. The measurement results are shown in Figures 9 and 10.

h.JPG i.JPG


As can be seen from the data in the figure, the temperature measurement error does not exceed ±0.2℃, the humidity error does not exceed ±2%RH under ideal conditions of 25℃, and does not exceed 3%RH under low temperature conditions, which can meet the needs of practical applications. At the same time, through long-term stability tests, long-term data collection is stable, the drop rate is low, and because there is no direct access to the Internet, the traffic is small. If data is collected every one minute, the data traffic for continuous collection for one month does not exceed 45M.

5 Conclusion
This system is mainly aimed at monitoring centers without network environments, and the hardware access is simple. By modifying the software, it can also meet the application of different GPRS access methods, with good expansion performance. At the same time, it has functions such as automatic reconnection after disconnection and battery power monitoring, and can be widely used in various temperature and humidity monitoring environments.

Reference address:Design of environmental temperature and humidity monitoring system based on GPRS

Previous article:Design of intelligent baby carriage control system based on single chip microcomputer
Next article:A single-chip microcomputer controlled lead-acid battery charging power supply

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号