# Greenhouse Wireless Monitoring System Based on the ZigBee

Minghua Shang, Guoying Tian, Leilei Qin, Jia Zhao, Huaijun Ruan, Fengyun Wang

► To cite this version:

Minghua Shang, Guoying Tian, Leilei Qin, Jia Zhao, Huaijun Ruan, et al. Greenhouse Wireless Monitoring System Based on the ZigBee. 6th Computer and Computing Technologies in Agriculture (CCTA), Oct 2012, Zhangjiajie, China. pp.109-117, 10.1007/978-3-642-36124-1_14. hal-01348088

HAL Id: hal-01348088

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

Submitted on 22 Jul 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
Greenhouse Wireless Monitoring System Based on the
ZigBee¹

Minghua Shang¹, Guoying Tian², Leilei Qin*, Jia Zhao¹, Huaijun Ruan¹, Fengyun Wang¹

¹S&T Information Engineering Research Center, Shandong Academy of Agricultural Sciences, Jinan, China

²Shandong Product Quality Supervision & Inspection Research Institute, Jinan, China
*Corresponding author, Address: S&T Information Engineering Research Center, Shandong Academy of Agricultural Sciences, Jinan, China. Tel: +86-531-83179076, Email: seqsoft@163.com

**Abstract.** Designed a WSN-based wireless monitoring system for greenhouse environment. The overall structure of the system is introduced. The design and realization of the monitoring node, the gateway node and the upper computer system are respectively described. Through the practical application in the greenhouse, it is proved that the system comprehensive performance is significantly better than the traditional greenhouse monitoring system.

**Keywords:** Greenhouse, Monitoring, WSN, ZigBee

# 1 Introduction

The traditional greenhouse monitoring system is mainly based on the cable communication mode which has a series of questions such as complex wiring, difficult maintenance, inflexible deployment for sensor nodes and so on. These questions limit the popularization and application of greenhouse monitoring system to some extent. With the rapid development of modern information technology, there are many kinds of wireless communication technology such as WiFi,bluetooth,ZigBee and so on.WiFi and bluetooth etc cannot be widely used in greenhouse monitoring field because of its high cost and large power consumption etc shortcomings. As a brand new information acquisition and processing technology, the wireless sensor network based on ZigBee has a big scale, small volume, low cost, AD hoc network etc characteristics which has wide application prospects in agricultural environment monitoring field.

In view of the problems and shortcomings occurred in the current monitoring system of greenhouse environment, a wireless monitoring system for greenhouse is designed in this article which has designed low power consumption, low cost, flexible

¹ Supported by: Science and Technology Development Plan of Shandong Province, China (2011GGC02035)
networking, friendly interface, convenient on-site and remote management. It is
successfully applied.

## 2 Overall Design

### 2.1 System Requirements Analysis

The environment in greenhouse has many features such as large temperature
difference between daytime and nighttime, large air humidity, bad gas
exchangeability, poor light intensity, strong soil acidity and so on. There are more
crop species planted in greenhouse with dynamic change. The monitoring area is large
and monitoring parameters are too many. In addition, the farmer is also very sensitive
to whole cost and reliability of monitoring system. Through investigation and
analysis, most of the current acquisition demand for greenhouse monitoring
environmental parameter is mainly focused on six factors i.e. air temperature and
humidity, soil temperature and humidity, light intensity, concentration of CO2. In
addition, a few greenhouses also need to collect EC value, pH value of nutrient
solution and outdoor weather factors and other information. The quantity of sensor
nodes can increase or decrease at random and the nodes can change its position
without affecting the normal operation of the system according to crop growth,
species replacement or greenhouse space structure change etc. The system is with
intuitive interface, comprehensive analysis easy to use and low application cost etc.

### 2.2 Overall Structure

In accordance with the characteristics of greenhouse monitoring system and the
above mentioned function demand, this paper integrates the wireless sensor network
technology, ZigBee technology and embedded technology to design the wireless
sensor network monitoring system based on ZigBee for greenhouse. The whole
system hierarchy is shown in figure 1.
<figure><img src="image_2.png" /><figcaption>Fig.1. Framework of the greenhouse wireless monitoring system</figcaption></figure>

