Skip to Content
AgricultureAgriculture
  • Article
  • Open Access

18 January 2026

20 Pages

Development of a Neural Network-Based Controller for a Greenhouse Irrigation System at Laboratory Scale

,
,
,
,
and
División de Estudios de Posgrado e Investigación, Tecnológico Nacional de México, I.T. Culiacán, Culiacán 80220, Mexico
*
Author to whom correspondence should be addressed.

Abstract

Water scarcity and inefficient irrigation practices are major challenges for modern protected agriculture systems. This study designs, implements, and experimentally validates a neural network-based irrigation control strategy in an industrial programmable logic controller (PLC) for a drip irrigation system operating in a laboratory-scale micro-tunnel greenhouse. The objective is to evaluate the real-time performance of an intelligent controller under practical operating conditions and to quantify its impact on water use efficiency and crop growth compared to a conventional on–off strategy. The neural network is trained using 1039 data samples, divided into training (70%), validation (15%), and test (15%) datasets, and is implemented in the PLC to regulate soil moisture through a proportional valve. Experimental validation is carried out over 67 days using a serrano chili pepper (Capsicum annuum L.) crop. Both controllers operate simultaneously under identical environmental and operating conditions. Performance is evaluated using soil moisture stability metrics, including mean squared error (MSE), mean absolute error (MAE), and standard error (SE), water consumption, and crop growth indicators prior to harvest. Results show that the neural network controller achieves higher soil moisture regulation accuracy (MSE = 3.2159%, MAE = 0.7560%, SE = 0.00001687%) and reduces the average daily water consumption per plant by 50.18% compared with the on–off controller. In addition, the absolute growth rate increases by 26.42%, with statistically significant differences. These results demonstrate that neural network-based control can be effectively implemented on industrial hardware and provide tangible benefits for water-efficient and precision irrigation systems.

1. Introduction

Water use in agriculture represents one of the main challenges in Mexico and worldwide. Of all the accessible freshwater resources on the planet, nearly 70% is allocated to agricultural activities [1], which reflects the significant impact of this sector on water availability. In Mexico, this challenge intensifies due to climate change, population growth, and the inefficient operation of irrigation systems [2]. More than 75% of the available freshwater in the country is used for agriculture, which highlights the urgent need to improve irrigation technologies and water management strategies [3].
Protected agriculture systems combined with drip irrigation offer important advantages in terms of water savings and improved crop management [4]. However, many of these systems currently deployed in greenhouses rely on traditional technologies or basic automation schemes [5], which do not guarantee efficient water use and exhibit adaptability to dynamic environmental and crop conditions. In practice, irrigation is frequently controlled by analog controllers [6] or simple on–off strategies [7]. These approaches lack the precision required to maintain optimal soil moisture levels and often lead to water waste, crop water stress, and reduced energy efficiency [8].
The absence of effective sensor-based feedback further exacerbates this problem, as irrigation systems without direct measurements cannot respond adequately to environmental disturbances or to the varying water requirements associated with different crop phenological stages. To address these limitations, intelligent control algorithms such as fuzzy logic [9] regulate soil moisture around a desired setpoint [9,10]. These approaches demonstrate benefits in terms of water savings [11] and increased crop growth [12].
Neural network-based controllers also play an important role in agricultural irrigation systems and contribute to improved agricultural yield and reduced irrigation water supply [13]. This increase in yield is achieved indirectly: by leveraging the non-linear processing capabilities of neural networks, these controllers maintain soil moisture levels within an optimal physiological range, preventing both water stress and anaerobic conditions caused by over-irrigation. This precision ensures that the crop remains in its peak vegetative or reproductive state, thereby maximizing its genetic yield potential. Furthermore, neural networks can be integrated with fuzzy logic to develop neuro-fuzzy controllers capable of regulating soil moisture on embedded platforms, such as microcontrollers [14]. However, despite the growing number of studies on neural network-based irrigation control, the practical deployment of such algorithms on industrial control hardware operating in real time, together with direct experimental comparison under identical conditions, remains limited. Many reported approaches rely on simulation-based validation or non-industrial hardware platforms, which restricts their direct applicability to real-time irrigation systems used in agricultural practice.
In this context, the challenge lies not only in the development of intelligent control algorithms but also in their reliable implementation on industrial control hardware and their experimental validation under real operating conditions. Addressing this challenge is essential to bridge the gap between algorithm development and practical deployment in agricultural irrigation systems. This work proposes an intelligent control algorithm based on artificial neural networks (ANNs) and implements it in a drip irrigation system for a laboratory-scale micro-tunnel greenhouse.
The algorithm is trained using experimental data and is executed in real time on an industrial programmable logic controller (PLC), which regulates the opening of a proportional valve according to soil moisture levels. The proposed controller is experimentally validated using a serrano pepper crop (Capsicum annuum L.), and its performance is directly compared with that of a traditional on–off controller operating under real, identical conditions.
Section 2 describes the methodology, including the irrigation system design, controller development, neural network implementation, and experimental setup. Section 3 presents the experimental results related to soil moisture regulation, water consumption, and crop parameters. Section 4 discusses the significance of the findings and the advantages of the neural network-based approach over conventional control strategies. Finally, Section 5 summarizes the conclusions and outlines future research directions.

2. Materials and Methods

