# A Design of Greenhouse Remote Monitoring System Based on WSN and WEB

Jun Wang, Gang Liu

► To cite this version:

Jun Wang, Gang Liu. A Design of Greenhouse Remote Monitoring System Based on WSN and WEB. 5th Computer and Computing Technologies in Agriculture (CCTA), Oct 2011, Beijing, China. pp.247-256, 10.1007/978-3-642-27275-2_27. hal-01361145

HAL Id: hal-01361145

https://inria.hal.science/hal-01361145

Submitted on 6 Sep 2016

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
A Design of Greenhouse Remote Monitoring System
Based on WSN and WEB

Jun Wang ¹,², Gang Liu ¹

¹ Key Laboratory for Modern Precision Agriculture System Integration Research, Ministry of Education, China Agricultural University, Beijing 100083, China

² College of Vehicle & Motive Power Engineering, Henan University of Science and Technology, Luoyang 471003, China

**Abstract.** Wireless sensor networks (WSN) are increasingly popular in the field of greenhouse environment monitoring. In this paper, a new design of greenhouse remote monitoring system based on WSN and WEB is presented. The system has a three-tier structure of node layer, distributed management layer and WEB service layer. Experiments showed that the node layer has excellent self-organization and communication ability. The maximum distance of one-hop is 856 m. The distributed management layer can acquire and manage the data of temperature, humidity, light and the level of the carbon dioxide, and simultaneously send the data to WEB server database through the Internet. The WEB service layer can complete format storage, statistical analysis and conditional query for database, also ordinary users can obtain the graphic display of the greenhouse environment data through web browser. Normal working time of system reaches 141 days in the experiment. Meanwhile, normal operation rate exceeds 92%. Packet transfer rate of each sensor node is higher than 89.6% and lower than 95.4%. The greenhouse remote monitoring system based on WSN and WEB can realize an organic combination between distributed management and remote data sharing throughout different regions.

**Key words:** Greenhouse monitoring; Wireless sensor networks; WEB; Sensor; ARM7
# 1. Introduction

Greenhouse has played a key role in the development of agriculture. Due to the increased demand of food, people are trying to put extra efforts and special techniques to multiply the food production. Use of different technologies towards greenhouse is one of such efforts. Apart from scientific technologies in greenhouse, information technology is now being heavily exercised to improve decision making capabilities in this area. Recently, wireless sensor networks (WSN) attract intensive research efforts due to easy deployment and a large variety of application scenarios. Wireless sensor networks provide the capability of self-organizing, self-configuring, self-diagnosing and self-healing which enable un-interrupt, in-field sensing, measurement, and control [1,2]. Greenhouse production commonly features as remote, variable, harsh, and sometimes hard to access. Hence, continuous monitoring can be difficult to realize. With the advancement of wireless communication, micro-electronics, and computer technology, wireless sensor networks show advantages in these applications, and make it possible to acquire spatial and temporal knowledge about greenhouses [3,4].

The main purpose of wireless sensor networks in greenhouse is to keep the process of real-time monitoring and control the most suitable environment for growing crops in accordance with expert knowledge [5]. A large number of nodes can collect and transmit data cooperatively in different regions. However, the essence of wireless sensor networks is a distance-limited distributed system. Data management is the key problem of application. Different regional greenhouses need a remote background system to support the task. In recent years, greenhouse remote monitoring technology based on WEB has received more and more attention with the rapid development of the Internet [6]. The combination of WSN and WEB is a very positive direction in greenhouse practices. In this paper, we describe the features and architecture of the greenhouse remote monitoring system, and the approach of distributed data processing by Web application services.

# 2. System architecture

Fig. 1 shows the system architecture, which comprises three basic tiers as below.

The sensor application tier: This tier contains the wireless sensor nodes and the sink node. For environment monitoring, sensor nodes are usually distributed to certain
greenhouses determined by geographical constraints or user requirements. These nodes can self-organize themselves into a WSN, which continuously generates and delivers environment data to the sink node. The information may include temperature, humidity, light and carbon dioxide. Issues about the manner of sensing, reporting and communication protocol are critical in designing this tier.

The distributed management tier: The distributed management tier obtains each greenhouse group data from the sink node through the serial cable. The environment data is forwarded to local processing program for analysis, calculation and visualization. For more comprehensive data processing, some professional platform could be introduced, which is powerful in handling large amount of data.

The WEB service tier: The distributed management tier uploads environment data to the WEB server tier via the Internet. As an important feature of the system, remote users can access the data via Web interfaces. Following this way, users are able to gather, visualize the data from the server. In consideration of the WSN security, users are only provided with data surveillance but assumed having no authority to change parameters of the fundamental tier.

