Sistema de Riego Inteligente para Granjas
Sobre Este Proyecto
This project, deployed on farms across Australia, delivers a comprehensive IoT-based solution for automating farm irrigation to optimize water usage and crop health. The system supports over 10 families of distributed sensor/actuator nodes, each built around the ESP32 microcontroller. Initially utilizing FreeRTOS within the Arduino framework, the firmware was later ported to ESP-IDF to leverage its advanced features.
The system features dual connectivity options: LoRaWAN (up to SF12 RX2) for extensive area coverage and Cat-M1 cellular for direct, reliable internet access. For LoRaWAN, data from gateways is processed by a Node-RED server, which translates raw data into MQTT messages before forwarding to an AWS backend. Cat-M1 devices send MQTT data directly to AWS. The AWS backend includes ChirpStack for LoRaWAN network management, Node-RED for data processing, and a custom WebApp for remote monitoring and control.
Motorized gates are controlled to precisely direct water flow based on sensor readings and schedules. Beyond remote control via the WebApp, each device features a comprehensive local user interface, including menus for data display, settings management, and manual operation, ensuring robust functionality even without network connectivity.
The project's codebase exceeded 60,000 lines, supporting a wide array of device configurations. Initially developed in C using the Arduino framework, the entire software was refactored into C++, fully embracing object-oriented principles like classes, inheritance, and polymorphism to manage the complexity of over 10 distinct device families. This refactoring also integrated FreeRTOS for improved real-time performance.
Over 2,000 devices were successfully deployed across Australia and remain operational today, a testament to the system's reliability. After the initial development and porting to ESP-IDF (to access features unavailable in the Arduino core for ESP32), I single-handedly maintained and enhanced the system with new features for a full year.
Componentes del Sistema:
- ESP32-based sensor/actuator nodes with FreeRTOS, later ESP-IDF.
- Dual LoRaWAN and Cat-M1 communication modules.
- MQTT protocol for standardized data interchange.
- AWS backend: ChirpStack, Node-RED, custom WebApp.
- Precise motorized gate control for water distribution.
- Comprehensive local UI (menus, data, settings) and remote WebApp.
- Support for 10+ device families with extensive configurations.
- Large-scale C++ codebase (>60,000 lines) using OOP principles.
- Deployed and operational in over 2,000 units in Australia.