The methodology was designed to evaluate the real-time implementation of an intelligent irrigation control strategy under laboratory-scale greenhouse conditions. Rather than focusing on simulation-only validation, the proposed approach integrates industrial sensing, actuation, and control hardware to experimentally assess controller performance under identical operating conditions. In this section, the intelligent control algorithm was designed, simulated, and selected to regulate soil moisture in a laboratory-scale micro-tunnel greenhouse. The section is organized as follows: irrigation system design, mathematical modeling of soil moisture, controller simulation and selection, and experimental system layout.

2.1. Irrigation System Design

The experimental setup includes the instrumentation and monitoring of key variables relevant to irrigation control and crop development. Soil moisture serves as the primary feedback variable for the control algorithms. In addition, ambient temperature and relative humidity are monitored to characterize greenhouse environmental conditions and to ensure that all experiments are conducted under comparable operating conditions. Water flow rate is measured to quantify irrigation consumption and evaluate controller performance.
Although environmental variables such as air temperature and relative humidity influence soil moisture dynamics, they are not used as direct inputs to the control algorithms in this study. Instead, these variables are monitored to verify that both the neural network-based controller and the on–off controller operate under identical environmental conditions. This approach enables an objective comparison of controller performance by decoupling the effects of the control strategy on soil moisture regulation and crop response.
The irrigation system is designed to provide the required water supply for the crop. The project includes the selection and instrumentation of the main components, including the irrigation pump, pipes, valves, sensors, actuators, structural elements, pots, and water reservoirs. SketchUp Web App is used for graphical design and three-dimensional modeling of the greenhouse.
Figure 1 illustrates the external design of the greenhouse, which covers an area of 6 m2 (3 m long and 2 m wide). The structure includes a steel frame, anti-aphid mesh cover, hydraulic and electrical installations, water tank, ventilation fans, pots, and an electrical cabinet. The figure also presents the internal layout of the greenhouse, with nine pots arranged in three rows and three columns, numbered from top to bottom and from left to right. In addition, the control panel is shown, including the HMI screen and the main irrigation system components: irrigation pump, proportional valve, flow sensor, and drippers [15].
Figure 1. Overview of the micro-tunnel greenhouse: external structure, internal layout, and irrigation system components.

2.2. Mathematical Modeling

The mathematical modeling of the irrigation system follows the methodology described in [16], which also considers soil moisture as the main variable of interest. However, no specific equation is available to describe the behavior of irrigation flow regulated by a proportional valve. In this study, soil moisture refers to the water content of the substrate expressed as a percentage of saturation. This parameter is calculated using Equation (1) [17], which is based on the difference between the saturated mass and the dry mass of the substrate.
S a t u r a t e d   w a t e r   c o n t e n t   % = S a t u r a t e d   s o i l   m a s s − D r y   s o i l   m a s s D r y   s o i l   m a s s × 100
A comparison is established between a tank level model [18] and soil moisture percentage. In this analogy, the pot represents the tank, the soil represents capacitance, and the valve, together with the constant flow from the pump, represents resistance and inflow. Figure 2 illustrates this analogy, where inflow is Qi, outflow is Qo, Vi and Vo are the input and output valves, and H represents system capacitance. Soil moisture is analogized to the filling level of a tank: both systems release and retain water according to demand.
Figure 2. Pot analogy compared with a tank level model.
The tank stores water up to a maximum level and discharges it through a control device. Similarly, soil retains water at field capacity and makes it available according to crop needs. Based on this analogy, control methods applied to tank levels can also be used for soil moisture regulation.
Equation (2) describes the flow through a valve [19], applied to the tank level model to obtain Equation (3), which represents the equivalent flows in the system:
Q = C d   A x 2 ∆ P ρ = C d   A x 2 g h = K v 2 g h
where the variables are as follows:
Q = Flow— m 3 · s − 1 ;
C d = Discharge coefficient;
A ( x ) = Cross-sectional area— m 2 ;
∆ P = Pressure difference— k g · m − 1 · s − 2 ;
ρ = Fluid density— k g · m − 3 ;
g = Gravitational acceleration— m · s − 2 ;
h = Pressure head— m ;
K v = Flow coefficient— m 2 .
A   d h d t = Q i − Q o
where the variables are as follows:
Q i = K v 1 α 1 ;
Q o = K v 2 α 2 2 g h .
By substitution, Equation (4) is obtained:
A d h d t = K v 1 α 1 − K v 2 α 2 2 g h
The system is nonlinear due to the square root in the equation. To linearize, inflow and outflow are equated, Q i = Q o , to identify the equilibrium point, as shown in Equation (5).
K v 1 α 1 = K v 2 α 2 2 g h
Solving for H 0 yields Equation (6):
H 0 =   K v 1 α 1 K v 2 α 2 2 g 2
With the equilibrium point identified, Equation (4) is linearized using a Taylor series [20], assuming α 2 as a constant, leading to Equation (7).
A   d ∆ h d t ≈ K v 1 ∆ α 1 − K v 2 α 2 2 g 2 h ¯   ∆ h
Applying the Laplace transform results in the transfer function in Equation (8):
h ( s ) α 1 ( s ) =   K v 1 A s +   K v 2 α 2 2 g 2 h ¯
By substituting the following values, Equation (9) is obtained:
A = 1.2768   m 2 · s − 1 ;
k v 1 = 0.005   m 3 · s − 1 ;
k v 2 = 0.0005   m 2 ;
g = 9.81   m · s − 2 ;
h = 0.2   m .
h ( s ) α 1 ( s ) = 0.0039 s + 0.00194
To incorporate the perturbation caused by evaporation losses, Equation (10) is used. In Culiacán, the maximum annual evaporation rate reaches 2129.2 mm per month. The evaporation term is included as a conservative upper-bound estimate derived from external meteorological data and is intended to represent a worst-case scenario during the modeling stage. This parameter is not used to directly estimate crop water demand during the experimental evaluation, which relies on real-time soil moisture measurements. From this value, the following parameters are determined:
Evaporation coefficient K e v = 8.105 ×   10 − 7   m · s − 1 ;
Surface evaporation area: ( A ) = 1.2768   m 2 .
Q e v = K e v A 2
Substitution yields Equation (11):
Q e v =   1.0348 × 10 − 7   m 3 · s − 1