<figure><img src="image_2.png" /><figcaption>Fig.1 System architecture</figcaption></figure>

# 3 Design and implementation

## 3.1 Sensor application tier

Sensor nodes should have abundant functions, such as data acquisition, data transmission and friendly interface [7]. In order to realize the above functions, sensor
node mainly includes four units. First, sensor unit completes information collection and data transformation. Second, microprocessor unit is responsible for nodes control, data processing and the collected data transmission. LPC2131 is selected as processor. 12-Bit serial A/D converter MAX186 is used as the external A/D chip for conversion precision. Third, wireless communication unit adopts SZ05 wireless data communication module produced by shanghai shuncom network technology Co., LTD. The unit can effectively organize wireless network, send the collected data and receive instructions from distributed management tier. Liquid crystal display unit chooses graphic dot matrix unit LCM12864ZK, which undertakes the task of displaying greenhouse environment information.

The typical greenhouse environment is comprised of temperature, humidity, light, gas and soil, etc. Considering the impact on crop growth, the collection information includes temperature, humidity, light and carbon dioxide. Obviously, sensor is the basis of data gathering, the accuracy of sensor has an important effect on the whole system. The sensor selection should follow the principle of actual demand. The technical parameters of each sensor show in Table.1.

<table><caption>**Table.1 The sensor technical parameters**</caption><thead><tr><td>Types and models</td><td>Technical parameters</td></tr></thead><tbody><tr><td>Temperature& humidity sensor</td><td>Temperature:-40~123.8°C</td></tr><tr><td>DHT85</td><td>Humidity: 0~100%RH<br/>Sensor accuracy: 2.0%RH, 0.3°C @25°C</td></tr><tr><td>Light sensor</td><td>Measurement range: 0~200KLUX</td></tr><tr><td>SC-GZ</td><td>Sensor accuracy: ±5%</td></tr><tr><td>Carbon dioxide sensor</td><td>Measurement range: 0~2000ppm</td></tr><tr><td>T6004</td><td>Sensor accuracy: ±40ppm + 3% of measured value</td></tr></tbody></table>

SZ05 wireless data communication module is developed according to the standard ZigBee protocol. The topology structure of sensor application tier is designed as mesh network by considering transmission distance. Mesh network is a type of network where each node must not only capture and disseminate its own data, but also serve as a relay for other sensor nodes. All the nodes must collaborate to propagate the data in the network. The self-healing capability of mesh network enables a routing based network to operate when one node breaks down or a connection goes bad. As a result, the network is typically quite reliable, as there is
often more than one path between a source and a destination in the network. In the sensor network, all the nodes have been set in advance. There is only one sink node in a greenhouse group, which controls the data transmission. Relay routing nodes can forward other nodes' data to sink node through the way of multi-hop, and work as ordinary nodes. In order to avoid network congestion, sink node uses tour collection pattern [8]. The detailed steps of communication process are: 1) sink node sends data transmission command to relay routing nodes one by one; 2) relay routing node transmits environment data after receiving the command; 3) sink node uploads data packet to the distributed management tier, if data obtained within a period of single node collection; 4) if not, then sink node skips over the node and sends instruction to the next node. As shown in Fig.2, one period of single node collection can be approximately described as the following equation:

$$T_{task} = T_b + T_{reg} + T_{trans} + T_{route} + T_{sleep} \quad (1)$$

<figure><img src="image_3.png" /></figure>

<table><caption>Fig.2 Period of single node collection</caption><tr><td>T<sub>c</sub></td><td>time of a collection task</td><td>Treg</td><td>update time of routing</td></tr><tr><td>T<sub>i</sub></td><td>collection start time of node i</td><td>Ttrans</td><td>transmission time of node data</td></tr><tr><td>T<sub>i+1</sub></td><td>collection end time of node i</td><td>Troute</td><td>time of data reaching to sink node through multi-hop routing</td></tr><tr><td>Ttask</td><td>collection time of a single node</td><td>Tsleep</td><td>idle time of node</td></tr><tr><td>Tb</td><td>time of broadcasting control frame by sink node</td><td></td><td></td></tr></table>

The communication testing of sensor nodes is carried out as follows: 1) first, sink node respectively sends 50 control frames to every node according to the interval of 5 s; 2) compute the time T, which is from sending control frame to receiving data packet, 215ms ≤ T ≤ 1453ms. In addition to ensure the stableness of wireless communication modules, the sensor application tier still should have a reliable communication protocol. The data packet structure of monitoring system is designed, which is shown in Fig.3. The application message is consisted of network segment ID, node ID, type and information of sensor node, battery capacity. By using this packet structure, the sensor node periodically gathers sensing data and transmits through RF
channel.

