Microservice-Based IoT Architecture for Precision Agriculture: ESP32 vs. Arduino Edge Nodes
Abstract
This paper presents a microservice-based system architecture for collecting, processing, and analyzing agrotelemetry data in real-time to support precision agriculture. The study aims to evaluate the effectiveness of the ESP32 microcontroller platform (Espressif Systems) and Arduino Nano with Long Range (LoRa) platforms as edge nodes for monitoring agro-environmental parameters, including soil moisture, air temperature, and humidity. The objectives are: (i) to validate an end-to-end microservice streaming pipeline for agrotelemetry, (ii) to operationalize a low-latency critical-event detector in the streaming layer, and (iii) to compare ESP32 and Arduino Nano + LoRa under unified Key Performance Indicators (KPIs) (latency, reliability, accuracy, where applicable, and energy consumption) to provide evidence-based deployment guidance. The proposed architecture leverages Kubernetes, Apache Kafka, Apache Flink, and InfluxDB to ensure horizontal scalability, fault tolerance, and low-latency processing. For automated critical event detection, we implemented a novel streaming algorithm combining static thresholds with dynamic z-score analysis and a confirmation mechanism to reduce false positives. The experimental methodology involved laboratory tests and field trials conducted in a greenhouse. Results indicate a clear trade-off: the ESP32 platform achieved lower network latency and higher accuracy, while the Arduino Nano with LoRa was significantly more energy-efficient and demonstrated superior long-range link stability. Based on these findings, we recommend using the ESP32 for time-sensitive applications within Wi-Fi coverage and the Arduino Nano with LoRa for energy-constrained, remote deployments. A hybrid strategy is proposed to strike a balance between responsiveness and energy autonomy. The unified pipeline provides a reproducible framework for evaluating trade-offs among latency, accuracy, reliability, and energy consumption in agrotelemetry systems.