2.3. Controller Design

After obtaining the transfer function of the model, three controllers are designed: PID, fuzzy logic (FL), and neural networks (NNs). MATLAB/Simulink R2023 version is used to implement and simulate each control strategy. Figure 3 presents the system block diagram, where the “Controller” block is replaced by the corresponding control algorithm, and illustrates the closed-loop structure including reference tracking, control action, plant dynamics, evaporation disturbance, and unit conversions required to express the output as soil moisture percentage according to Equation (1). The system is evaluated for a soil moisture reference of 80%.
Figure 3. System block diagram.
The PID controller is the first to be simulated. The proportional, integral, and derivative constants (Kp, Ki, Kd) of the ideal PID controller are manually tuned in Simulink using an iterative trial-and-error procedure. This procedure seeks to achieve stable soil moisture regulation, minimal overshoot, and acceptable settling time under the modeled irrigation dynamics. The selected parameters represent a compromise between response speed and system stability and serve as a baseline controller for comparative evaluation. The resulting parameters appear in Table 1.
Table 1. PID controller tuning constants.
The second controller corresponds to fuzzy logic. Table 2 presents the nomenclature of fuzzy sets. The input variable is the soil moisture error, represented by fuzzy sets (ZE, VLE, LE, ME, HE, VHE, EE). The output variable is the valve opening, represented by sets (ZO, VLO, LO, MO, HO, VHO, FO). Figure 4a shows the input sets A0–A8, Figure 4b illustrates the output sets B0–B8. The membership function rules are described in Table 3.
Table 2. Fuzzy sets nomenclature.
Figure 4. Membership functions of input and output variables. (a) Input sets; (b) output sets.
Table 3. Fuzzy controller rules.
The third controller is based on artificial neural networks. During the controller design stage, several neural network architectures were evaluated by varying the number of neurons in a single hidden layer (1–10, 20, 50, and 100 neurons), as well as the training algorithm (Levenberg–Marquardt and Bayesian Regularization), while maintaining a single input neuron (soil moisture error) and a single output neuron (control signal).
The final network configuration consists of one hidden layer with five neurons trained using the Levenberg–Marquardt algorithm, as shown in Figure 5. This configuration was selected based on its favorable control performance, convergence speed, generalization capability, and computational simplicity, which are essential for real-time execution on an industrial PLC.
Figure 5. Architecture of the neural network.
The quantitative performance results obtained during training and validation are presented in Section 3.1 and are used to support the selection of the neural network controller for experimental implementation.

2.4. Controller Evaluation Criteria

The evaluation of the control algorithms considers the simulation results under the following criteria:
  • Settling time: time required for the controller to reach the soil moisture reference.
  • Negative and positive errors: deviation between the reference and the actual moisture value, indicating irrigation deficit or excess.
  • Mean squared error (MSE): accuracy of the controller with respect to the reference.
  • Mean absolute error (MAE): average error during the simulation.
  • Standard error (SE): controller stability determined by measuring error variability.
  • Normalized root mean square error (NRMSE): normalized measure of control accuracy that allows scale-independent comparison among controllers.
  • System duty cycle time: interval between irrigation activations. Longer intervals indicate higher stability, efficiency, lower actuator degradation, and lower energy consumption.
These criteria are used to compare the PID, fuzzy logic, and neural network controllers and to support the selection of the controller for experimental implementation. The corresponding results are presented in Section 3.

2.5. Control Algorithm Programming

Once the neural network controller is selected, it is implemented on industrial control hardware to enable real-time irrigation control under laboratory-scale greenhouse conditions. The Delta AS218TX-A programmable logic controller (PLC) AS200 series is used from Delta Electronics, Inc., Taipei, Taiwan. This PLC is selected for its processing capacity, compatibility with multiple communication protocols, and ease of integration with sensors and actuators.
The neural network code is extracted from the Simulink environment and integrated into the PLC. The network consists of one input layer and one output layer with five neurons. The input is the soil moisture error, and the output is a signal that controls the opening of a proportional valve to regulate water flow supplied to the crop.
The code is first generated in C language from the neural network model. It is then translated into structured text (ST) and integrated into the DIADesigner environment, which is compatible with the Delta AS218TX-A PLC. The weights and biases assigned to each neuron in the input and output layers appear in Table 4.
Table 4. Weights and biases of the hidden and output layers.
The implementation process begins with the normalization of the soil moisture error, adapting the input signal to the range required by the first-layer neurons. Each hidden neuron then combines the input with its weight and bias, applies a scaling factor, and passes the result through a sigmoid activation function. The activated outputs are multiplied by their corresponding weights in the second layer and summed up to produce the network response. Finally, the accumulated output is mapped linearly to adjust its range, generating the control signal applied to the proportional valve. In this way, the PLC executes the neural network in real time, enabling soil moisture control through the irrigation system.