The system consists of monitoring node, gateway node and a host computer three layers. Monitoring node includes sensor node and actuator node deployed in greenhouse monitoring region which is automatically establish unified wireless sensor network through the ZigBee protocol. Each sensor node collects the real-time greenhouse environment data to the gateway node by multi-hop routing mode, the actuator nodes receives the real-time control orders from gateway node to control the fan etc actuating mechanism. The gateway node realizes the local communication through the serial port or remote communication through the Ethernet and GPRS etc modes which provide the sending support for monitoring data and control data. Host computer system provides a user interface to realize the interactive management operation between the user and system.

# 3 Monitoring Node Design

## 3.1 Hardware Design

Monitoring nodes are the base of greenhouse monitoring system which is the basic unit to information perception, executive control and network function of wireless sensor network. According to different division of labor, monitoring nodes are divided into the sensor node and actuator node which are introduced as follows.

### 1) Sensor nodes

The hardware design core of sensor node is microprocessor chip. The microprocessor of node finishes data acquisition, data processing, wireless
communications etc functions in collaboration with the wireless transceiver module. The hardware structure diagram of wireless sensor node is shown in figure 2. The hardware design of wireless sensor node mainly considers the low cost, low power consumption, stability and reliability etc factors.

<figure><img src="image_3.png" /><figcaption>Fig. 2. The hardware structure of the sensor nodes</figcaption></figure>

### a) CC2530

Considering the cost and performance etc factors, CC2530 is selected. It integrates the microprocessor module and a wireless transceiver module in one single chip. CC2530 is introduced by United States TI companies for IEEE802.15.4 and ZigBee application. At present, it is also one of the most outstanding microprocessor among many ZigBee equipment product.

Its main features are as follows:

* enhanced high speed 8051 kernel;

* support the latest ZigBee 2007PRO protocol;

* support 2v-3.6v power supply range;

* 3 power management mode: the wake up mode 0.2mA, sleep mode 1uA, interrupt mode 0.4uA, with ultra low power consumption characteristics;

* high density integrated circuit.

The node design based on the CC2530 only needs few peripheral circuit to realize data acquisition and transmission which greatly improves the reliability and reduce the power consumption of the system.

### b) Sensor

In the selection of sensor, it is required that the sensor has higher precision and lower power consumption. It adopts 5 sensors in this design. Their technical parameters are as follows:

* SHT11 digital temperature and humidity sensor, detecting current 0.5mA, standby current 0.3uA, temperature accuracy ±0.5°C, humidity accuracy ±3.5%RH, I2C bus interface.

* ISL29010 digital light intensity sensor, detecting current 0.25mA, standby current 0.1uA, measurement accuracy ±50Lux, I2C bus interface.

* H550 digital CO₂ sensor, working current 15mA, accuracy ±30ppm, I2C bus interface.

* SLST1-5 digital soil temperature sensor, measuring current 1.5mA, standby current 1uA, measurement accuracy ±0.5℃, single bus interface.
* FDS100 simulation model of soil moisture sensor, working current 15mA, accuracy ≤3%, analog output signal.

## 2) Actuator nodes

The actuator node carries out switch control for indoor fan, sunshade etc equipment according to the control command from the host computer. The actuator node includes a drive circuit, but not includes the sensor circuit. The hardware structures of actuator node and sensor node are approximately same. The drive circuit of actuator node is mainly used to control solenoid valve associated with the actuator etc switch equipment which can output multichannel high-low level control signal. Data communication is of master-slave mode.

## 3.2 Node Software Design

The chip program of sensor node is based on the Z-Stack protocol. Its development environment is IAR 7.51A. Z-Stack is Zigbee protocol stack launched by TI company in April, 2007. It has been generally accepted and widely applied within the industry because of full support for Zigbee2006 and Zigbee PRO feature set and conforming to the latest intelligent energy standard. The protocol stack provides a protocol stack scheduler named operating system abstraction layer (OSAL). For developers, except being able to see the scheduling procedure, the specific implementation details of any other protocol stack operation are encapsulated in the library code. For the specific application development, the corresponding operation is finished by calling the API function interface of protocol stack, such as network device initialization, network configuration, network starting, collected data transmitting, control command receiving and so on to realize ad hoc network of wireless monitoring nodes distributed in several greenhouses. In addition, the node software designs flexible, convenient, dynamic configurable regular data collection, regular sleep and wake-up etc functions in order to further reduce the node power consumption.

# 4 Gateway Node Design

## 4.1 Gateway Node Hardware Design

The gateway node is the key device to realize the protocol conversion between wireless sensor network and external communication network. It not only has the function of data transmission, but also has equipment management function. When design the gateway node, follow the concept of modular design that the gateway system is divided into data collection module, processing/storage module, access module and power supply module.

