Preprint
Article

This version is not peer-reviewed.

Smart Irrigation Architecture Based on Machine Learning and IoT Telemetry to Reduce Water Consumption in Urban Agriculture in Lima

Submitted:

28 November 2026

Posted:

30 November 2026

You are already at the latest version

Abstract
Efficient water use is a central challenge for urban agriculture in arid cities such as Lima, where irrigation must reconcile scarce water with crop needs. This study presents Yaku, a web application based on the Internet of Things (IoT) and machine learning, aimed at op-timizing irrigation in urban gardens. An ESP32-S3 sensor node measures soil moisture, soil temperature, air humidity, and air temperature, while an ESP32 actuator node con-trols a solenoid valve and meters of water flow. Both nodes communicate via MQTT with a Raspberry Pi 5 hosting a FastAPI backend, a PostgreSQL database, a Random Forest classifier and a React web application through which the farmer monitors sensor read-ings, model decisions and per-event water use. The classifier was trained on 3,000 obser-vations from a public irrigation dataset, labelled with lettuce-specific agronomic rules de-fined by the farmer. On a held-out test set (20%), it reproduced these rules with 98.7% ac-curacy and an F1-score of 0.985. A 39-day deployment in a 5 m2 urban lettuce garden con-firmed end-to-end operation: of 8,379 inferences, 136 triggered irrigations, all executed, applying 531.8 L. These results demonstrate the technical feasibility of the application, while field validation of water savings remains in future work
Keywords: 
;  ;  ;  ;  ;  ;  ;  ;  ;  
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.