2.6. Irrigation System Implementation

The irrigation system implementation includes the instrumentation of all greenhouse devices to ensure correct operation. The setup incorporates sensors to measure soil moisture, temperature, relative humidity, and flow, as well as actuators such as the irrigation pump, proportional valve, solenoid valve, and dual fans. These devices are integrated through the control panel, which includes power supplies, analog input modules, the PLC, an HMI screen, a relay stage, and communication devices such as a switch and a 3G router (Figure 6).
Figure 6. Greenhouse control panel.
Sensors transmit analog signals to the PLC input modules, where data acquisition and preprocessing are performed. The PLC executes the corresponding control algorithm and generates analog and digital outputs to actuate the proportional valve, solenoid valve, pump, and fans through the relay stage. The HMI enables local supervision, while remote access is provided via the 3G router.
The irrigation system incorporates multiple sensors and actuators. Sensors acquire data and provide feedback to the control algorithm, while actuators execute irrigation and ventilation actions under PLC control.
The soil moisture sensors (ECH2O EA-10, Decagon Devices, Pullman, WA, USA) include four units, two assigned to the NN controller and two to the on–off (OF) controller, with an accuracy of ±2% and an analog output range of 4–20 mA. The sensors were installed following the manufacturer’s recommended procedure to ensure proper contact between the probe and the substrate. Each probe is approximately 14.5 cm long and was inserted into the substrate at an angle of approximately 45°, ensuring full coverage of the sensor elements and avoiding contact with the bottom of the pot. Considering the substrate depth of 20 cm, a small space was maintained between the tip of the probe and the drainage layer to avoid contour effects. This installation ensures representative measurements of root zone moisture and minimizes air spaces or compaction around the sensor.
The temperature and relative humidity sensor (THD-DD2-C, Autonics Corporation, Busan, Republic of Korea) provides independent analog outputs (4–20 mA) for each variable, with a measurement range of −19.9 to 60.0 °C for temperature and 0.0 to 99.9% RH for relative humidity. This sensor is used only for environmental monitoring. Flow is measured with two generic Hall effect sensors (YF-S201, manufactured in Shenzhen, China) one for each controller, with a range of 1–30 L·min−1 and ±5% error. The sampling frequency for all sensors is one reading per minute. Data are processed in real time to feed the control algorithms.
The actuators include a ½” proportional valve with servomotor (HSH Flo Flo Equipments, Suzhou, China) for the NN controller, regulated by a 0–5 VDC analog signal. The OF controller uses a two-position ½” solenoid valve. A 50 W water pump (24 VDC, 13 L·min−1) supplies irrigation. Pump activation for both controllers is managed by hysteresis, oscillating between 77.3% and 79.2% soil moisture, with both controllers using the same reference (80%). Two pairs of fans are installed to recirculate internal air and extract hot air.
Soil moisture is measured using capacitive sensors installed directly in the substrate of each pot. The moisture signal is expressed as a percentage of saturation and is obtained by calibrating the sensor. The 0% reference corresponds to dry substrate conditions, while the 100% reference is established by completely saturating the substrate, allowing free drainage, and recording the stabilized output of the sensor. This calibrated sensor signal is used throughout the experiment for real-time monitoring and control.
The experimental setup includes nine pots with a maximum capacity of 61 L, each filled with 50 L of a commercially available organic substrate to a depth of 20 cm. The substrate was supplied as a premixed product commonly used in vegetable cultivation. No independent physical or hydraulic characterization (e.g., water retention curve) was conducted, as the study focuses on controller performance based on real-time soil moisture feedback rather than substrate-specific agronomic modeling. The pots have drainage holes at the base, allowing excess water to drain by gravity after irrigation while preventing interaction with the surrounding soil. Each pot contains three plants, for a total of 27 plants. The pots are arranged in three rows and three columns. Plants P1–P18 are assigned to the NN controller, while plants P19–P27 are assigned to the OF controller, as shown in Figure 7. Each controller operates independently over its assigned plants. All plants correspond to the same crop species and growth stage and are cultivated under uniform management practices throughout the experimental period. Although the total number of plants is limited by the laboratory-scale greenhouse dimensions, the experimental design ensures homogeneous conditions and repeated measurements over time, providing sufficient data for comparative performance analysis.
Figure 7. Plant distribution and assignment by controller type.

3. Results

3.1. Neural Network Training and Performance Evaluation

This subsection presents the numerical results obtained during the training, validation, and testing stages of the neural network controller. These results support the controller selection process described in Section 2.3. The selected network uses soil moisture error as the input variable and generates the control signal for the proportional valve as output. The network includes two hidden layers with five neurons, which provide sufficient modeling capability while avoiding excessive computational load.
Training and validation use the Levenberg–Marquardt algorithm with 1039 data samples, divided into training (70%, 727 samples), validation (15%, 156 samples), and testing (15%, 156 samples). This dataset was obtained from simulation-based scenarios, including responses generated by PID and fuzzy logic controllers, as well as idealized reference conditions corresponding to theoretical humidity trajectories without disturbances. These data were used exclusively for controller training and parameter tuning. The Levenberg–Marquardt algorithm was selected due to its fast convergence and suitability for function approximation problems. The training results are summarized in Table 5.
Table 5. Neural network training results.
Neural network performance is evaluated using the mean squared error (MSE) and regression coefficient (R) [21]. Low and consistent MSE values, together with high correlation coefficients across training, validation, and testing datasets, suggest adequate generalization capability and indicate a low risk of overfitting [22].

