1. Introduction
Fertigation technology, which integrates irrigation and fertilization, is an indispensable component of modern agricultural development [
1]. Intelligent irrigation–fertilization devices, equipped with sensors and automated control systems, based on this technology offer numerous advantages—water and fertilizer savings, high efficiency, intelligent operation, customizability, precise water–fertilizer control, and reduced water and soil pollution—and are being applied increasingly widely in agricultural irrigation and fertilization [
2,
3]. As a representative application, such a device typically uses a high-concentration nutrient solution as the fertilizer source. Power equipment draws water and nutrient solution into the pipeline for mixing; sensing equipment measures the in-line concentration and provides feedback; and the control system dynamically regulates the inlet water volume or the fertilizer injection rate, after which the formulated fertilizer solution is delivered to the crops [
4]. At a larger scale, recent studies on vegetation dynamics and the terrestrial water cycle have shown that future vegetation changes can substantially affect global land greening and terrestrial water loss; for example, the work “Underestimating global land greening: Future vegetation changes and their impacts on terrestrial water loss” indicates that these processes may have been underestimated and that vegetation–water interactions will play an increasingly important role in future water-resource management [
5]. These findings further underline the necessity of improving irrigation and fertigation efficiency and of developing precise, water-saving fertilization devices such as the system proposed in this study.
At present, most fertigation devices prepare fertilizer solution directly with untreated source water—such as lake water, groundwater, or reservoir water—without prior purification. Nutrient ions present in the source water (e.g., nitrogen and phosphorus) can combine with fertilizers and produce a water–fertilizer coupling effect, thereby compromising formulation accuracy [
6,
7,
8]. For scenarios with stringent requirements on water–fertilizer precision—such as floriculture and substrate (soilless) cultivation—the common practice in production is to install expensive upstream water-purification systems to obtain ultrapure water for formulation [
9,
10], which is unsuitable for cost-sensitive agriculture. Therefore, there is an urgent need to design an online, automatic mixing device for irrigation and fertilization that can directly use untreated source water as the formulation water source while maintaining high formulation accuracy in the presence of target ions or interfering ions in the source water.
Currently, most traditional fertigation devices inject a fertilizer stock solution using either gravity-fed or suction-type mechanisms [
11]. However, gravity-fed devices without external actuation deliver uneven fertilization, while suction-type devices are susceptible to variations in the main waterline pressure and flow; both approaches make automatic control and precise fertilizer injection difficult [
12,
13]. To achieve automatic and precise injection of the nutrient solution, researchers have leveraged the accurate and flexible flow-rate regulation of mechanical pumps: by mechanically driving the injector and modulating the pump output, the injected amount of nutrient solution can be precisely controlled, thereby ensuring the preset water-to-nutrient mixing ratio and enabling real-time, dynamic adjustment of the fertilizer solution concentration [
14]. For example, one study developed an intelligent fertilization unit powered by a peristaltic pump [
15]; tests reported a flow-rate accuracy of 94.89%, providing an important reference for precise nutrient-solution injection.
Common mixing strategies in fertigation devices include dynamic mixing and static mixing. In static mixing, neither external power nor a large mixing tank is required; water and the fertilizer stock solution mix in the pipeline during flow, offering advantages such as low energy consumption and a small footprint [
16,
17]. However, relying solely on the pipeline makes it difficult to achieve sufficient mixing of the water–fertilizer solution, which leads to nonuniform nutrient distribution, inaccurate measurement of fertilizer-solution concentration, reduced formulation accuracy, and uneven discharge of the fertilizer solution [
18]. By contrast, dynamic mixing employs a stirrer and a mixing tank. Although it entails some energy consumption, it provides superior mixing performance, low user operation and maintenance costs, and thus better practicality and cost-effectiveness [
19].
The automatic water–fertilizer regulation system is the core of fertigation devices for achieving automated and precise formulation. Accurate in-line detection and real-time feedback of fertilizer-solution concentration provide the essential basis for control decisions in water–fertilizer management systems [
20]. Common online concentration measurement methods include the EC/pH method [
21], the dielectric-property method [
22], and the ion-selective electrode (ISE) method [
23]. Among these, the ion-selective electrode (ISE) method—based on the Nernstian response, which describes the logarithmic relationship between electrode potential and ion activity—enables online detection of a specific ion within a multi-component mixed fertilizer solution [
24]. In recent years, issues such as temperature sensitivity and cross-response have been substantially mitigated, while accuracy, sensitivity, and selectivity have improved, indicating broad application prospects. For example, one study developed a real-time online nitrogen-concentration detection device for fertilizer solutions by using a nitrate ISE as the core sensor and compensating temperature drift through a temperature-parameter model [
25]. In addition, an artificial intelligence-assisted colorimetric sensor array based on supramolecular self-assembled nanozymes has been developed for the visual monitoring of pesticide residues, further demonstrating the potential of combining advanced functional materials with intelligent data analysis for highly sensitive and selective detection [
26].
To achieve rapid and precise regulation of water and fertilizer, researchers have combined traditional control methods—such as fuzzy control and PID control—with machine learning and artificial intelligence algorithms to design multiple automatic water–fertilizer regulation systems [
27,
28]. For instance, a fertigation control system employing a fuzzy PID algorithm dynamically adjusts the frequency of a variable-frequency fertilizer-injection pump, thereby realizing fast and precise control of the fertilizer-solution electrical conductivity [
29]. Therefore, adopting a fuzzy PID control algorithm in combination with appropriate hardware to design an automatic water–fertilizer regulation system is of great significance for enhancing both the formulation accuracy and the automation level of the device.
This study addresses how untreated source water affects formulation accuracy in existing fertigation devices. An STM32 microcontroller serves as the main controller. A constant formulation-water flow rate is combined with a metering pump for precise nutrient-solution injection, together with an on-demand “prepare-and-apply” regulation strategy. Based on the ion-selective electrode (ISE) method, a detection model is established for the target-ion concentration, and a fuzzy-PID control scheme dynamically modulates the metering pump’s pulse frequency to adjust the injected amount of nutrient solution. On this basis, a high-precision, online, automatic water–fertilizer mixing device is developed that directly uses untreated source water as the formulation water source. The device aims to reduce the influence of 60% of raw water, improve formulation accuracy (fertilization error less than 5%, steady-state time less than 1 min), reduce costs, and enhance applicability across agricultural irrigation water sources, and provide a new avenue for research on fertigation equipment.
2. Design of the Device
2.1. Device Structure and Working Principle
An online automatic water–fertilizer mixing unit (3D model diagram in
Figure S5) was constructed, comprising a frame, a controller, three nutrient tanks, a dynamic buffer tank (internal components in
Figure S1), five level sensors, solenoid valves, a flowmeter, a variable-frequency drive (VFD), a stirrer, a suction pump, three metering pumps, a fertilizer pump, three ion-selective electrodes (ISEs), and a temperature sensor (
Figure 1). The system was configured with one main pipeline and three nutrient pipelines. The inlet of the main pipeline was connected to the external water network, whereas the outlet was connected to the irrigation manifold; conversely, each nutrient pipeline drew from its respective nutrient tank and discharged into the main pipeline. Solenoid valves were installed at the water inlet, the nutrient-injection port, and the fertilizer-outlet port to control, respectively, the on–off states of the intake line, the water–fertilizer mixing line, and the discharge line.
The three nutrient tanks were used to store potassium-, nitrogen-, and calcium-based nutrient solutions, while the dynamic buffer tank held the mixed fertigation solution. Notably, level sensors mounted near the lower outer wall of each nutrient tank and near the upper outer wall of the buffer tank were used to detect, respectively, the lower limit of nutrient level and the upper limit of mixed-solution level. The suction pump and the three metering pumps were employed to draw the external water source and the corresponding nutrient solutions. The stirrer was used to thoroughly mix the raw water with the dosed nutrients to obtain a homogeneous water–fertilizer mixture. In addition, the ISEs were used to monitor the concentrations of K+, NO3−, and Ca2+, the temperature sensor recorded the real-time temperature of the fertilizer solution, and the flowmeter measured the flow rate.
Based on the feedback of target ion concentrations and flow information, the controller adjusted the VFD operating frequency to govern the start–stop state and rotational speed of the suction pump and, therefore, regulated the pulse frequency of the metering pumps to dose nutrients with high precision. Consequently, online automatic water–fertilizer mixing was achieved.
The operating principle of the unit was as follows: mixed fertigation solutions containing potassium, nitrogen, and calcium were prepared on demand and applied synchronously according to the actual fertilization requirement. Specifically, a control strategy with a constant water flow rate and dynamically adjusted nutrient-dosing rates was implemented. The suction pump delivered raw water to the main pipeline at the rated flow, whereas the metering pumps injected the respective nutrient solutions into the main pipeline in accordance with the target application concentrations. The water–fertilizer mixture was then conveyed into the dynamic buffer tank, where continuous stirring ensured more complete and uniform mixing.
At each time step during ratio control, the required dosing rates of the individual nutrient solutions were finely regulated by modulating the pulse frequency of the metering pumps. Moreover, to further achieve precise proportioning, mathematical models of the target ion concentrations established from preliminary experiments were used, the ion-selective electrodes and the temperature sensor provided real-time measurements of the target ion concentrations in the mixed solution, which were fed back to dynamically adjust the nutrient-dosing rates. In parallel, the flowmeter verified whether the cumulative discharge of the mixed solution met the prescribed application volume; therefore, closed-loop control of online automatic water–fertilizer mixing was realized.
2.2. Hardware Design
The hardware of the online water–fertilizer mixing system (
Figure 2) was organized into five modules: control, detection, actuation, human–machine interaction, and power supply. The STM32F103VET6 microcontroller served as the core controller.
In the detection module, ion-selective electrodes were interfaced to the microcontroller via a signal-conditioning step-down module that converted their 0–10 V outputs to 0–3.3 V, enabling acquisition by the analog-to-digital converter (ADC). The flowmeter and the temperature sensor were connected to the microcontroller’s serial interface through an RS-485 repeater—supporting multi-drop RS-485 devices—and a TTL-to-RS-485 transceiver, which performed level and protocol conversion; conversely, the level sensors were wired directly to the ADC inputs.
In the actuation module, the suction pump’s supply was taken from the output of a variable-frequency drive (VFD), and the VFD communicated with the microcontroller through a TTL-to-RS-485 transceiver on the serial interface. The metering pumps were driven through voltage-to-current converters that transformed the 0–3.3 V signals from the digital-to-analog converter (DAC) into 4–20 mA control currents, thereby adjusting the pumps’ pulse frequency. The fertilizer pump, the stirrer (model GEAR-220V-90W, Changzhou Dinggao Environmental Protection Equipment Co., Ltd., Changzhou, China), and the solenoid valves were connected to the microcontroller’s outputs through relays; notably, control commands issued by the microcontroller actuated the relays, which in turn drove these devices.
For human–machine interaction, an industrial HMI (Weintek TK8072iP) was linked to the microcontroller’s serial interface via a TTL-to-RS-485 transceiver to enable bidirectional communication. The power-supply module provided three rails—AC 220 V, DC 24 V, and DC 3.3 V—to satisfy the requirements of different components. The model numbers and specifications of the hardware in each module are listed in
Table 1.
2.3. Control System Design
2.3.1. Fuzzy Controller Design
Given the nonlinear, time-varying, and lagging characteristics of water–fertilizer mixing, an accurate mathematical model was difficult to establish [
30]. Therefore, a fuzzy PID control strategy was adopted. The real-time target ion concentrations of the fertilizer solution were treated as the controlled variables; ion-selective electrodes served as the feedback elements; and the metering pumps functioned as the actuators, thereby forming a closed-loop online mixing control system.
The deviation of the target ion concentration, (
e =
r −
y, where
r and
y denote the setpoint and the measured (actual) values of the target ion concentration, respectively), and its rate of change,
ec, were used as input variables to a two-dimensional fuzzy controller comprising fuzzification, fuzzy inference, and defuzzification. Notably, the basic and fuzzy universes of discourse for
e,
ec, and the output increments Δ
Kp, Δ
Ki and Δ
Kd were specified as in
Table 2. The fuzzy linguistic sets for
e,
ec, and Δ
Kp, Δ
Ki, Δ
Kd were all defined as {NB, NM, NS, ZO, PS, PM, PB}; Gaussian membership functions were employed for the continuous and smooth inputs
and
[
31], whereas triangular membership functions were assigned to the outputs Δ
Kp, Δ
Ki and Δ
Kd to satisfy computational efficiency requirements [
32].
Based on expert knowledge, empirical experience, and system requirements, fuzzy control rules were formulated as shown in
Table 3. Using an If–Then representation, the fuzzy logical relationships between Δ
Kp, Δ
Ki, Δ
Kd and
e,
ec yielded 49 conditional statements, which collectively constituted the rule base for inference. Finally, defuzzification was performed using the centroid-of-area method [
33]; consequently, the centroid of the area enclosed by the membership functions and the abscissa was taken as the final output, namely the precise pulse frequency command for the metering pumps. As a result, online tuning of Δ
Kp, Δ
Ki and Δ
Kd was realized to maintain the ion concentrations at their targets.
2.3.2. System Operation Process
According to the aforementioned operating principle, the workflow of the online automatic water–fertilizer mixing system was established as shown in
Figure 3. An immediate preparation and application strategy was implemented whereby mixed fertilizer solutions containing potassium, nitrogen, and calcium were prepared and applied on demand. Specifically, the solution was configured under a constant raw-water flow rate, while the nutrient-dosing rates were dynamically regulated by a fuzzy-control scheme in accordance with the target application concentrations.
Ion concentrations in the mixed solution were monitored online by ion-selective electrodes; once the setpoints were achieved, the prepared fertilizer solution was extracted by the fertilizer pump and delivered to the irrigation manifold. In parallel, the flowmeter measured and accumulated the applied volume in real time. When the prescribed application volume was reached, the proportioning and mixing process was terminated; therefore, a complete cycle of on-demand mixing and delivery was accomplished.
3. Materials and Methods
3.1. Test Materials
Considering that crops demand potassium and nitrogen most strongly and that calcium is an essential medium-quantity nutrient, K, N and Ca were selected for the fertigation proportioning study. To minimize interference from extraneous impurities, analytical-grade solids were employed as unit fertilizers: potassium chloride (KCl, ≥99.5%), sodium nitrate (NaNO3, ≥99.0%), and monocalcium phosphate (Ca(H2PO4)2, ≥99.2%) produced by China National Pharmaceutical Group Chemical Reagent Co., Ltd., Shanghai, China.
Because the solubilities of the analytical-grade salts differ—and to better emulate practical application—each reagent was weighed with an analytical balance (readability 0.1 mg) and dissolved in deionized water. Using fixed-volume (volumetric) preparation, ten concentration levels were formulated for each target ion:
K+ at 1–10 g/L in 1 g/L increments, NO3− at 1–10 g/L in 1 g/L increments, and Ca2+ at 0.25–2.50 g/L in 0.25 g/L increments, yielding 30 solutions in total. For each solution, temperature conditioning was performed in a constant-temperature water bath over 5–45 °C in 5 °C increments, resulting in nine temperature levels.
To evaluate the influence of pre-existing target ions in raw water on the proportioning accuracy of the device, eight raw-water sources (all used for irrigation) were collected from distinct regions, river systems, and water types within Yunnan Province. The concentrations of K
+, NO
3− and Ca
2+ in these samples were determined by an accredited testing organization (PONY Testing Co., Ltd., Shanghai, China), as summarized in
Table 4. Sampling was conducted during the dry season (May–June), under stable weather conditions.
As shown in
Table 4, the concentrations of the target ions in the eight raw-water sources varied markedly—K
+ at 0.47–16.20 mg/L, NO
3− at 0.50–236.00 mg/L, and Ca
2+ at 23.70–195.00 mg/L. Notably, these background levels constituted a substantial fraction of the application-level concentrations (on the order of 100 mg/L) and, in several cases, approached the intended dosing levels. Therefore, the influence of raw-water ions on proportioning accuracy could not be neglected; moreover, higher background concentrations exerted more pronounced effects. The heterogeneity in ion contents among raw-water sources consequently led to fluctuations in proportioning accuracy for conventional fertigation devices.
3.2. Determination of Selectivity Coefficients for Interfering Ions
Ion-selective electrodes (ISEs) generate response potentials to both target ions and interfering ions in solution. To investigate the degree of interference exerted by other ions in the solution on the target ion, the selectivity coefficient
Kij was introduced. In this study, the fixed interference method—a subtype of the mixed solution method—was employed. Specifically, the concentration of interfering ions was fixed while that of target ions was varied. Under ambient temperature, potassium chloride, sodium nitrate, and calcium dihydrogen phosphate solutions were prepared using deionized water, with concentrations of potassium, nitrate, and calcium ions ranging from 10
−6 to 10
−1 mol/L (spanning the order of magnitude of 10
−1 mol/L). The concentration of interfering ions was fixed at 10
−2 mol/L, and a series of mixed solutions were prepared with stirring. For each mixed solution, three replicate measurements were performed (
n = 3); the corresponding standard deviation was also calculated to evaluate measurement variability. The selectivity coefficient was calculated when the electrode response potential determined by the target ion was equal to that determined by the interfering ion (Equation (1)).
wherein
Kij is the selectivity coefficient;
ci is the concentration of the target ion, g/L;
cj is the concentration of the interfering ion, g/L;
n is the charge number of the target ion (with sign: positive for cations and negative for anions).
3.3. Methods for Construction and Validation of the Concentration Detection Model for Target Ions in Fertilizer Solution
3.3.1. Methods for Construction of the Concentration Detection Model for Target Ions in Fertilizer Solution
In this study, ion-selective electrode (ISE) methodology was employed to construct the concentration detection model for target ions in fertilizer solutions. Specifically, the corresponding ISEs were immersed in the aforementioned target fertilizer solutions, and a multimeter was used to measure the response potentials of the ISEs in each solution. Through regression analysis, multiple functions were tested for curve fitting of the experimental data (concentration vs. electrode response potential) of each target fertilizer solution. The regression equation with the highest goodness of fit (i.e., the largest coefficient of determination, R2) was selected as the concentration detection model for target ions in fertilizer solutions at ambient temperature.
The temperature variation range (5–45 °C) in this study is small, and its effect on the activity of the target ions can be neglected. Therefore, both the electrode response slope and the standard electrode potential (intercept) in the Nernst equation are treated as functions of temperature, and the Nernst equation can be rewritten as Equation (2).
Subsequently, using the stepwise fitting method based on the least squares principle, linear fitting curves of temperature (t) with slope [f(t)] and intercept [e(t)] were established, respectively. Regression equations describing the relationships of slope and intercept with temperature were derived and substituted into Equation (2), thereby constructing temperature-compensated concentration detection models for the three target ions in fertilizer solutions.
wherein:
E is the electrode response potential, V;
t is the temperature of the target fertilizer solution, °C;
f(
t) is the function of electrode response slope with respect to temperature;
e(
t) is the function of standard electrode potential with respect to temperature;
c is the concentration of the target ion, g/L.
3.3.2. Methods for Validation of the Concentration Detection Model for Target Ions in Fertilizer Solution
After the construction of the temperature-compensated concentration detection model for target ions in fertilizer solutions, its performance must be validated. Specifically, response potentials of target fertilizer solutions with different concentrations were measured using ion-selective electrodes (ISEs) at varying temperatures. These potentials were substituted into the model to obtain the detected values of target ion concentrations, thereby calculating the relative errors (Equation (3)). Furthermore, by comparing with the concentration detection model for target ions in fertilizer solutions at ambient temperature, the temperature-compensated model was validated to determine whether it meets the requirements for accurate detection of target ion concentrations in fertilizer solutions.
wherein:
δ is the relative error;
ca is the actual value of target ion concentration, g/L;
ct is the detected value of target ion concentration, g/L. Using raw water listed in
Table 4 as the fertilizer-mixing water source, a series of target fertilizer solutions with different concentrations were prepared for potassium fertilizer, nitrogen fertilizer, and calcium fertilizer, respectively. The effectiveness of the concentration detection model for target ions in fertilizer solutions (using raw water) was then tested in these target fertilizer solutions at varying temperatures.
To reduce the experimental workload while ensuring representativeness, the following experimental protocol was adopted: The impact of different raw water sources on the proportioning accuracy of each target ion was divided into three levels: high, medium, and low. The “high”, “medium”, and “low” impact levels are defined according to the magnitude of the electrode response contributed by the target ions in the raw water. From the 8 raw water sources listed in
Table 4, 3 sources were selected for each of potassium ions, nitrate ions, and calcium ions, covering lake water, groundwater, and rainwater and representing the three impact levels.
Accordingly, potassium chloride solutions with low, medium, and high concentrations (1.5 g/L, 5.5 g/L, and 9.5 g/L) were prepared using raw water 1, 3, and 8, respectively. Sodium nitrate solutions with low, medium, and high concentrations (1.5 g/L, 5.5 g/L, and 9.5 g/L) were prepared using raw water 1, 4, and 5, respectively. Calcium dihydrogen phosphate solutions with low, medium, and high concentrations (0.38 g/L, 1.38 g/L, and 2.38 g/L) were prepared using raw water 4, 5, and 6, respectively.
For the target fertilizer solutions with three concentration gradients prepared using each raw water source, their temperatures were adjusted to three different levels (10 °C, 20 °C, and 30 °C) using a constant temperature water bath. During the experiment, for each sample of target fertilizer solution corresponding to a specific target ion, the respective potassium/nitrate/calcium ion-selective electrode (ISE) was immersed in the solution. After measuring the ISE response potential, the value was substituted into the constructed temperature-compensated concentration detection model for target ions in fertilizer solutions to calculate the detected values and relative errors of the target ion concentrations.
3.4. Simulation Method for Hydrodynamic Performance of the Device’s Pipeline System
Within Fluent software (ANSYS Fluent 2024 R2), the internal flow field domain of the device’s pipeline system was extracted, and solid components not involved in flow field analysis were excluded to construct the simulation model as shown in
Figure 4. A single-precision solver was used to divide the model into meshes with sizes ranging from a minimum of 0.2 mm to a maximum of 2.0 mm [
34]. A grid-independence study was carried out by comparing three mesh densities (coarse, medium, and fine), and the medium mesh, containing approximately 2 × 10
5 elements, was selected because further refinement produced negligible changes in the predicted velocity and pressure fields. The standard k-ε model was selected to describe the flow characteristics of the fluid within the pipeline [
35].
For boundary condition settings, to simulate the operating conditions of the device under near-full-load operation, fluid velocities in the pipeline were set based on the rated flow rates of the water suction pump, metering pump, and fertilizer solution pump: specifically, inlet-water was 0.90 m/s; inlet-K, inlet-N, and inlet-Ca were all 0.04 m/s; and inlet-fertilizer was 0.28 m/s. Meanwhile, the boundary pressures at the main pipeline outlet, nutrient solution pipeline inlet, and fertilizer outlet pipeline were set to 0.2 MPa, 0 MPa, and 0.15 MPa, respectively. Under these operating conditions, the flow regime was characterized by the Reynolds number:
where
is the density of the fertilizer solution,
v is the cross-sectional average velocity,
D is the pipe diameter, and
μ is the dynamic viscosity. In the simulations, the fertilizer solution was assumed to have physical properties close to those of water at 20 °C, with
≈ 1000 kg/m
3 and
μ ≈ 1.0 × 10
−3 Pa·s. The main mixing pipeline was modeled with an inner diameter of 28 mm and a flow velocity of 0.90 m/s, while the fertilizer outlet pipeline was modeled with an inner diameter of 16 mm and a flow velocity of 0.28 m/s. These parameters were used to evaluate the Reynolds number and characterize the flow regime in the subsequent hydrodynamic analysis.
The simulation focused on analyzing the pressure distribution and velocity distribution within the pipeline, thereby verifying the rationality of the pipeline system design and the hydrodynamic performance of the device during operation.
3.5. Test Device and Performance Test Method
Based on the device structure design described earlier, a prototype of the online automatic water-fertilizer mixing device was developed (
Figure 5a). The main frame of the device is constructed from aluminum profiles (European standard 4040C) with dimensions (length × width × height) of 1.0 m × 0.8 m × 1.3 m; a vertical multi-layer structure (4 layers in total, with layer spacing from bottom to top being 30 cm, 40 cm, and 40 cm in sequence) is used to arrange and integrate various hardware devices in an orderly manner; the bottom is equipped with 4 casters that are rotatable in any direction and have a locking function, to enhance the flexibility of the prototype and its adaptability to different terrain conditions.
The main pipeline of the device is a DN25 PVC pipe (diameter 32 mm), the nutrient solution pipelines are PE hoses (diameter 10 mm), the nutrient solution tanks (fertilizer mixing tanks) have a capacity of 10 L (15 L), and the fertilizer outlet pipeline is a DN15 PVC pipe (diameter 20 mm). The device includes three core modules: water-fertilizer injection and mixing, water-fertilizer measurement and control, and water-fertilizer irrigation. The components required for each module are shown in
Figure 5b,
Figure 5c, and
Figure 5d, respectively.
In this study, the device prototype was used to conduct tests on proportioning accuracy, steady-state time, degree of raw water impact, and long-term stability to verify the performance of the device during actual operation. The specific experimental methods are as follows:
(1) For preparing single-component fertilizer solutions: the device prepared potassium and nitrogen fertilizers at concentrations ranging from 1 to 9 g/L sequentially in steps of 2 g/L; for calcium fertilizer, it was prepared at concentrations ranging from 0.25 to 2.25 g/L sequentially in steps of 0.5 g/L. Each concentration was tested in triplicate to ensure reproducibility.
For preparing mixed fertilizer solutions: to reduce the number of experiments, potassium ions, nitrate ions, and calcium ions were each divided into three concentration levels (low, medium, and high). The orthogonal design method was adopted, and the 3 target ions with 3 concentration levels each resulted in 9 combinations (
Table 5). The device was then used to prepare these 9 mixed fertilizer solutions sequentially.
(2) According to the aforementioned experimental protocol, the device was started and operated to sequentially prepare single-component or mixed fertilizer solutions with set concentrations. Ion-selective electrodes (ISEs) and temperature sensors detected and fed back in real-time the response potential and temperature of the fertilizer solution. The microcontroller invoked the temperature-compensated concentration detection model for target ions in fertilizer solution to calculate the detected values of target ion concentrations. The target ion concentration values were recorded every 1 s, curves of target ion concentration versus time were plotted, and the fertilizer-mixing accuracy (Equation (5)) and steady-state time were calculated. The steady-state time is defined as the time when the measured target ion concentration in the fertilizer solution reaches the set value and subsequent errors do not exceed ±5%.
Fertilizer solutions with different target ion types and concentrations were prepared using different raw water sources, and the relative errors compared with fertilizer mixing using deionized water were calculated. The theoretical error of fertilizer mixing with raw water (i.e., the fertilizer-mixing error without the control system proposed in this study) is calculated as described in Equation (6). Notably, Equation (6) quantifies the theoretical deviation that arises solely from the target ions originally present in the raw water, without considering sensor errors or control errors.
wherein:
P is the fertilizer-mixing accuracy;
ca is the actual value of target ion concentration, g/L;
ct is the detected value of target ion concentration, g/L.
wherein:
e is the theoretical error of fertilizer mixing with raw water;
Cf is the target ion concentration of fertilizer solution prepared with different raw water sources, g/L;
b is the target ion concentration of fertilizer solution measured from different raw water sources listed in
Table 4, g/L. Thus,
Cf + b represents the actual ion concentration in the mixed fertilizer solution, and Equation (6) quantifies the fraction of the final concentration that originates from the raw water, i.e., the theoretical contribution of raw water to the overall mixing error.
(3) The potassium ion concentration was set to 5 g/L, nitrate ion concentration to 8 g/L, and calcium ion concentration to 2 g/L, with the fertilizer application rate set to 1.2 m3. The device was started and operated to prepare mixed fertilizer solutions containing potassium, nitrogen, and calcium nutrients based on the set fertilization parameters. Ion-selective electrodes (ISEs) were used to detect and feed back the target ion concentrations in the fertilizer solution, and the stability and accuracy of the device during long-term fertilizer mixing were analyzed based on the fluctuation of these target ion concentrations.
Meanwhile, during the continuous operation of the device, observations were made to check for abnormal conditions such as equipment operation failures, pipe leakage or blockage, and sensor data transmission errors.
5. Conclusions
To address the issue of low fertilizer proportioning accuracy caused by the influence of raw water, this study developed a high-precision online automatic water–fertilizer mixing device that can directly use raw water without water purification treatment as the water source for fertilizer preparation. The main research conclusions are as follows:
(1) With the STM32F103VET6 microcontroller as the core controller, an online fertilizer mixing control strategy was adopted, which uses a constant raw water flow rate and a fuzzy PID control method to dynamically adjust the pulse frequency of the metering pump to change the injection volume of nutrient solution. This strategy realizes the preparation of mixed fertilizer solutions containing N, K, and Ca elements, with nitrate and potassium ion concentrations in the range of 1–10 g/L and calcium ion concentrations in the range of 0.25–2.5 g/L. The device was validated using raw water sampled from lake water, groundwater, and rainwater in Yunnan Province, China, representing typical irrigation water qualities in the region. The designed fuzzy PID controller regulates the target ion concentration in the fertilizer solution, with a steady-state time of 38 s. Simulation results show that the fuzzy rules are reasonably designed and the system operates stably and reliably within the above concentration ranges and water types.
(2) Detection models for the concentrations of potassium, nitrate, and calcium ions in fertilizer solutions at room temperature were established, with coefficients of determination (R2) all greater than 0.99. On this basis, temperature compensation-based detection models for the concentrations of potassium, nitrate, and calcium ions in fertilizer solutions were established and validated. The average relative detection errors of the three models are 1.94%, 1.18%, and 2.87%, respectively, which are 0.75% (1.13%, 0.93%) lower than the average relative errors of the room-temperature detection models for potassium (nitrate, calcium) ions in fertilizer solutions, indicating higher detection accuracy of the temperature-compensated models.
(3) The piping system of the device was analyzed through simulation, and the results show that: the maximum static pressure on the pipe wall of the piping system is 0.207 MPa, which is within the pressure-bearing range of the pipe material; the total pressure drop between inlet and outlet of the main pipeline and fertilizer outlet pipeline is 0.007 MPa (0.7 m) and 0.008 MPa (0.8 m), respectively, which is significantly lower than the rated head of 20 m for the water pump and 15 m for the fertilizer pump; there is no backflow at the junction of the main pipeline and nutrient solution pipeline, and the nutrient solution can be effectively injected into the main pipeline, indicating that the piping system is reasonably designed.
(4) The device performance test results show that: when preparing single-element or mixed fertilizer solutions, the average steady-state error of the device does not exceed 4%, with an average steady-state time of 40 s, which is superior to the performance requirements for water-fertilizer integration equipment specified in DG/T 274-2024; compared with deionized water, the average relative errors for potassium ions, nitrate ions, and calcium ions when preparing fertilizer solutions with raw water are 1.33%, 1.12%, and 1.19%, respectively; compared with the theoretical errors of fertilizer preparation with raw water, the fertilizer proportioning errors of this device for potassium ions, nitrate ions, and calcium ions can be reduced by a maximum of 10.55%, 66.84%, and 62.71%, respectively; the device achieves accurate and stable fertilizer proportioning with safe and reliable operation during long-term operation (6 h).
This study still has some limitations and shortcomings: only concentration detection models for N, K, and Ca element fertilizers have been established, without considering the crop growth demand for P, other medium or trace element fertilizers, resulting in a limited application range; the functionality of the online automatic water–fertilizer mixing device needs further improvement. Future research will incorporate a fertilizer solution pH measurement and control module on the basis of achieving precise water-fertilizer proportioning, to prepare fertilizer solutions according to the nutrient content and pH required by crops. Future work will evaluate the device under field conditions with actual crops to confirm long-term applicability.