GREENAI: AN ESP32-BASED OFFLINE IOT SENSING AND EDGE-INFERENCE SYSTEM FOR PRECISION AGRICULTURE in Pakistan

Authors

  • Qasim Ali Hashim
  • Zain Sajjad
  • Muhammad Saqib Ali

Keywords:

Keywords Wireless sensor node; ESP32; Edge inference; Offline-first IoT; Sensor validation; Crop recommendation; Plant disease detection; Precision agriculture.

Abstract

Precision agriculture in low-connectivity regions depends on rugged, low-cost field hardware and decision-support software that can operate without continuous cloud access. This article presents GreenAI, an offline-first precision-agriculture system engineered around an ESP32-based wireless sensor node and an edge-assisted inference pipeline. The sensing node integrates soil-moisture, temperature and humidity (DHT22), pH, and light-intensity (BH1750) sensors together with a GPS module and on-board MicroSD logging; it acquires field measurements locally and synchronises them to a FastAPI/SQLite backend over Wi-Fi through a store-and-forward protocol that tolerates intermittent connectivity. Soil-moisture and pH readings from the node were validated against calibrated reference instruments to quantify sensing accuracy. On this platform, three analytical modules operate as interchangeable software components: a crop-recommendation model, a plant-disease classifier, and an explainable-AI layer. A Punjab-oriented crop-recommendation dataset of 2,300 plus balanced samples across 19 crops compiled from public Punjab Agriculture Department crop and agro-climatic records and class-balanced for training was used to benchmark five classifiers; XGBoost offered the best accuracy-to-footprint trade-off (97.40% test accuracy, macro F1-score 0.9741), while a compact 0.43 MB SVM was retained for on-device edge inference. A plant-disease classifier based on EfficientNetV2-S, trained on a unified 113-class image set, reached 99.03% validation accuracy. SHAP, partial-dependence, and Grad-CAM analyses were incorporated for interpretability. A working field prototype demonstrated end-to-end operation—local sensing, offline buffering, wireless transfer, and dashboard visualisation—showing GreenAI to be a deployable engineering solution for resource-constrained farms. A multilingual mobile advisory application and market-information module are under active development.

Downloads

Published

2026-03-31

How to Cite

Qasim Ali Hashim, Zain Sajjad, & Muhammad Saqib Ali. (2026). GREENAI: AN ESP32-BASED OFFLINE IOT SENSING AND EDGE-INFERENCE SYSTEM FOR PRECISION AGRICULTURE in Pakistan. Spectrum of Engineering Sciences, 4(3), 8001–8021. Retrieved from https://www.thesesjournal.com/index.php/1/article/view/4034