# Monitoring Citrus Soil Moisture and Nutrients Using an IoT Based System
## 2 Overall Structure
### System Structure  
The IoT platform design idea is applied to the real-time monitoring system of citrus soil moisture and nutrient. The system is divided into four layers: perception layer, network transmission layer, information service layer and application layer. The overall system structure is shown in Figure 1.  
Perception layer: Perception layer is mainly to achieve data acquisition and perception [15; 16] including citrus soil moisture and temperature, air humidity and temperature, soil nutrients and sensor space coordinate. According to the experiment, we found that the temperature and humidity at different soil depths at the same location can better reflect the environmental condition. So we use single-point multi-layer detection method and the soil depth of 20 cm, 40 cm and 60 cm was selected for monitoring. Soil moisture is measured by a special soil moisture sensor which can realize on-line detection. The output voltage of the sensor varies with the change of soil water content. Air temperature and humidity are measured using SHT17 digital temperature and humidity sensors (Sensirion, Zurich, Switzerland). There is no suitable on-line soil nutrient detection sensor. Nutrient change is slow and the measurement takes a long period of time. Therefore, the portable soil nutrient detector is selected to detect soil nutrients.  
Network transmission layer: It mainly includes the citrus orchard site wireless sensor network and data transmission facilities connected to the Internet. The data transmission network includes the short-distance transmission part of the citrus orchard and the data long-distance transmission part. Internet of Things Gateway is the core of wireless sensor network equipment which can achieve connection with the public network and protocol conversion. The short distance transmission in the citrus orchard uses ZigBee wireless communication technology and ad hoc network technology [17; 18], which has the advantages of low power consumption, strong mobility and other advantages in deployment and maintenance. The long-distance transmission uses GPRS [19; 20] to connect to the Internet server, which supports IPV4 and IPV6 on the transmission protocol. The concepts of rumor and gossip routing algorithms are widely employed in sensor networks [21] and ad hoc networks [22]. So we also use this method in our system. The main function of this layer is to transmit various agricultural information collected by the perception layer to the background network server through the network.  
Information service layer: This layer mainly includes hardware and software. The hardware part adopts PC cluster control and the local area network. The databases include the standard data sample database, the sensor network monitoring database, the citrus production database, the meteorological data and the citrus production domain knowledge database. These data provide information support services for the application layer.  
Application layer: it is an integrated information platform based on business logic. The software running on the platform include a sensor network management system, a WEB GIS-based monitoring data query and analysis system, and a citrus precision fertilization decision support system. Sensor network management system proposes optimal layout recommendations based on the citrus orchard sensor network optimization distribution model. The data query and analysis system based on WEB GIS can get the humidity, temperature and nutrient value of citrus soil. The data are obtained from the real-time monitoring database of the sensor network in the GIS spatial database through data fault correction. According to soil moisture and nutrient status, fruit growers use citrus growth model and citrus precision fertilization and irrigation support model to obtain the citrus fertilization irrigation support decision.  
Figure 1: Overall system architecture diagram.