3.2. Simulation-Based Performance Comparison and Controller Selection

This section presents the simulation-based performance results of the PID, fuzzy logic, and neural network controllers using the evaluation criteria defined in Section 2.4. The PID controller evaluation shows the following values: settling time of 88.84 s, positive error of 2.24%, negative error of 0.28%, MSE of 1.6563%, MAE of 0.9426%, SE of 0.0002921%, NRMSE of 1.2869%, and system duty cycle time of 67.5 s.
The fuzzy logic (FL) controller achieves a settling time of 72.58 s, positive error of 2.23%, negative error of 0.4%, MSE of 1.5848%, MAE of 0.8745%, SE of 0.0003019%, NRMSE of 1.2588%, and duty cycle time of 69.4 s.
The neural network (NN) controller evaluation presents a settling time of 57.38 s, positive error of 2.32%, negative error of 0.02%, MSE of 1.8731%, MAE of 1.1214%, SE of 0.0002616%, NRMSE of 1.3686%, and duty cycle time of 87.4 s.
To select the controller, the values in Table 6 and Figure 8 are used, which summarize the results of the simulation of the three control methods.
Table 6. Simulation results for PID, FL, and NN controllers.
Figure 8. Simulation results of PID, FL, and NN controllers.
The PID controller has the longest settling time (88.84 s). Furthermore, its duty cycle time (67.5 s) is the lowest. The fuzzy logic controller (FL) shows the highest negative error (0.4%) and the lowest positive error compared to the other controllers. Additionally, it presents higher accuracy by obtaining the best values for MSE (1.5848%) and MAE (0.8745%), as well as a low NRMSE value. The neural network control algorithm (NN) has the shortest settling time (57.38 s) and the lowest negative error (0.02%), and its SE value (0.0002616%) is the lowest. It also demonstrates the longest duty cycle time (87.4 s) of the irrigation system.
Based on these results, the neural network controller is selected for implementation in the irrigation system. This selection is supported by its shorter settling time, minimal negative error, favorable NRMSE, and superior duty cycle time, which indicates faster moisture stabilization, reduced risk of over-irrigation, and improved system stability and energy efficiency. The low standard error further confirms the robustness of the neural network controller under the evaluated conditions.

3.3. Experimental Conditions

After completing the implementation and operation of the irrigation system, its performance is evaluated under real operating conditions using two control strategies: a neural network-based controller and a conventional on–off controller. The experimental evaluation spans 67 consecutive days, corresponding to the vegetative growth stage of the crop.
Both controllers operate simultaneously under identical environmental conditions, including the same moisture reference (80%), irrigation infrastructure, and management practices. Ambient temperature and relative humidity are continuously monitored to characterize greenhouse conditions and to verify that no environmental bias affects the comparative evaluation.
During the experimental period, ambient temperature varies between 9 °C and 45 °C, as shown in Figure 9, while relative humidity ranges from 9% to 95%, as illustrated in Figure 10. These measurements confirm that both control strategies are exposed to the same environmental disturbances, ensuring that observed performance differences arise from the control algorithms rather than external factors.
Figure 9. Ambient temperature during the experimental period, February–April 2025.
Figure 10. Ambient humidity during the experimental period, February–April 2025.

3.4. Soil Moisture Control Performance

Soil moisture regulation performance is evaluated using the mean squared error (MSE), mean absolute error (MAE), and standard error (SE), which quantify control accuracy, average deviation, and stability, respectively. The experimental results are summarized in Table 7. The neural network controller achieves lower values for all evaluated error metrics compared with the on–off controller. Specifically, the NN controller attains an MSE of 3.2159%, an MAE of 0.7560%, and an SE of 0.00001687%, whereas the OF controller records an MSE of 14.5553%, an MAE of 1.2782%, and an SE of 0.00003730%.
Table 7. Control errors recorded during the experiment.
These results indicate that the neural network controller maintains soil moisture closer to the reference value with reduced variability. Relative to the NN approach, the OF controller exhibits an MSE increase of 352.49%, an MAE increase of 69.08%, and an SE increase of 121.09%, confirming inferior accuracy and stability. Figure 11 illustrates the soil moisture response obtained with both control strategies.
Figure 11. Comparison of soil moisture behavior between NN and OF controllers.

3.5. Water Consumption Analysis

Water consumption performance is evaluated over the full 67-day experimental period. Although the total supplied water volume is similar for both controllers, normalization by the number of plants reveals substantial differences in irrigation efficiency.
The neural network controller supplies a total of 221.6 L to 18 plants, while the on–off controller supplies 222.4 L to nine plants. When expressed as average daily water consumption per plant, the neural network controller achieves a value of 0.183 L∙day−1∙plant−1, compared with 0.3687 L∙day−1∙plant−1 for the on–off controller. This result corresponds to a reduction of 50.18% in water consumption per plant when using the neural network-based control strategy. This reduction arises from the continuous regulation of irrigation flow through the proportional valve, which avoids the excessive water application inherent to binary on–off control. Figure 12 presents the comparative water consumption behavior for both control methods.
Figure 12. Comparison of water consumption between NN and OF controllers.

3.6. Crop Growth Response

