Biologypreprint2026-08-09

SPAI-EH: An IoT and Generative-AI System for Hail and Heavy-Rain Protection in Smallholder Agriculture in Puebla, Mexico

Open access0 citations

Abstract

Hail and sudden heavy rainfall regularly destroy vegetable and grain crops in the state of Puebla, Mexico, with the state's rural-development authority reporting thousands of damaged hectares within a single growing cycle. This paper presents SPAI-EH, a low-cost Internet of Things system that detects intense rainfall and hail in real time, automatically closes a protective gate over the affected plot, and routes the captured water toward irrigation reuse. The pilot implementation uses an ESP32 microcontroller simulated in Wokwi, combining a DHT22 temperature and humidity sensor with an analog potentiometer that emulates a rain and hail intensity sensor, a servo-actuated gate, a warning LED, and a liquid-crystal display. Readings are classified locally through threshold rules and, when connectivity is available, through a call to a cloud generative-AI model that returns a hazard classification and a gate action. Every reading is stored in an Oracle Application Express database accessed through RESTful web services, and a MIT App Inventor mobile application lets a grower monitor five simulated plots on a map and manually close a gate. Across the recorded test window, the system correctly distinguished normal conditions from three simulated hail events and one heavy-rain event in a single plot, while the remaining plots stayed within expected ranges. The paper also discusses the applicable IEEE IoT standards and the gap between the classroom pilot and a field-ready deployment.

// Source

View paper (DOI)Open access versionOpenAlexZenodo (CERN European Organization for Nuclear Research)Published 2026-08-09

Authors: Fabiola Guevara-Soriano, Monica María del Rivero-Sánchez, Joel García-Martínez, Héctor Alejandro Alvarez-Rosas

Institutions: Tecnológico de Monterrey