The design is based on S3C2416 core board and establishes the hardware platform of gateway node of wireless sensor network. The hardware structure of gateway node is shown in figure 3.
<figure><img src="image_4.png" /><figcaption>Fig.3. The hardware structure of the gateway nodes</figcaption></figure>

1) **Data Collection Module**

It is the coordinator node in the wireless sensor network to achieve the data
collection and aggregation of greenhouse environment. In this design, the interface
type between data collection module and processing/storage module is UART which
communicate through serial.

2) **Processing/Storage Module**

It is the core module of gateway node. S3C2416 core board integrates Samsung S3C2416XH-40 processor based on ARM926EJ core which main frequency is 400MHz. In additio it also integrates 512MB DDR2 SDRAM and 128MB Nand Flash and provides abundant peripheral equipment interfaces so as to furthest reduce the cost of the system development which is very suitable for high cost-performance and low power requirements of embedded equipment.

3) Access Module

It mainly adopts ethernet mode to connect the gateway to the external network. The core board integrates local high-speed ethernet chip LAN9220 of SMSC company. It realizes the Ethernet data transmission under the support of operating system. Network transformer uses HR601680 which main function is to match the impedance, enhance signal and realize voltage isolation etc. In addition, GPRS, as an optional way, uses MC371 module of Siemens company.

4) Power Supply Module

The module is responsible for the power supply of gateway node. The power
module designed here has the function of hot plug and voltage conversion. The
possible power supply mode comprises utility power, solar power and storage battery.

4.2 Software Platform Design of Gateway

Embedded Linux is a small operating system designed in accordance with the
requirements for embedded operating system which consists of a kernel and some
system modules customized as per requirements. Its kernel is very small and has the
characteristic of multi-task and multi-process which is very suitable for
transplantating to embedded systems. This paper transplants Linux2.6 kernel and
associated drive on S3C2416 target platform and uses the open-source LwIP protocol
stack instead of the TCP/IP protocol stack of Linux system and then designs the
program on application layer of gateway node on the base of embedded Linux and
LwIP. It mainly realizes two functions i.e. gateway node configuration through Web
server and connecting Modbus serial communication link to ethernet through
Modbus/TCP protocol.
1) Web Server Function Design

In the gateway configuration mode, the gateway node serves as the Web server, while the client is any one computer that connects to gateway RJ45 interface through the crosswire.

After gateway reset starting, operating system will start the Web service. The client sends out a request of HTTP GET method to the gateway through the browser. After receiving the request, the gateway judges the method field of message. If it is the GET method, it is the first request and returns the configuration information of Web pages and gateway embedded in the Flash out of the chip back to the client. After parameters configuration, the user clicks SUBMIT and the client sends out POST request to the gateway. The gateway erases the original configuration information in the Flash out of the chip and then writes the new information so as to ensure that the gateway configuration is not lost after resetting and the configuration information will take effect after gateway restarting.

2) Modbus/TCP Protocol Conversion Function Design

After reset starting, the gateway firstly performs a series of initialization and
finally starts the Modbus server to realize the transmission between Modbus/TCP
frame and Modbus RTU frame in the serial link. When a client inquires, it firstly
sends out a connection request to 502 port of gateway, the gateway executes the
interrupt service program to awake Modbus server in a wait state and creates the TCP
connection, the client then sends a Modbus/TCP request frame and waits for a
response. The gateway analyzes the frame to generate a query frame of Modbus RTU
format to the serial link. If it receives RTU response frame in serial link, the frame is
encapsulated into a Modbus/TCP reply frame which is sent to the Ethernet client and
disconnect.

5 Design of Upper Computer System

The design is under VS.NET development environment and based on the SQL Server
database and C# language to write the monitoring management software of
greenhouse environmental information to complete the sensor node management and
data management of greenhouse environment. Its main function is as follows:

1) Real Time Monitoring

The user can view the latest environment parameters as well as the status of fan,
water pump etc control equipments in greenhouse field and can control and adjust in
the current interface which is convenient for users to operate.

2) Historical Data

User can inquire monitoring data through many modes can also make a period of
history data into curve to reflect the changes in greenhouse environment more
intuitively.

3) Device Control

It includes two modes i.e. automatic control and manual control. In manual mode, the user can remotely control the switches of fan etc equipments. In the automatic mode, the system can automatically adjust the switches of fan etc equipments according to the environmental monitoring parameters.
#### 4) Alarm Management