Crop development is evaluated by monitoring plant growth throughout the experimental period. Stem length measurements are performed twice per week for all plants, from the stem base to the terminal bud, as illustrated in Figure 13. The experimental setup includes 27 plants in total, with 18 plants assigned to the neural network controller and 9 plants assigned to the on–off controller.
Figure 13. Measurement of plant length.
To quantify growth dynamics, the absolute growth rate (AGR) is calculated using Equation (12), as proposed by Hunt [23]. Figure 14 and Figure 15 illustrate the individual growth behavior of plants under neural network and on–off control, respectively.
A G R = L 2 − L 1 T
where the variables are as follows:
A G R = absolute growth rate (cm∙day−1);
L 2 = final plant length (cm);
L 1 = initial plant length (cm);
T = time interval between L 1 and L 2 (days).
Figure 14. Growth behavior of plants under NN control.
Figure 15. Growth behavior of plants under OF control.
Plants irrigated using the neural network controller reach an average AGR of 0.3694 cm∙day−1, whereas plants under on–off control reach an average AGR of 0.2922 cm∙day−1. This difference represents a 26.42% increase in vegetative growth rate when applying neural network-based irrigation control.
A Student’s t-test for independent samples with unequal variances confirms that the difference in mean AGR between the two control strategies is statistically significant (p = 0.03187 < 0.05), as summarized in Table 8. These results indicate that improved soil moisture regulation directly translates into enhanced crop growth during the evaluated phenological stage.
Table 8. Results of t-tests comparing AGR between NN and OF.

3.7. Root Development Analysis

Root development is assessed at the end of the experimental period by measuring root length for all plants. Plants under neural network control achieve an average root length of 24.97 cm, while plants under on–off control reach an average root length of 23.94 cm.
Although the neural network controller exhibits a higher mean root length, a Student’s t-test for independent samples with unequal variances indicates that the observed difference is not statistically significant (p = 0.6153), as presented in Table 9. This result suggests that, under the evaluated conditions and growth stage, root length shows lower sensitivity to irrigation control strategy than above-ground vegetative growth.
Table 9. Results of t-tests comparing root length between NN and OF.

4. Discussion

The experimental results demonstrate clear performance differences between the evaluated irrigation control strategies. The neural network controller exhibits superior soil moisture regulation, achieving higher stability, a 50.18% reduction in water consumption per plant, and a significant improvement in crop growth compared with the conventional on–off controller. These outcomes confirm that advanced control strategies can translate directly into agronomic benefits when implemented under real operating conditions.
The improved performance of the neural network controller is primarily attributed to its continuous and nonlinear control action. Unlike the on–off strategy, which applies irrigation in discrete intervals and induces oscillatory soil moisture behavior, the neural network controller dynamically adjusts the irrigation flow based on the instantaneous moisture error. This behavior explains the lower variability observed in soil moisture and the substantially reduced control errors (MSE, MAE, and SE). Similar trends have been reported in previous studies employing intelligent controllers, where water savings ranging from 18% to 69% are achieved through improved regulation efficiency [9,13,15].
From an agronomic perspective, the higher absolute growth rate (AGR) obtained under neural network control highlights the importance of stable soil moisture conditions during the vegetative growth stage. Excessive oscillations, commonly associated with on–off control, may introduce transient water stress that limits nutrient uptake and biomass accumulation. The statistically significant difference in AGR, confirmed through Student’s t-test, is consistent with prior research demonstrating the positive impact of intelligent irrigation control on crop development and productivity [11,12].
Although the on–off controller remains an attractive solution for low-cost or resource-constrained applications due to its simplicity and minimal computational requirements [5,6,7], the experimental results reveal inherent limitations in precision and water use efficiency. In this study, the on–off method exhibits greater soil moisture variability and more than double the average daily water consumption per plant compared with the neural network controller. These limitations restrict its applicability in crops that require tight moisture regulation or in regions facing increasing water scarcity.
A key contribution of this work lies in the successful integration of a neural network control algorithm into an industrial-grade programmable logic controller (PLC) with human–machine interface (HMI) and remote monitoring capabilities. Unlike many previous studies that remain limited to simulation environments or microcontroller-based prototypes [9,10,14], the proposed implementation demonstrates that advanced control algorithms can be deployed on robust industrial platforms commonly used in commercial agricultural systems. This integration enhances reliability, scalability, and practical applicability, bridging the gap between academic research and real-world deployment.
The laboratory-scale greenhouse was intentionally selected as an intermediate validation step between simulation-based studies and full-scale production environments. This configuration allowed for controlled evaluation of the controller’s dynamic performance while retaining relevant real-world constraints such as sensor noise, actuator delays, and environmental disturbances. Therefore, the results presented in this study should be interpreted as a proof of concept for production-level implementation, rather than definitive agronomic optimization.
Despite the promising results, the experimental setup is constrained by the limited number of plants imposed by the laboratory-scale greenhouse. Nevertheless, the use of simultaneous operation, homogeneous environmental conditions, and repeated measurements over an extended period provides sufficient data to support a reliable comparative analysis. Future work should focus on extending the experimental validation to larger cultivation areas, different crop types, and varying climatic conditions to further assess the robustness and generalizability of the proposed control strategy.

5. Conclusions

