Data Collection of Digital Monitoring System for Agricultural Facilities Environment

In order to realize the intelligent control of the agricultural facility greenhouse environment cluster, the paper designs and implements an agricultural facility greenhouse environment cluster monitoring system based on RS485 bus and Modbus protocol. The system consists of on-site data acquisition and control part, remote monitoring centre monitoring software part and communication protocol part. We use the RS485 bus with Modbus protocol to realize the communication between the monitoring centre host and the microcontrollers of each greenhouse. The paper uses the BP neural network PID control algorithm to achieve the intelligent control of the agricultural greenhouse environment. Use Qt software to design a human-computer interaction interface to realize remote control of the greenhouse cluster. The experimental results show that the system can correctly collect the temperature, humidity and light intensity of the agricultural greenhouse environment, and can effectively control the environmental parameters of each greenhouse through the action of the control relay.


Introduction
Agriculture is closely related to the country's economic foundation and plays a significant role. my country has a large population and is still a developing country. At present, my country's greenhouses mainly pass manual inspections, and their efficiency is very low. If you want to get the greenhouse data such as air temperature, humidity, light, soil temperature and humidity, and the content of inorganic elements in the soil, you must personally check the thermometer, humidity indicator or other equipment. Usually, the greenhouse is managed based on past experience. There are already some crop automation management systems at home and abroad, which can provide farmers with integrated services of planting intelligent systems, such as measurement, configuration, operation and fertilization, thereby realizing scientific management of agriculture. However, these intelligent systems are not only large, but also very expensive and do not have the function of managing the batch of crops, nor can they provide an alarm function. Therefore, it is difficult to popularize. The management of traditional largescale greenhouse clusters is mostly to monitor and control the single factor of the greenhouse environment, and it is manually managed, which cannot accurately achieve the comprehensive monitoring and remote control of the greenhouse environment [1]. In order to be able to collect, display and intelligently control the ecological environment parameters of each greenhouse in the greenhouse cluster, using the Internet of Things technology, an intelligent monitoring system for the environmental parameters of the greenhouse cluster has been developed.

System Design
The intelligent monitoring system of facility agriculture environment based on wireless sensor network is designed based on the application of agricultural Internet of Things, including CPU main control module, wireless sensor network and cloud application software management system. The CPU main control module consists of peripheral circuits, power control circuits and memory the wireless sensor network includes temperature sensors, humidity sensors, carbon dioxide sensors, image sensors, and light sensors [2]. The cloud software management system consists of PC application management software and mobile application management software. The overall system framework is shown in Figure 1. The system hierarchy is shown in Figure 2. The system is composed of a perception layer, a network layer, an application layer, a user layer, etc. The perception layer is wireless sensor terminal equipment, which realizes the collection of facility environment data; the network layer realizes the wireless network data transmission function; application the layer is the back-end service system data centre and mobile terminal application management software; the user layer is the system manager and facility crop growers.

Hardware design
The hardware part of the system is mainly composed of a data acquisition system, a wireless communication system, an embedded main control system, and a greenhouse environment adjustment system. The data acquisition system is mainly composed of a single-chip microcomputer combined with sensors, which is mainly responsible for sensing the temperature, humidity and light conditions in the greenhouse; The wireless communication system uses the NRF24L01 module, which works in the 2.4-2.5G ISM frequency band, which can be easily combined with various embedded control boards to complete wireless data transmission; the embedded main control board is responsible for receiving The data of each wireless transmission module is compressed and transmitted to the cloud server through the Internet network [3]. At the same time, the commands issued by the server are analysed and the corresponding control actions are executed. For example: when the temperature inside the greenhouse rises significantly, and the temperature sensor accepts that it has reached or even exceeded the present maximum temperature, it will transmit this danger signal to the embedded main control core board, and the embedded motherboard will obtain this After a signal, immediately analyse and process, turn on the exhaust switch in time, and perform cooling and cooling operations. At the same time, the laser scanner, humidity sensor, pH sensor and other devices in the system are used to collect the information in the soil, and then the optimization technology set by the scientific and technical personnel in the intelligent system is used to obtain the best decision and formulate a reasonable plan. Meet the growth needs of crops. The hardware structure of this system is shown in Figure 3.

Software design
The software design of the agricultural facility monitoring system is more complicated, which requires high reliability and flexibility. When designing the monitoring software, it is necessary to ensure that any functional module can be executed immediately when its trigger condition occurs, and the operation is completed within the allocated time period, otherwise it will affect the normal operation of the entire system [4]. The design content includes the choice of operating system platform, programming language and the design of real-time application software structure. The operating platform of this system selects the Windows95/98 operating system, which is currently the most widely used and most convenient to use. Because the structure of this system is a microcomputer network communication mode, the whole system can be divided into several independent modules, each independent module has its own microcomputer controller, which uses multiple high-level languages for programming. The 51 series single-chip computer program in the front desk adopts C language programming, which has the advantages of simple programming, clear structure, powerful functions, etc., which can greatly improve programming efficiency and system stability. The main function of the program is to read in the measured value of each sensor and compare it with the corresponding upper and lower limit control alarm points, and then open and close each control device according to the internal control algorithm; store the measurement data in the internal in the large-capacity memory with power-down protection, data will not be lost even if the power is off; in the online operation state, the detected data will be automatically transmitted to the host.

Measurement and storage functions
The function of measurement is to monitor various environmental parameters of various agricultural facilities (greenhouses, livestock and poultry houses, etc.), including air temperature, humidity, CO2 concentration, light intensity, and soil Automatic monitoring of environmental conditions such as temperature and humidity. The measured parameters can be stored online in the database, and all data can be manually or automatically backed up to the tape drive.

Data management function
All online monitoring data and manually entered data are stored in various databases according to data types. The operator can quickly retrieve the data that meets certain constraints, display it in a table or other forms and print it out, and can perform data on these data at any time. Query, statistics, tabulation and plotting curves.

Control function
The equipment that needs to be controlled in the system can be set on the host through the system settings window to achieve automatic adjustment; it can also be manually adjusted on the front desk, but the operation of the control program on the host can only be controlled by qualified personnel through the password. It can be entered, and the control command issued by the operator will be sent back to the front desk after it is received, and it can be formally executed after the operator confirms it.

Remote monitoring function
In order to enhance the ability of monitoring and management and ensure the safe and reliable operation of the system, the software also has the function of using the local telephone network for data transmission and remote monitoring. The system can transfer important data or files in a timely and accurate manner between the monitoring centre and the front desk machine or even remote technical support departments [5]. In addition, once a wired connection is established between the monitoring centre and the technical support department, the monitoring data can be transmitted to the technical support department in real time, so that technicians can understand the operating status of the system, find problems and take measures in time. The improved program can be transferred back to use immediately, effectively reducing the cost of on-site maintenance and improving the quality of the system's after-sales service.

Control Algorithm Design
In order to keep the temperature and humidity in the greenhouse from being affected by the outdoor temperature and humidity, and to always keep the temperature and humidity in the greenhouse under the best temperature and humidity for current crop growth, it is difficult to meet the requirements of rapid, effective and stable due to conventional PID control., The application of PID control algorithm based on BP neural network makes the control system more rapid and efficient [6]. The controller  Figure 4. The parameters KP, KI, KD of the PID controller are adjusted through the self-learning ability and nonlinear approximation ability of the BP neural network, so that its output corresponds to the PID parameters under optimal control. Through analysis, we use the inversion algorithm and modify the weight coefficient of the network according to the gradient descent method to obtain the weight learning algorithm of the network output layer: