Plant Nutrient Solution Detection System Based on ZigBee Wireless Technology

Based on the limitations of traditional plant nutrient solution detection, a ZigBee plant nutrient solution detection system based on CC2530 was developed. This system uses CC2530 as the main control chip, DS18B20 as the temperature sensor for temperature acquisition, PH electrode sensor for PH value acquisition. The experiment shows that this wireless control system equipped with temperature and pH detection sensor collects and samples the main nutrient solution parameters through the main controller, performs wireless communication transmission and terminal communication, and realizes the intelligent detection of plant nutrient solution parameters. This technique of applying wireless sensor network technology to plant factories greatly improves the reliability and stability of the nutrient monitoring system.


Introduction
In plant factories, since the temperature of the nutrient solution changes faster than the temperature of the soil, it is crucial to keep the temperature of the nutrient solution constant and make it suitable for soilless cultivation [1] [2].Therefore, it is very necessary to collect and monitor the pH and temperature of the plant nutrient solution.Traditional plant monitoring systems are unable to monitor all-weather, real-time monitoring of large-scale plant growth, coupled with the influence of natural environments and human factors, resulting in greater errors in monitoring and thus affecting plant growth.This article uses the chip of CC2530 as the core control device, using temperature sensors DS18B20 and PH electrode sensors, respectively, for temperature acquisition and PH value collection, using ZigBee-based wireless communication technology for data monitoring, to overcome the shortcomings of traditional plant nutrition monitoring system [3] [4] [5].

Detection System Structure
The detection system is a remote wireless network monitoring system suitable for a plant plant nutrient solution [6].The sensor of the terminal acquisition node is used to detect the pH and temperature of the nutrient solution, and the ZigBee wireless sensor network is used for data transmission.The serial program receives the wireless data information in real time and stores it in the database.
The user can remotely access the web server through a browser, real-timely monitor the data collected by the terminal node, and can also perform control operations according to the data.The plant nutrient solution wireless remote monitoring system is based on the browser/server model and adopts a hierarchical structure.It is divided into three parts: ZigBee wireless sensor network, embedded web server and browser human-computer interaction client.ZigBee wireless sensor network is mainly equipped with PH and temperature sensor hardware modules to build a wireless sensor network.The transmission of nutrient fluid environmental variable data and the control of the system through the wireless network.As the core part of the entire system, the Web server plays the role of connecting remote clients and underlying sensors.The server saves the information sent by the wireless sensor network to the database.The user can remotely access the embedded Web server through the PC browser, and can query the data collected by the current system and the environment of the control system.After receiving the data request from the remote client, the detection result is displayed on the browser page.At the same time, users can send control commands to wireless sensors via the server to adjust environment variables in real time.In this plant factory, the entire system is very compact and reliable.
The schematic diagram of remote plant wireless network monitoring system for plant plants is shown in Figure 1

CC2530 Chip
The chip CC2530 [10] is a system-on-a-chip SOC solution using the IEEE 802.15.4 protocol.It can establish powerful network nodes with very low total material costs, combining the superior performance of leading RF transceivers, and industry-standard enhancements.8051 CPU, in-system programmable flash, 8-KB RAM and many other powerful features.This system uses this chip to complete the wireless transmission and reception of collected data.The CC2530 chip uses a well-performing RF transceiver and an enhanced 8051 micro-controller and in-system programmable flash memory, which allows good temperature and humidity acquisition.The CC2530 consumes 20.5 mA of core current at 50 dBm receiver mode.The core current consumption is 33.5 mA at The work mode and sleep mode can be quickly switched.The energy consumption of the entire system will be relatively low.

Terminal Node
The terminal node hardware of the ZigBee wireless collection section consists of a power module, a module sensor module, and a CC2530 module.The endpoint can communicate with the coordinator peer-to-peer.Because it has a temperature sensor on it, it can collect environmental variables and send it to the coordinator.In addition, the terminal also needs to respond to the operation instructions of the coordinator.Among them, the power module has 5 V and 3.3 V two kinds of DC power supply, 5V power supply from the external direct power supply, and then through the 7533 chip step down to get 3.3 V power supply for subsequent use.The 5 V power supply is mainly for supplying power to the PH detection module.The 3.3 V power supply supplies power to the CC2530 chip and the DS18B20 temperature sensor.The CC2530 minimum system uses a typical application circuit with an I/O pin out interface.The RF4CE transceiver with better performance and the enhanced 8051 microcontroller integrate the system-on-chip.This chip completes the wireless transmission and reception of collected data.The overall system power consumption will be lower.The sensor module uses a PH electrode sensor module and a DS18B20 digital temperature sensor.In this monitoring system, the liquid temperature is measured.Therefore, the temperature sensor uses a stainless steel encapsulated and waterproof type DS18B20 temperature probe.This probe uses the original DS18B20 chip and the signal line length is as long as 1 meter.It has the following characteristics: a wide temperature range, −55˚C -+125˚C; relatively high precision, 9 -12 resolution can be set; no external components, single bus interface is very easy to use; power supply, 3.0 -5.5 V powered by.There are many methods for measuring the pH value, such as acid-base titration, potential measurement, and the like.Due to the need for automatic measurement of the pH value, the system uses the EC-201-C PH composite electrode as the pH sensor.This composite electrode combines the PH indicator electrode and the reference electrode to-Journal of Computer and Communications gether.Its detection temperature range is 5˚C -60˚C, PH measurement range is 0 -14, accuracy is up to 0.01PH, meet the general requirements for PH testing of nutrient solution [11].
The processor CC2530 module first performs analog-to-digital conversion of the real-time acquisition data signal sent from the temperature sensor, and then performs processing.The processed data is sent to the coordinator node by the RF transceiver module.P0.6 of CC2530 is used as the temperature sensor's bus interface.By writing the ROM of DS18B20, you can get the temperature value in the temperature sensor RAM; the PH value is mainly collected by using the built-in AD conversion function of CC2530 and external simulation.The voltage is collected and the corresponding value is calculated by the formula.The PH value is converted into voltage data.Figure 2 is Sensor nodes hardware design diagram.

