# MATLAB-Based AI-IoT Framework Uses LSTM to Optimize Solar Smart Irrigation

> A new MATLAB-based AI-IoT simulation framework uses an LSTM neural network to predict irrigation demands, reducing water and energy use in solar-powered farming.

- Canonical URL: https://coreiten.com/en/article/matlab-ai-iot-framework-optimizes-solar-smart-irrigation
- Language: en
- Section: Energy Sources
- Author: Sami
- Published: 2026-10-14T08:01:43+03:00
- Modified: 2026-10-14T08:01:43+03:00
- Publisher: CoreITen (https://coreiten.com)
- Keywords: MATLAB, AI-IoT, LSTM, NASA POWER, MPPT, ANN, SVM

## Summary

Researchers proposed a MATLAB-based AI-IoT simulation framework utilizing an LSTM network to optimize smart solar irrigation systems.

- The framework was tested using real 2024 meteorological data from the NASA POWER database for the New Delta region in Egypt.
- The lightweight LSTM model features 32,466 trainable parameters, requiring 122.11 seconds for training and an average inference time of 0.186 ms per sample.
- The LSTM model achieved an accuracy of 96.11 percent, a recall of 0.9820, a precision of 0.9100, and an F1-score of 0.9446.
- The adaptive irrigation strategy delivered an estimated annual water-saving rate of 28.57 percent compared to a conventional fixed-schedule baseline.
- Motor energy use was reduced by 74.74 percent through adaptive pump-speed control within an 18 m² PV array setup.

**Why it matters:** This simulation framework demonstrates how combining machine learning with renewable energy management can drastically improve agricultural water and energy efficiency.

---

Researchers have proposed a new simulation framework built in MATLAB that integrates artificial intelligence and the Internet of Things (IoT) to manage smart solar irrigation. The study aims to address a gap in precision agriculture by combining an LSTM neural network for irrigation-demand prediction with adaptive irrigation management, photovoltaic (PV) energy control, and battery state-of-charge (SOC) management.

### System Architecture and Components

The proposed AI-IoT solar smart irrigation framework consists of five integrated subsystems represented within the MATLAB environment. These include a simulated environmental sensing module, a conceptual communication architecture, cloud-based data management, AI-based prediction, and adaptive pump-control strategies. To ensure continuous real-time operation, the framework adopts an Edge-Cloud execution architecture. Latency-sensitive tasks, such as LSTM inference, adaptive pump-speed control, Maximum Power Point Tracking (MPPT) regulation, and battery SOC management, are executed locally. The cloud platform is dedicated to remote monitoring, historical data storage, and supervisory functions.

### Environmental Data and Preprocessing

The framework was tested using real environmental and meteorological data from the NASA POWER database for the New Delta region in Egypt throughout 2024. The dataset includes variables such as air temperature, specific and relative humidity, surface pressure, wind speed, and solar radiation. Solar radiation data was converted to W/m² to facilitate power calculations. Soil moisture was estimated using the arithmetic mean of surface and root-zone soil wetness. To simulate practical sensor uncertainty and field-level measurement disturbances, stochastic Gaussian noise was added to the environmental measurements.

### LSTM Prediction Model

The prediction task is formulated as a binary classification problem where the LSTM network predicts the irrigation pump operating state (ON or OFF). The model processes sequential environmental and energy-related measurements organized into fixed-length temporal sequences of 12 consecutive observations. The dataset was divided into training (70 percent), validation (15 percent), and testing (15 percent) subsets, with minority-class samples randomly oversampled to balance the training data.

The LSTM model features a lightweight architecture with 32,466 trainable parameters. It was trained using the Adam optimizer with a fixed learning rate of 0.0005 for 20 epochs. In terms of computational efficiency, the model required 122.11 seconds for training and achieved an average inference time of 0.186 ms per sample, making it suitable for near real-time decision-making.

### Renewable Energy and Mathematical Modeling

The renewable-energy subsystem models power generation, energy storage, and irrigation-energy management. The framework assumes an 18 m² PV array with a conversion efficiency of 22 percent. An MPPT stage regulates the PV operating point with a constant assumed efficiency of 97 percent. The motor power consumption is estimated using the pump affinity law, allowing the pump speed to be dynamically regulated based on soil-moisture error, available PV power, and battery SOC. The battery-storage subsystem is constrained within predefined minimum and maximum limits of 50 percent and 85 percent, respectively.

### Performance and Benchmark Results

In testing, the LSTM model successfully classified irrigation pump operating states with an accuracy of 96.11 percent, a recall of 0.9820, a precision of 0.9100, and an F1-score of 0.9446. A benchmark comparison showed that the LSTM model consistently outperformed Artificial Neural Network (ANN) and Support Vector Machine (SVM) models across all evaluation metrics. A robustness analysis over ten independent training runs yielded an average classification accuracy of 96.36 percent with a standard deviation of 0.95 percent, indicating highly stable predictive performance.

The adaptive irrigation strategy resulted in an estimated annual water-saving rate of 28.57 percent relative to a conventional fixed-schedule baseline. Furthermore, motor energy use was reduced by 74.74 percent through adaptive pump-speed control. Environmental analysis of the simulation period showed an annual temperature range between 12 °C and 30 °C, directly affecting crop water demand and PV operating conditions. The annual power generation profile correlated with seasonal solar radiation, peaking at approximately 1.25 kW during the summer months.

### Future Hardware Implementation

The findings suggest that combining AI-based modeling for renewable energy management within a MATLAB irrigation simulation can be a valuable asset for improving efficiency and lowering resource use. According to the study, this simulation framework provides a promising foundation for the future implementation of hardware versions of intelligent, solar-powered irrigation devices.

## Sources

- [nature.com](https://www.nature.com/articles/s41598-026-74935-0?error=cookies_not_supported&code=fb48b39a-6efe-4c9f-a953-32b14c842788)
