The Construction of a Precise Agricultural Information System Based on Internet of Things

.


INTRODUCTION
Agriculture is the most fundamental to mankind and guarantees social development and advancement [1][2][3]. The technology of the digitization of information is one of the key components of modern agriculture and has a significant role in realizing the automatic supervision and intelligent management of the production environment [4][5][6]. However, the complexity of farmlands and the growing status of crops have imposed challenges on the monitoring and management of agricultural environments. The technology of the Internet of Things (IOT) offers a brand new perspective in this regard [7][8][9][10]. IOT literally means the network featuring inter-connectivity, which can connect any object to the Internet, exchange and communicate the information, and achieve final intelligent management. As a result, a wireless sensor network can collect information for IOT and solve agricultural monitoring problems [11]. Various researchers have realized the monitoring of environmental conditions by sensor networks, such as Zigbee [12,13], Wi-Fi [14], Bluetooth [15], Global System for Mobile Communications (GSM) [16], and RFID [17]. The sensor networks access the Internet through 3G [18], GPRS [19], Wi-Fi [20], and others. The IOT gateway is mainly used for the access of heterogeneous networks and forwarding protocol. At present, the research on IOT is based on the development of specific network. In this study, a processor with high-speed computing power is used in the system. It can achieve a variety of heterogeneous network interfaces, has a wide range of network access capabilities, and can meet the requirements of management for intelligent gateways. By contrast, the rapid development of an embedded system facilitates the easy modification of the system's software and hardware [21][22][23]. It has prominent portability and can be customized based on actual demands. It features in strong network functions and free original codes, which substitute for most of the functions of the traditional PC and bring out the advantages in monitoring. This study therefore uses the wireless sensor network to collect and control; it also adopts the ARM built-in ARM gateway to realize the collection and control of information in the agricultural production field and to set up an agricultural intelligent and high-precision system of IOT, which can be remotely controlled at the client-side.

II. OVERALL DESIGN
According to the monitoring of agricultural production, we establish the wireless sensor networks by means of Bluetooth, 2.4 GHz, Zigbee, GSM, and Wi-Fi. All these wireless networks fully supervise all the parameters in the process of agricultural production and set up the relative threshold values. The ARM gateway of the built-in Linux system serves as the gateway for integrating and supervising the wireless sensor networks. The framework of the system is shown in Figure 1. The ARM gateway continuously integrates the data with each monitoring point and stores the collected data in SQLite database, from which it reads the control information and sends it to the monitoring point in the wireless sensor network. The users can check the information at each monitoring point by clicking the touching screen by means of Qt program, or they can request the monitoring point to feedback the information collected by the gateway by sending a message. In addition, users can enter the IP address in their PC or smart phone browsers to visit the web servers lighttpd and achieve the supervision and operation at each monitoring point in the wireless sensor network. Through this method, users can check the temperature, humidity, information on the longitude and latitude, and the video anytime and anyplace they want, contact, and conduct necessary agricultural operations, such as heating, wetting, and irrigation at each necessary point.

A. Design of the Bluetooth wireless sensor network
The Bluetooth wireless sensor network in this system is used for monitoring the warehouse. Two Bluetooth nodes are set in the network, each equipped with temperature and humidity sensors, GPS module, heating device, and alarm device. Each node of the Bluetooth sensor network continuously collects information on temperature, humidity, longitude, and latitude. Such information is processed upon the receipt of instruction from the ARM gateway via the Bluetooth adapter. If the instruction is to collect, then MCU sends out the information on temperature, humidity, longitude, and latitude via the Bluetooth module, and the AMR gateway drives the Bluetooth adapter to receive and store the data in the database. The data can be observed at real time by clicking the touching screen. If the instruction is to control, the heating and alarm devices are controlled. The topography of the Bluetooth sensor network is as shown in Figure 2.

B. Design of the 2.4 GHz wireless sensor network
The function of the 2.4 GHz wireless sensor network in the system is to control the room temperature. Two nodes of 2.4 GHz are set in the network, each equipped with temperature and humidity sensors, GPS module, heating device, and nebulization device. The collection point of the 2.4 GHz sensor is based on an MCU with low power consumption and is connected to the ARM gateway via serial ports. The node of 2.4 GHz continuously collects and sends at 1 s data on temperature, humidity, longitude, and latitude to the collection point, for the ARM gateway to read out. If the node receives the instruction of control, the control heating and nebulization devices are employed. The collection point transmits the instruction upon receipt to the corresponding 2.4 GHz node. If the instruction is to read the data, the MCU of the collection point sends the latest collected information on temperature, humidity, longitude, and latitude to the ARM gateway via the serial ports. The ARM gateway receives and stores the data in the database, and the data can be observed at real time by clicking the screen. The topography of the 2.4 GHz sensor network is as shown in Figure 3.

C. Design of the Zigbee wireless sensor network
The Zigbee wireless sensor network monitoring system is used for farmlands. Two Zigbee terminal nodes and two Zigbee routes are set up. The terminal nodes are equipped with temperature and humidity sensors, GPS module, heating device, and irrigation device. The Zigbee collection point is connected to the ARM gateway through the serial ports. Under the operation mode, each Zigbee terminal node continuously collects information on temperature, humidity, latitude, and longitude. If the Zigbee terminal node receives read data instruction, the data are sent to a collection point by routing transmit to the collection point through the RF mode. After receiving the data, the collection point transmits to the ARM gateway through the serial ports. The ARM gateway receives and stores the data in the database, and the data can be observed at real time by clicking the screen. The Zigbee terminal node controls the heating and irrigation devices upon receipt of the control instruction. The topography of the Zigbee sensor network is as shown in Figure 4.