The user can define multilevel alarm conditions and can view the detailed information of set alarm. In an alarm condition, the user can specify the operation when alarming e.g. start alarm and turn on the switch of fan etc devices and send an alert notification etc.

#### 5) Node Management

It includes the display and configuration of node ID, node location, sensor types and parameters, sampling period, running state, update time etc attributes. The user can master the working status of all monitoring node in field and discover equipment failure in time.

# 6 System Application

## 6.1 Node Deployment Solution

The system designed in this paper is applied in 1# greenhouse of Ji'nan Modern Agricultural Science and Technology Demonstration Park. It is placed 12 nodes in the vegetable cultivation area in the greenhouse where includes 10 sensor nodes and 2 actuator nodes. In addition, one gateway node is arranged in management area in the greenhouse. The air temperature and humidity sensor, the light intensity sensor, CO2 sensor and the corresponding sensor nodes are integrated into one whole body, and the soil temperature and humidity sensors are respectively connected to sensor node by a cable and the other end is inserted into the soil about 8cm, cable length 1.5~2m. Each sensor node is placed on a monitoring node position through the fixed supporting rod or rope hanging upside down mode and the height from the ground is generally about 1.2m. The sensor node uses one 1# batteries and the actuator nodes and gateway nodes use DC power supply.

## 6.2 System application

The average communication distance between the nodes is about 20m, the nearest distance between monitoring node and gateway node is about 100m. Through installation and operation, after starting of gateway nodes, the average time required for node binding and self organizing network establishing is less than 1min. The sampling frequency setting scheme of sensor node is 2min for air temperature and humidity, 10min for soil temperature and humidity, 3min for light intensity and 30min for CO2 concentration. After completing data acquisition and transmission, each node will automatically enter sleep state until the next sampling cycle wakes up. Through actual test, the system can support the dynamic adjustment of sensor nodes. When add, remove the nodes or temporarily change the position of the nodes, the operation of whole wireless sensor network will not be affected. The host computer system can receive and display temperature and humidity, light intensity and CO2 concentration etc environmental data from the sensor nodes in real time and can
display real-time operating state of each node. When the collected environmental
parameters exceed the alarm threshold, if the control mode is of automatic control, it
will automatically start the corresponding mechanism according to the alarm
processing rules to realize the automatic control of greenhouse environment.

References

1. Guo Wenchuan,Cheng Saihan,Li Ruiming,et al. "Greenhouse monitoring system based on wireless sensor networks",Transactions of the Chinese Society for Agricultural Machinery,vol 41,2010(7),pp.181-185.

2. Zhang Ruirui,Zhao Chunjiang,Chen Liping,et al. "Design of wireless sensor network node for field information gcquisition",Transactions of the CSAE,2009,25(11),pp.213-218.

3. Zhang Rongbiao,Gu Guodong,Feng Youbing,et al. "Realization of communication in wireless monitoring system in greenhouse based on IEEE802.15.4", Transactions of the Chinese Society for Agricultural Machinery,vol 39,2008(8),pp.119-122.

4. Cui Xunxue,Zhao Zhan,Wang Cheng. "Field applications and design technologies of wireless sensor networks",National Defense Industry Press,2009.

5. Sun Hui,Lu Songnian, Yang Shutang. "Research and implementation of the embedded web server based on Linux and the processor of S3C2410",Computer Applications and Software,vol 24,2007(2),pp.134-136.

6. Zhang Jie,Cao Weihua,Wu Min,et al. "Porting Linux to S3C2410",Microcomputer Development,vol 15,2005(6),pp.142-144.

7. Wong Jiannian,Zhang Hao,Peng Daogang,et al. "On embedded ARM-based modbus/TCP protocol and its implementation",Computer Applications and Software,vol 26,2009(10),pp.36-38,68.

8. Huang Zhiwei,Deng Yueming,Wang Yan. "Design course for ARM9 embedded system", Beijing University of Areonautics and Astronautics,2008.

9. Gan Yong,Wang Hua,Chang Yajun,et al. "Design of ZigBee gateway system based on ARM",Communications Technoloty,vol 42,2009(1), pp.199-201.

10. Li Wenzhong,Duan Chaoyu. "Experiment and Practice on ZigBee2007/PRO protocol stack", Beijing University of Areonautics and Astronautics,2009.