APP下载

Wireless sensing system for environmental humidity and temperature monitoring*

2013-11-01YUANYaodong袁耀东ZHANGAijun张爱军

YUAN Yao-dong(袁耀东), ZHANG Ai-jun(张爱军)

(School of Mechanical Engineering, Nanjing University of Science and Technology, Nanjing 210094, China)

Wireless sensing system for environmental humidity and temperature monitoring*

YUAN Yao-dong(袁耀东), ZHANG Ai-jun(张爱军)

(School of Mechanical Engineering, Nanjing University of Science and Technology, Nanjing 210094, China)

Aiming at the actual demand for monitoring environmental information, a wireless sensing system for temperature and relative humidity (RH) monitoring based on radio frequency (RF) technology and mobile network was designed. This paper introduces the architecture of the system. The system uses AVR micro controller unit (MCU), KYL-1020U RF module and SHT71 to complete real-time temperature and humidity monitoring, and uses SIM900A module to realize remote alarming and monitoring with short message system (SMS) through global system for mobile communication (GSM). Experimental results show that the designed system has good stability of measurement and real-time performance, and it can be used in some small temperature and humidity monitoring occasions.

environmental monitoring; temperature and humidity; radio frequency (RF) technology; wireless transmission; global system for mobile communication (GSM)

Environmental monitoring, both indoors and outdoors, is one of the most promising application areas for Internet of Things technology. Today, environmental monitoring information usually contains two variables of temperature and humidity which facilitate research in many fields such as precision agriculture, habitat monitoring, warehouse monitoring, etc. Now the research begins to focus on the perception and exchange of information along with the promotion of Internet of Things. Obtaining the information of the variables accurately and in real-time is the critical process to implement precise monitoring, and it is also the biggest obstacle today. In developed country, industry chain of environmental monitoring has formed and corresponding system is being developed towards intelligent and miniaturized direction. However, environmental monitoring is still at its early development phase in China. The existing domestic monitoring projects use analog sensors with a self-designed front-end measurement circuit and adopt the cable way to lay out the monitoring network, which enhances the autonomy, stability and transmission rate. But the system simultaneously suffers from high cabling cost, complicated equipment placement and low maintenance efficiency. It is difficult to meet the requirements of the regional monitoring.

Wireless sensor network (WSN) is a new wireless network technology which integrates sensor technology, information technology and network communication technology. WSN consists of lots of cheap micro sensing nodes deployed in monitoring area. These nodes with high flexibility can provide a large amount of data support for the temperature and humidity monitoring. The use of WSN may provide a superior technology solution for unattended and regional monitoring.

In this paper, on the basis of the study on WSN, a wireless temperature and humidity monitoring system is designed including the hardware design and underlying software design. In addition, we combine the global system for mobile communication and general packet radio services (GSM/GPRS) technologies for the communication between sensor network and phone to achieve mobility monitoring. A feature of this system is that it can be used on the occasions of wiring being difficult.

1 Overall design scheme of the system

As shown in Fig.1, the sensing system consists of sensing nodes and a central controller. The sensing nodes in monitoring site gather environmental temperature and humidity information and transmit data wirelessly to the central controller. In central controller, the data is received with a matching radio frequency (RF) transceiver. After the data being analyzed and dealt with the central controller uploads data to PC via the RS232 interface. With corresponding PC software, the user can monitor the collected data.

To realize reliable unattended monitoring, we use GSM/GPRS technology in this system. Once any parameter of temperature and humidity exceeds the alarm threshold, a warning short message service (SMS) message may be constructed by the central controller and sent to monitoring staff over the GSM network. The system also can send the latest data to mobile phone when the correct inquiry short message is received by the central controller.

Fig.1 Overall structure diagram of the system

2 Hardware circuit design

2.1 Microprocessor module

Microprocessor is the control core of the system. To reduce hardware volume, the AVR microprocessor ATmega8 with 23 programmable I/O lines is applied in sensing node. The high-level integration helps to reduce the system cost.

Compared with the sensing node, there are more data and controlled quantity need to be processed by central controller. So we design the central controller based on ATmega2560, which has 256 KB Flash and 4 KB EEPROM, 86 Programmable I/O lines and 4 USARTs. USART0, USART1 and USART2 are used separately in bidirectional communication with RF transceiver, SIM900A and PC.

2.2 Wireless module

RF transceiver KYL-1020U is used to enable nodes to communicate wirelessly with central controller. KYL-1020U is a transparent transmission module, which works selectively in industrial scientific and medical (ISM) bands of 433 MHz, 868 MHz or 915 MHz. The KYL-1020U interface circuit is shown in Fig.2. In sensing node, SLEEP line may be connected with common I/O of microprocessor for saving energy.

Fig.2 KYL-1020U interface circuit

2.3 Sensor measurement circuit

Measurement circuit is designed based on SHT71 sensor. The sensor provides a fully calibrated digital output, which can sense temperature ranging from -40 ℃ to 123.8 ℃ and relative humidity (RH) levels of 0 to 100%. The SHT71 interface circuit is shown in Fig.3. The 0.1 μF capacitor may prevent the high-frequency noise in supply-side.

Fig.3 SHT71 interface circuit

2.4 GSM/GPRS circuit

GSM/GPRS module SIM900A is used to transmit monitoring data and alarming data to the mobile phone or remote terminal with TCP/IP protocol. SIM900A integrates powerful processor ARM9216EJ kernel. It has many advantages such as simple development and easy integration. By programming AT command, it is easy to realize voice, SMS, data and fax transmission. The SIM900A interface circuit is shown in Fig.4.

SIM900A has not standard transistor-transistor logic (TTL) level output and can not directly communicate with the ATmega2560. A level conversion circuit based on MAX232 is designed to realize the level matching. Two inverse RS232 level conversions (non-standard TTL to RS232, RS232 to standard TTL) are completed in this circuit.

Fig.4 SIM900A interface circuit

3 Software design

3.1 Sensor data preprocessing

Data preprocessing is completed in sensing node. It is divided two parts, compensation process and data packing process. In this application, sensor supply voltage is 5 V, the resolution of raw data of temperature Tt(℃) and relative humidity RHt(%) are 14 bit and 12 bit, respectively. So the compensation process can be described by following formula according reference[6].

Tt=-40+0.01X1,

RHt=-4.65+0.000 1X1+0.035 3X2+

0.000 000 8X1X2-0.000 002 X22,

where X1is the raw temperature value and X2is the raw humidity value. The raw sensor data is read out by ATmega8 through simulation of I2C time sequence. After the above process is completed, compensation data will be packaged with self-defined structure. The structure is shown in Table 1.

Table 1 Packet structure

3.2 Wireless communication process

In this system, a master-slave protocol is used in the communication between the central controller and sensing nodes. The central controller works in the master mode, which periodically sends the query command to sensing nodes. At the same time the sensing nodes work in the slave mode, waiting for a request for collection to respond.

The process of communication between the central controller and sensing nodes is shown in Fig.5. After a transmission and a reply are completed, the sensing nodes go into an idle waiting state. When all nodes data is received, the central controller runs a delay procedure and enters the next collection cycle.

The radio communication is apt to be disturbed by external electromagnetic waves such that the communication data may fluctuate and the data received by the central controller may not be real. One way to solve this problem is to check CRC code. The CRC code is calculated by bottom software of sensing node before packet being sent to central controller. The structure of the packet is shown in Table 1 and CRC code is placed in packet tail. After the center controller receives the packet, it recalculates CRC code and compares the new code with the received code. The same CRC code indicates that transmitted data and received data are consistent and the central controller may send back an ACK signal to sensing node. If no ACK signal is received in the provision of time, the sensing node retransmits packet in prescribed number. The retransmission mechanism could effectively prevent the external interference, thus it provides stability and reliability for the radio communication between the central controller and the sensing node.

Fig.5 Flow chart of commanication process between central controller and sensing nodes

3.3 GSM communication

Before sending the message, the information format of the SIM900 must be set. The SMS used in this system are composed of English letters and numbers, so the information format is set to TEST mode. The mode setting as well as other GSM communication operations can be completed by programming AT instructions. All of the AT instructions begin with “AT” and ends in lt;CRgt; to indicate that the instruction is over.

Fig.6 shows the short message sending process. The mobile phone communications service provider is China Mobile. When AT instruction is sent successfully, microprocessor serial port may reply “OK” or “ERROR” feedback signal. By judging this signal, the central controller decides whether to send the same instruction again.