A. Implementation of the Bluetooth network
The Bluetooth wireless sensor network node involves passive transmission. Its major work consists of collecting local information and sending the data to the collection point only when the collection of the data is completed. Upon receipt of the control instruction, the external hardware of the MCU can be operated. The design of the software for the sensor's node is shown in Figure 5.

B. Implementation of the 2.4 Ghz network
The 2.4 GHz wireless network sensor node involves initiative transmission. The data are sent to the collection point upon the completion of collection, and the sensor monitors if the instruction is received or not. If any instruction is received, it will control the external hardware of the MCU. The sensor node software design process is shown in Figure 6. The software design of the 2.4 GHz wireless network rendezvous node is as shown in Figure 7. Once initialized, the rendezvous node can determine whether or not the nodes have received the data. After the receipt of the data, their source and attributes are stored in the inter-buffer zone, and whether or not the collection instruction has been received from the built-in gateway is determined. If the collection instruction is received, the data are transmitted back via the serial ports; if no instruction is received, it will determine if it has received the control instruction. If received, the control instruction is transmitted to the nodes via wireless communication, and a new cycle program is performed once again.

C. Implementation of the Zigbee network
The node of the Zigbee wireless networks includes terminal and coordinator nodes. The terminal node software initializes the device and starts the sensor timer; when the time expires, it starts collecting data from the sensor. When the data reception event is triggered, it determines if it has received the data collection or control instruction. If the data collection instruction is received, the data are transmitted. If the control instruction is received, the external hardware is controlled, and the next round of event references proceeds. The flowchart is as shown in Figure 8.
The implementation of the coordinator node software involves initializing the device. When the data reception event is triggered, it determines if it has received the data collection instruction or control instruction. When the data reception event is triggered, it is determined whether to follow the collection instruction or control instruction. If the former, the data are transmitted, and the data from the terminal are prepared to be received and are forwarded to the built-in gateway via the serial ports. If the latter, the next round of event reference is conducted. The flowchart is as shown in Figure 9.

D. Implementation of the built-in gateway 1) SQLite database design
The function of the SQLite database in this study is for the processing of the interaction wireless sensor network, Qt display routine, and PHP website. In the database file, two schedules are established-the data and the controlas shown in Figure 10. The data schedule stores the data sent from the wireless sensor network and provides the reference for the Qt display routine and PHP website. The control schedule stores the control instruction of the PHP website and is for the use of the Qt delivery program.

2) Implementation of the Qt application program
The Qt application program facilitates the users' access to information at each node with smart phones even without PC and is therefore of great convenience. Once initialized, the program appears in the main interface, displays the keys for the three major modules, each of which can be entered by clicking the touching screen. After entering the Bluetooth interface, the base and two nodes (One and Two) can be seen. By touching the key "Begin," the program retrieves the data from the base and in turn displays them at the two nodes at a certain interval. A symbol exists for the connection between the nodes and the base. Clicking "Close" initiates a return to the main interface. When entering the interface of the 2.4 G module, the data distribution at the two nodes is relatively clear only by clicking the key "Begin" to start and end by clicking the key "Close." One red spot exists on the interface after entering the Zigbee interface, which is the collection point. The other two green points are the nodes. The connection status and data can be shown by clicking the key "Begin," and a return to the main interface is made by clicking the key "Close." The flowchart of the Qt program is as shown in Figure 11.

V. SYSTEM TEST
For the data structure and transmission mode between the wireless sensor network and bus networks, the Internet and other networks are not identical. This study develops a system to realize the unified conversion of the heterogeneous network protocol and the unified management of the network nodes. It meets the rapid deployment and application of IOT in agricultural production and can guide the development of agricultural production in terms of precision, information, and intelligence. The functions in the system can be tested as follows: First, the sensor network is set up according to the conditions in the agricultural production field. Second, the networks are integrated through interaction with the IOT gateway. Finally, the precise agricultural intelligence is implemented based on IOT. The hardware system is shown in Figure 12. To be more specific, the data collected by the sensors in the wireless networks are transmitted to the ARM gateway and stored in the database. The users can check at or visit their terminal or receive a message from it. The ARM gateway can receive the user's instruction with which the terminal nodes can be manually or automatically controlled. In addition, the agricultural production field can be observed through Wi-Fi camera at real time. The effect is as shown in Figure 13. The technology of wireless data communication and sensor networks has become one of the crucial areas in IOT application in modern agriculture. The sound development of IOT will tremendously boost the advancement of precise agriculture in China by realizing automation, intelligence, and modernization. It has already facilitated the design of an intellectualized system with the integration of Zigbee, Bluetooth, 2.4 GHz, Wi-Fi, GSM, and built-in modules based on precise IOT and the precondition of low power consumption. It can further be applied in agricultural production, particularly in farmlands, warehouses, and greenhouses. The system has been tested and has delivered the expected effects and functions.