This study develops, implements, and experimentally validates a neural network-based control algorithm for a drip irrigation system operating in a laboratory-scale micro-tunnel greenhouse. The controller is deployed on an industrial programmable logic controller (PLC) and evaluated under real operating conditions. Compared with a conventional on–off method, the proposed controller achieves a 50.18% reduction in average daily water consumption per plant, maintains soil moisture with higher precision, and enhances crop development, with a 26.42% increase in absolute growth rate under identical environmental conditions.
The experimental results demonstrate that the neural network controller provides greater accuracy and stability in soil moisture regulation, as confirmed by lower error metrics (MSE, MAE, and SE). The successful integration of the control algorithm into a PLC, together with an HMI interface and remote monitoring capabilities, confirms the feasibility of deploying intelligent irrigation controllers on industrial hardware under real-time operating conditions.
The comparison with an on–off controller was intentionally selected as a realistic industrial benchmark, reflecting common practices in current irrigation systems. Rather than introducing a novel control algorithm, the main contribution of this work lies in experimentally quantifying the advantages of moving from conventional to intelligent control within a practical and scalable industrial setting.
Although the experimental validation is conducted at laboratory scale with a limited number of plants, the controlled conditions and direct comparison under identical environmental settings allow a meaningful assessment of the relative performance of the control strategies. These results highlight the potential of neural network-based controllers as a viable alternative to conventional irrigation methods in modern greenhouse systems, aiming to improve water use efficiency and crop performance.
Future work will focus on scaling the proposed system to pilot-scale greenhouses, validating its performance under different crops and environmental conditions, and incorporating additional control strategies and climate regulation mechanisms to further enhance irrigation efficiency.

Author Contributions

Conceptualization, C.G.-P., L.E.B.-S., L.M.F.-L., J.C.P.-P., D.E.C.-P. and G.J.R.-A.; methodology, J.C.P.-P. and G.J.R.-A.; software, J.C.P.-P. and D.E.C.-P.; validation, C.G.-P., L.E.B.-S., L.M.F.-L., J.C.P.-P., D.E.C.-P. and G.J.R.-A.; formal analysis, C.G.-P. and G.J.R.-A.; investigation, C.G.-P., L.E.B.-S. and G.J.R.-A.; resources, C.G.-P., L.E.B.-S., L.M.F.-L., J.C.P.-P., D.E.C.-P. and G.J.R.-A.; data curation, C.G.-P. and L.E.B.-S.; writing—original draft preparation, C.G.-P., L.E.B.-S., L.M.F.-L., J.C.P.-P., D.E.C.-P. and G.J.R.-A.; writing—review and editing, C.G.-P., L.E.B.-S., L.M.F.-L., J.C.P.-P., D.E.C.-P. and G.J.R.-A.; visualization, C.G.-P. and G.J.R.-A.; supervision, L.E.B.-S., J.C.P.-P., D.E.C.-P. and G.J.R.-A.; project administration, J.C.P.-P., D.E.C.-P. and G.J.R.-A.; funding acquisition, J.C.P.-P., D.E.C.-P. and G.J.R.-A. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Tecnológico Nacional de México through the Instituto Tecnológico de Culiacán, project number 19224.24-P.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Acknowledgments

The authors acknowledge the support of the Laboratory of Mechatronics and Control, Division of Graduate Studies and Research, Instituto Tecnológico de Culiacán, for providing the facilities and resources required to conduct the experimental work.

Conflicts of Interest

The authors declare no conflicts of interest. The funders had no role in the design of the study, in the collection, analyses, or interpretation of data, in the writing of the manuscript, or in the decision to publish the results.

Abbreviations

The following abbreviations are used in this manuscript:
NNNeural network
OFOn–off
PLCProgrammable logic controller
HMIHuman machine interface
FLFuzzy logic
PIDProportional–integral–derivative
MSEMean squared error
MAEMean absolute error
SEStandard error
AGRAbsolute growth rate