Coordinator Node
The Coordinator node hardware consists of a power module, a module sensor module, and a processor CC2530 module.Since the coordinator requires constant power and the coordinator cannot enter sleep mode, it is only necessary to provide the coordinator module with 3.3 V.After the processor CC2530 module receives the data collected by the terminal node and processes it, the coordinator node can set up a network and handle the joining and exit of the terminal node.It is responsible for writing the data sent by the terminal node in the network to the server, and the terminal.The node executes the user's operation instructions [12].

Terminal Node
The terminal node is equipped with a temperature sensor and a PH sensor sensor that can collect different environmental variables.After the terminal node is powered on, it can perform peer-to-peer communication with the coordinator.Its main function is to collect environmental data and send it to the coordinator.In addition, the terminal needs to respond to the operation instructions of the coordinator and immediately try to join the network formed by the coordinator after the terminal node is powered on.After the join is successful, the network address is sent to the coordinator and the terminal node coordinator returns the instruction.If it does not receive the command sent by the coordinator, the terminal node enters the low-power mode; otherwise, the terminal node enters the data acquisition mode, and sends the data to the CC2530 module for processing and then to the coordinator, and then enters the next round.The software flow chart of the terminal node is shown in Figure 3.

Coordinator Node
The ZigBee Coordinator is responsible for the formation of the network and responds to requests for other endpoints to join the network.In addition, it is also responsible for the data packet conversion of temperature data and network address information of the endpoints.The coordinator program actually enters the task polling job after the initialization process is completed.There are three main tasks: 1) to monitor whether there is a terminal node request, if there is a terminal node to join the request to assign a network number and join the node to the network; 2) if there is a terminal node in the network sent data Forwarded to the embedded Web server through the serial port; 3) If you receive a control command sent remotely, forward it to the corresponding terminal node [13].
Coordinator software flow chart shown in Figure 4.

Embedded Web Server
The detection system is an embedded Web server built on the Linux system of the virtual machine, and can be ported to ARM embedded devices.The embedded Web server communicates data with the ZigBee Coordinator through the USB-to-Serial port and remotely accesses the user through the Ethernet based on the TCP/IP protocol.Mainly based on the virtual platform or Mini2440 hardware platform as the basis of the system, through the transplantation of Linux operating system, Boa server, Sqlite 3 database, combined with CGI dynamic web technology to achieve the establishment of embedded Web server [15].

Test
The development environment used by this detection system is IAR 8.10.1.The advantage of using IAR development is that it can be programmed directly using the Z-Stack protocol provided by the chipx company.You can directly call the Z-Stack API function to program.Modify the program on the application layer on the Z-Stack protocol stack to achieve communication between nodes and drive sensors to collect data.The monitoring system adopts the B/S structure, which means that information is exchanged between the embedded device and the Internet through the browser/server model.This mode embeds a web server that can run a script or CGI programming language to generate dynamic web pages in an embedded device.The user can monitor the corresponding web page information by submitting information.The dynamic display of the web page is implemented through a CGI program.The CGI program obtains the browser's   form and can generate the corresponding HTML page according to the conditions and send it to the user's browser to realize the dynamic webpage.In this process, the web server reads the data entered by the browser through GET or POST, executes the CGI program based on the data, combines the data of the query database, and finally forms the structure file in the form of HTML and returns it to the browser through the web server [16].The final embedded Web page of the design is shown in Figure 5.

Conclusion
In this paper, the traditional plant nutrient solution monitoring and measurement methods are improved, and ZigBee wireless communication technology is used to overcome the shortcomings of traditional technologies.A low-power, low-cost and high-precision plant plant nutrient solution monitoring method is proposed.In the plant nutrient solution wireless monitoring system, the sensor node sends the collected water environment parameter analog signal to the CC2530 microprocessor for A/D conversion to obtain a digital signal.After a series of calculations and analysis, the actual parameters are obtained.The radio frequency part of the CC2530 microprocessor is sent to the serial server on the embedded device and saved to the database.The user can remotely access the Web server embedded in the embedded device through the browser on the PC, and can monitor the nutrient environment data in real time.PH value setting.The entire wireless monitoring system is simple and smart, low power consumption, and has a strong practical value in the development of modern agricultural science and technology.And this research is supported by the Fundamental Research Funds for the Central Universities.

Figure 3 .
Figure 3. Software flow of the terminal node.