<figure><img src="image_4.png" /><figcaption>Fig.3 Data packet structure</figcaption></figure>

## 3.2 Distributed management tier

The core of greenhouse remote monitoring system is distributed management tier, which is responsible for searching sensor nodes, sending instructions, receiving data, information management, processing alarm information and uploading data to WEB server, etc. The software of distributed management tier adopts C# language as the tool in Visual Studio 2008, and uses SQL Server 2008 to build database. In this tier, dynamic data analysis and other possible algorithms could be easily proposed and directly applied, reinforcing the software's extensibility. The software consists of three modules:

(1) Wireless communication control module: The module mainly operates RS232 interface to realize serial communication via the System.IO.PortsSAToPort class. This module controls sink node to send instructions to sensor nodes in point-to-point pattern. All the nodes respectively respond in master-slave pattern.

(2) Information management module: In the application process, the module completes a number of process functions, such as choosing greenhouses, setting working frequency, connecting the database, inquiring data information, visualization, statistics and so on.

(3) Data transmission module: The module sends the collected data to WEB server through the Internet. The steps for upload process are: 1) the distributed management tier establishes a Socket; 2) set up the WEB server IP address and service port; 3) issue a connection request; 4) start the data communication with WEB server after receiving a confirmation.
### 3.3 WEB service tier

The WEB service tier's hardware includes network connection equipments (routers, switches, etc) and server. The WEB service tier's software consists of WEB services program and database program [9]. In order to facilitate remote monitoring, the WEB service tier provides remote users with real-time data accessing, by broadcasting refined data packets over the Internet. In the opinion of data security, any user should first get permission from the server before browsing any information. In the system design, a user should first send a request to the server conveying its user name, password and its own Internet address. Then, this information will be checked by an embedded program to confirm whether the name and password are right. If it is permitted, an acknowledgement message will be sent back to this user. Fig. 4 shows the database table relationship of the tier.

<figure><img src="image_5.png" /><figcaption>Fig.4 Database table relationship</figcaption></figure>

As an end-user interface, the WEB service tier generally accomplishes four functions:

(1) Basic information maintenance: Maintain the basic greenhouse data (crop species, planting history, unit yield, etc.), and manage user registration.

(2) Data collection and storage: Use TCP Socket to receive data from the distributed management tier, and then compare with standard data format to judge the legitimacy of data, finally storage the correct data.
(3) Data process and inquire: Manage the upload data, then output statistical analysis of the real-time monitoring data, and provide the service of data inquire.

(4) Dynamic data browse: Authorized users can access WEB server via browser, and obtain the dynamic information of greenhouses through clicking hot-points on the electronic map.

# 4 System implementation and test

## 4.1 System deployment

In the experiment, 20×sensor nodes and 5×sink nodes are involved. All the nodes are assigned to five greenhouse groups respectively. Each greenhouse group only equips with a sink node. 6×PCs with one for the server and the other five for five greenhouse groups are used to test the ability of system. This experiment lasted for four months (August 2010-December 2010) and all the equipments ran to monitor in the greenhouse groups. Normal working time of system reaches 141 d. Meanwhile, normal operation rate is higher than 92%. The collection frequency of each node was set to 30 s. Sensor nodes were fixed on the wall in greenhouses. In order to prevent the influence of wall, the antennas of wireless communication modules extended 5 meters to the top of greenhouses.

Calculate the theoretical propagation distance of wireless communication in free space according the following equation:

$$[L_{fs}] = 32.44 + 20 \lg d + 20 \lg f \quad (2)$$

Where $[L_{fs}]$ is transmission loss. $d$ is transmission distance and $f$ is working frequency. The parameters of wireless communication module are: 1) working frequency is 2.425 GHz; 2) transmission power is 25 dBm; 3) antenna loss is 3 dBm per meter; 4) receive sensitivity is -94 dBm. The equation (2) can be expressed as the following equations:

$$[L_{fs}] = 10 - (-94) = 104 \quad (3)$$
$$104 = 32.44 + 20\lg d + 20\lg 2405 \quad (4)$$

The transmission distance *d* is 1.57 km through equation (4). Due to different kinds of interference, the actual propagation distance is less than the distance of theoretical calculation in practical application. The maximum distance of one-hop is 856 m.