Fig.6 Short message sending process

4 System test

Temperature and humidity measurement experiments were carried out in the laboratory. Fig.7 and Fig.8 show uhe experimental comparison results, in which t0and t1are the actual values measured by high precision thermo-hygrometer, and t1and h1are the system measured values.

Fig.7 Temperature measurement data

It can be seen from Fig.7 and Fig.8 that the two curves with the same type are basically consistent with maximum temperature error of 0.3 ℃ and maximum humidity error of 2.6%, indicating that the system can effectively reflect the environmental temperature and humidity. The error between measured value and the actual value is mainly due to the sensor itself error and it is hardly introduced by the data wireless transmission.

For reasonable arrangement of sensing nodes, we tested the KYL-1020U communication distance outdoors with less blocking. During the test, the data packet was sent continuously by node with length of 14 byte and the KYL-1020U transmission rate was set at 9 600 bps. Fig.9 shows the error rate of received packet in different communication distance. From Fig.9, it can be seen that if the communication distance increases 300 m up to 500 m, the error rate maintains a high level with a rapid increase trend, indicating that the wireless transmission of node data packet remains stable within the 300 m range.

Fig.8 Humidity measurement data

Fig.9 Test results of wireless transmission

5 Conclusion

In this work, we designed a wireless temperature and humidity sensing and early warning system. In this system, wireless technology is effectively applied in the transmission of information. It solves the difficult problems of installation and maintenance that consist in the cable system. At the same time, this system effectively realizes remote transmission of information by taking advantage of the mature GSM mobile network. Experiments show that the system has good real-time performance. The wireless sensing system has good flexibility and low cost, providing an effective solution for some small temperature and humidity monitoring occasions.

[1] CHANG Chao, XIAN Xiao-dong, HU Ying. Design of precision agriculture remote environment monitoring system based on WSN. Chinese Journal of Sensors and Actuators, 2011, 24(6): 879-883.

[2] YUAN Jiang, CAO Jin-wei, QIU Zi-xue. Temperature and humidity distributed monitoring for grain depot based on RFID reader networks. Transactions of the Chinese Society of Agricultural Engineering, 2011, 27(10): 131-136.

[3] XUE Ling, SUN Man, HANG Zhi-hui, et al. A temperature and humidity control instrument based on microprocessor AT89S51. Control and Instruments in Chemical Industry, 2010, 37(7): 66-69.

[4] Parikh P, Kanabar M, Sidhu T. Opportunities and challenges of wireless communication technologies for smart grid applications. IEEE Power and Energy Society General Meeting, 2010: 1-7.

[5] YU Hong-bo, LI Hui. Design and implementation of portable GSM wireless gas warning system. Control and Instruments in Chemical Industry, 2011, 38(11): 1360-1363.

[6] SHT1x/SHT7x datasheet v3.01. 2007. [2013-01-04]. http://www.sinocomopto.com/Upload/PicFiles/2008.6.18_14.29.32_9691.pdf

[7] CHEN De-hai, LIANG Yu-ming. Design of low power consumption wireless measuring nodes for greenhouse. Process Automation Instrumentation, 2010, 31(5): 65-68.

[8] ZHAI Shun, WANG Wei-hong, ZHANG Kan, et al. IOT SMS alarm system based on SIM900A. Modern Electronics Technique, 2012, 35(5): 86-89.

[9] LI Jin-long, WANG Li, GAO Xiao-rong. Design of wireless remote monitoring system for multiple temperature and humidity. Microcomputer Information, 2009, 25(16): 31-32.

[10] ZHU Fang, ZHANG Jian-wu, GAO Feng. A wireless data acquisition system design based on RF905. Journal of Hangzhou Dianzi University, 2007, 21(1): 29-32.

[11] LIU Run-hua, ZhANG Ya-nan, WANG Fei-fei, et al. Beam-pumping unit operation condition monitoring system design. Computer Measurement and Control, 2011, 19(12): 2961-2964.

date: 2013-02-23

YUAN Yao-dong (yyd19900108@163.com)

CLD number: TP274 Document code: A

1674-8042(2013)03-0267-05

10.3969/j.issn.1674-8042.2013.03.014