References

  1. FAO. El Estado Mundial de la Agricultura y la Alimentación 2020; FAO: Rome, Italy, 2020. [Google Scholar] [CrossRef] [Scilit]
  2. FAO. El Estado de la Seguridad Alimentaria y la Nutrición en el Mundo 2023; FAO: Rome, Italy; IFAD: Rome, Italy; UNICEF: New York, NY, USA; WFP: Rome, Italy; WHO: Geneva, Switzerland, 2023. [Google Scholar] [CrossRef] [Scilit]
  3. Conagua. Plan Nacional Hídrico 2024–2030. 2024. Available online: https://agua.org.mx/wp-content/uploads/2024/11/Plan-Nacional-Hidrico-21-11-24.pdf (accessed on 19 August 2025).
  4. SADER. Tipos de Estructura para la Agricultura Protegida. Secretaría de Agricultura y Desarrollo Rural. 2020. Available online: https://www.gob.mx/agricultura/articulos/agricultura-protegida-otra-manera-de-cultivar (accessed on 18 May 2024).
  5. Elhassan Ahmed, O.M.; Osman, A.A.; Awadalkarim, S.D. A Design of an Automated Fertigation System Using IoT. In Proceedings of the 2018 International Conference on Computer, Control, Electrical, and Electronics Engineering (ICCCEEE), Khartoum, Sudan, 12–14 August 2018; pp. 1–5. [Google Scholar] [CrossRef] [Scilit]
  6. Getu, B.N.; Attia, H.A. Automatic Control of Agricultural Pumps Based on Soil Moisture Sensing. In Proceedings of the AFRICON 2015, Addis Ababa, Ethiopia, 14–17 September 201; pp. 1–5. [CrossRef] [Scilit]
  7. Nasution, T.H.; Parinduri, A.D.; Harahap, L.A.; Nasution, C.F. Design of soil moisture control prototypes for plant cultivation. In Proceedings of the 2019 3rd International Conference on Electrical, Telecommunication and Computer Engineering (ELTICOM), Medan, Indonesia, 16–17 September 2019; pp. 82–85. [Google Scholar] [CrossRef] [Scilit]
  8. Kabir, M.Y.; Nambeesan, S.U.; Bautista, J.; Díaz-Pérez, J.C. Effect of irrigation level on plant growth, physiology and fruit yield and quality in bell pepper (Capsicum annuum L.). Sci. Hortic. 2021, 281, 109902. [Google Scholar] [CrossRef] [Scilit]
  9. Krishnan, R.S.; Julie, E.G.; Robinson, Y.H.; Raja, S.; Kumar, R.; Thong, P.H.; Son, L.H. Fuzzy Logic based Smart Irrigation System using Internet of Things. J. Clean. Prod. 2020, 252, 119902. [Google Scholar] [CrossRef] [Scilit]
  10. Aghaseyedabdollah, M.; Alaviyan, Y.; Yazdizadeh, A. IoT Based Smart Greenhouse Design with an Intelligent Supervisory Fuzzy Optimized Controller. In Proceedings of the 2021 7th International Conference on Web Research, (ICWR), Tehran, Iran, 19–20 May 2021; pp. 311–317. [Google Scholar] [CrossRef] [Scilit]
  11. Souza, G.; Aquino, P.T.; Filev Maia, R.; Kamienski, C.; Soininen, J.-P. A fuzzy irrigation control system. In Proceedings of the 2020 IEEE Global Humanitarian Technology Conference (GHTC), Virtual, 29 October–1 November 2020; pp. 1–6. [Google Scholar] [CrossRef] [Scilit]
  12. Pezol, N.S.; Adnan, R.; Tajjudin, M. Design of an Internet of Things (Iot) Based Smart Irrigation and Fertilization System Using Fuzzy Logic for Chili Plant. In Proceedings of the 2020 IEEE International Conference on Automatic Control and Intelligent Systems (I2CACIS), Shah Alam, Malaysia, 20 June 2020. [Google Scholar] [CrossRef] [Scilit]
  13. Singh, N.; Ajaykumar, K.; Dhruw, L.K.; Choudhury, B.U. Optimization of irrigation timing for sprinkler irrigation system using convolutional neural network-based mobile application for sustainable agriculture. Smart Agric. Technol. 2023, 5, 100305. [Google Scholar] [CrossRef] [Scilit]
  14. Culebro de la Piedra, M.; Gómez Gómez, A.G.; López Molina, J.A.; Morales Navarro, N.A.; Guzmán Sánchez, J.O. Modelo neurodifuso para el control de humedad del suelo en cultivo hidropónico para la planta de tomate. Rev. Tecnol. Digit. 2016, 6, 43–56. Available online: www.revistatecnologiadigital.com (accessed on 10 April 2024).
  15. Jinjun, Z.; Huai, S.; Peng, G. Resilience-based supply assurance of natural gas pipeline networks and its research prospects. Acta Pet. Sin. 2020, 41, 1665–1678. [Google Scholar] [CrossRef]
  16. Padilla Rochín, J.D. Desarrollo del Control de Sistema de Fertirriego en un Invernadero Hidropónico para Producto Primario. Master’s Thesis, Tecnológico Nacional De México Instituto Tecnológico De Culiacán, Culiacán, Mexico, 2023. [Google Scholar]
  17. Martínez-González, F.; Sosa-Pérez, F.; Ortiz-Medel, J. Comportamiento de la humedad del suelo con diferente cobertura vegetal en la Cuenca La Esperanza. Tecnol. Cienc. Agua 2010, 1, 89–103. Available online: http://www.scielo.org.mx/scielo.php?script=sci_arttext&pid=S2007-24222010000400005 (accessed on 4 February 2025). [CrossRef] [Scilit]
  18. Mahmood, Q.A.; Nawaf, A.T.; Mohamedali, S.A. Simulation and performance of liquid level controllers for linear tank. J. Teknol. 2020, 82, 75–82. [Google Scholar] [CrossRef] [Scilit]
  19. Cevallos Muños, O. Introducción a la Mecánica de Fluidos; Universidad Técnica Estatal de Quevedo: Quevedo, Ecuador, 2022; p. 186. [Google Scholar]
  20. Asghari, M.; Fathollahi-Fard, A.M.; Al-E-Hashem, S.M.J.M.; Dulebenets, M.A. Transformation and Linearization Techniques in Optimization: A State-of-the-Art Survey. Mathematics 2022, 10, 283. [Google Scholar] [CrossRef] [Scilit]
  21. Goodfellow, I.; Bengio, Y.; Courville, A. Deep Learning; The MIT Press: Cambridge, MA, USA, 2016. [Google Scholar]
  22. Yang, Z.; Li, X.; Xiang, Q.; He, Q.; Faber, M.H.; Zio, E.; Su, H.; Zhang, J. A resilience evaluation method of natural gas pipeline system based on uncertainty analysis. Process Saf. Environ. Prot. 2023, 177, 891–908. [Google Scholar] [CrossRef] [Scilit]
  23. Hunt, R. Basic Growth Analysis; Springer: Dordrecht, The Netherlands, 1990. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.