## 4.2 Test performances

Fig.5 shows the dynamic curve of humidity, which is displayed in distributed management tier by Dundas Chart. As shown in Fig.5, the humidity range is 47.8% to 49.4% in a short time. Considering the sensor precision, the changes of data accord with greenhouse characteristics. These results demonstrate that sensor application tier has the excellent capability of self-organizing in the greenhouse, and effectively obtains the greenhouse environment data.

<figure><img src="image_6.png" /><figcaption>Fig.5 Dynamic curve of humidity</figcaption></figure>

Fig.6 shows the data monitoring curves of a greenhouse on August 27, 2010 through WEB browser. As shown in Fig.6, Temperature is more than the maximum 38 °C at almost 12:00 pm. Due to ventilation and thermal transpiration, humidity in the greenhouse shows a slow decline trend. Carbon dioxide maintains a good level. Meanwhile, light does not appear remarkable changes in the whole time. Through the above analysis, it can be found that the remote monitoring technology can help users to make rapid response and reasonable management methods by collecting real-time data.
<figure><img src="image_7.png" /><figcaption>Fig. 6 Data monitoring curves</figcaption></figure>

During the experiment period, the packets which are sent from each node to WEB service layer should be up to 2880 each day, according to packets received by the server, the packet transfer rate can be calculated through the following equation:

$$N = N_r / N_t \times 100\% \qquad (5)$$

Where N is packet transfer rate. N_r is actual number of received packets and N_t is ideal number of received packets. Each sensor node should send 2880 packets every day and the experiment lasted for 141 d. N_t can be expressed as 2880×141 = 406080. N_r is the received packets of each node in the server during the time. According to the equation (5), packet transfer rate of each sensor node can be calculated. The maximum rate is 95.4%, the minimum rate is 89.6%, and the average rate is 93.5%.

## 5. Conclusion

In this paper, a system based on WSN and WEB is presented, which has the capability of environment monitoring and data processing. Experiments are then demonstrated, which shows the system's well performance and the convenience to obtain data analysis. The system has made several achievements in: (1) The system is a practical environment monitoring application that sensor nodes periodically sense their ambience and the information can be eventually uploaded to the server. (2) Sensor information is extracted and visualized accounting for its authenticity. (3) The data from the server can be forwarded to all the users over the Internet which makes
remote monitoring system feasible.

Future work will employ more nodes and powerful sink nodes to provide long-term monitoring of five greenhouse groups. Besides, this system can be reinforced by introducing more efficient hardware working styles to make it less aware of environment disturbances.

**Acknowledgements.** This research is funded by National High Technology Research and Development Program of China (No.2011AA100704) and Major National Science and Technology Programs of China (No.2009ZX03001-019-02).

## REFERENCES

1. Xu N. A survey of sensor network applications[J]. IEEE Communications Magazine.2002,40(8):102--14.

2. Messer H, Zinevich A, Alpert P. Environmental monitoring by wireless communication networks[J]. Science.2006,312:713--714.

3. Serodio C, Cunha JB, Morais R, et al. A networked platform for agricultural management systems[J]. Computers and Electronics in Agricultural.2001,31:75--90.

4. Li Li, Li Hai-xia, Liu Hui. Greenhouse environment monitoring system based on wireless sensor network[J].Transactions of the Chinese Society for Agricultural Machinery, 2009,40:228--231. (in Chinese)

5. Wang N, Zhang N, Wang M, et al. Wireless sensors in agriculture and food industry-Recent development and future perspective[J]. Computers and Electronics in Agricultural.2006, 50(1):1--14.

6. Yang Wei, Lu Ke, Zhang Dong. Development of wireless intelligent control terminal of greenhouse based on ZigBee[J]. Transactions of the Chinese Society of Agricultural Engineering,2010,26(3):198--202. (in Chinese)

7. McKinion JM, Willers JL, Jenkins JN. Wireless local area networking for farm operations and farm management[A]. St. Joseph. ASAE Annual Meeting Papers[C]. Michigan, USA: The American Society of Agriculture Engineers,2004:1--6.

8. Zhang Rongbiao, Feng Youbing, Shen Zhuo. Communication method of star wireless sensor network for greenhouse dynamic measurement[J].Transactions of the Chinese Society of Agricultural Engineering, 2008,24(12):107--110. (in Chinese)
9. Sun Zhongfu, Cao Taihong, Li HongLiang. GPRS and WEB based data acquisition system for greenhouse environment[J].Transactions of the Chinese Society of Agricultural Engineering,2006,22(6):131--134. (in Chinese)