Smart Sprinkler and Irrigation System for Ifrane Region: A Simulation-Based Approach Using AVR Microcontrollers

Smart Sprinkler and Irrigation System for Ifrane Region: A Simulation-Based Approach Using AVR Microcontrollers

Ahlam MOUSSA, Kacem CHAWQI, Ilham NAIT HIM, Jamal BAHRI, Moulay El Hassan El AZHARI

Abstract. A method to minimize and monitor water and energy consumption in agriculture and landscaping lies in using smart automated sprinkler irrigation systems. This paper presents a complete simulation of a smart irrigation design for efficient water use and optimal soil quality. The proposed system utilizes an ATmega32 AVR microcontroller, along with soil moisture, temperature, gas, and humidity sensors, a Pulse Width Modulation (PWM) control of water pumps and valves. It is automated to regulate irrigation intensity with a closed-loop control enhanced by a PID controller and a lightweight artificial intelligence-inspired decision layer using rainfall data of the region of Fes-Meknes-Ifrane for threshold adjustments. The results highlight the improvement of soil moisture stability in the range of 4%, as well as a respective mean absolute error and a root mean square error of 3.5% and 5% compared to a threshold sensing method only.

Keywords
Smart Irrigation, AVR Microcontroller, PWM Control, Soil Moisture Sensing, PID Control, Weather-Aware Irrigation, Proteus

Published online 4/25/2026, 7 pages
Copyright © 2026 by the author(s)
Published under license by Materials Research Forum LLC., Millersville PA, USA

Citation: Ahlam MOUSSA, Kacem CHAWQI, Ilham NAIT HIM, Jamal BAHRI, Moulay El Hassan El AZHARI, Smart Sprinkler and Irrigation System for Ifrane Region: A Simulation-Based Approach Using AVR Microcontrollers, Materials Research Proceedings, Vol. 64, pp 299-305, 2026

DOI: https://doi.org/10.21741/9781644904091-37

The article was published as article 37 of the book Energy Futures

Content from this work may be used under the terms of the Creative Commons Attribution 3.0 license. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.

References
[1] F. Taheripour, et al., Water Scarcity in Morocco, World Bank Group, 2020, p. 10. https://documents1.worldbank.org/curated/en/642681580455542456/pdf/Water-Scarcity-in-Morocco-Analysis-of-Key-Water-Challenges.pdf
[2] R.M. Cruse, D.L. Devlin, D. Parker, R.M. Waskom, Irrigation aquifer depletion: the nexus linchpin, J. Environ. Stud. Sci. 6 (2016) 149-160. https://doi.org/10.1007/s13412-016-0370-y
[3] G. Rajagopal, V.M. Lodd, A. Vignesh, R. Rajesh, V. Vijayaraghavan, Low cost cloud based intelligent farm automation system using Bluetooth Low Energy, in: 2014 IEEE Region 10 Humanitarian Technology Conference (R10 HTC), Chennai, India, 2014, pp. 127-132. https://doi.org/10.1109/R10-HTC.2014.7026324
[4] E.F. Camacho, C. Bordons, Constrained model predictive control, in: Model Predictive Control, Springer London, London, 2007, pp. 177-216.
[5] M.A. Johnson, M.H. Moradi, PID Control, Springer-Verlag London Limited, London, 2005.
[6] M. Lagasio, S. Barindelli, Z. Chitu, S. Contreras, A. Fernández-Rodríguez, M. de Klerk, A. Fumagalli, A. Gatti, L. Hammerschmidt, D. Haskovic, M. Milelli, Integrating Advanced Sensor Technologies for Enhanced Agricultural Weather Forecasts and Irrigation Advisories: The MAGDA Project Approach, Remote Sens. 17 (2025) 1855. https://doi.org/10.3390/rs17111855
[7] Information on www.meteoblue.com/en/weather/week/blue_united-states_5286039
[8] Information on https://openweathermap.org
[9] A.R. Al-Ali, I. Zualkernan, M. Rashid, A Smart Home Energy Management System Using IoT and Big Data Analytics Approach, IEEE Trans. Consum. Electron. 63 (2017) 426-434. https://doi.org/10.1109/TCE.2017.015014
[10] P. Megantoro, S.A. Aldhama, G.S. Prihandana, P. Vigneshwaran, IoT-based weather station with air quality measurement using ESP32 for environmental aerial condition study, TELKOMNIKA (Telecommun. Comput. Electron. Control) 19 (2021) 1316-1325. https://doi.org/10.12928/telkomnika.v19i4.18567
[11] A.D. Dharmavaram, T.S. Savithri, S.L. Sai, Design and implementation of real time data acquisition system using reconfigurable SoC, Int. J. Adv. Comput. Sci. Appl. 11 (2020) 9. https://doi.org/10.14569/IJACSA.2020.0110953
[12] S.P. Shaik, N.V. Sarath, P.N. Ramarao, Smart Irrigation System for Sweet Corn, in: 2025 International Conference on Electronics and Renewable Systems (ICEARS), 2025, pp. 1498-1504. https://doi.org/10.1109/ICEARS61622.2025.10474640
[13] R.K. Jain, Design and Modeling of Control System for Automation of Irrigation System Using PID and ANN Methods, Available at SSRN 4197630 (2022). https://doi.org/10.2139/ssrn.4197630