FarmGuard Weather AI

Hyperlocal agricultural intelligence dashboard that turns sensor data and weather forecasts into actionable farming decisions. Real-time irrigation, spray windows, and crop stress insights at your fingertips.

FarmGuard Weather AI

Prototype Agricultural Weather Intelligence Dashboard

Summary

The Prototype Agricultural Weather Intelligence Dashboard is a lightweight React-based web application that ingests 15-minute telemetry from LoRaWAN-enabled field sensors (soil moisture, temperature, EC, weather variables) and correlates it with Open-Meteo forecasts (powered by NOAA GFS). Data flows through a REST ingestion endpoint into a time-series SQLite/PostgreSQL backend, where a processing pipeline normalizes readings and computes key agronomic metrics such as ET-driven water demand, Vapor Pressure Deficit (VPD), and spray window suitability. A 6-hour cron scheduler aggregates trends and caches 5-day forecasts for responsive visualization using Chart.js. The intuitive dashboard features zone selection, today’s goal cards, interactive 5-day outlook charts, and VPD/soil moisture profiles — all designed for quick field decisions. Built as a functional proof-of-concept, it demonstrates end-to-end IoT-to-insight flow while laying groundwork for real-time WebSockets, crop modeling, and regulatory reporting.

1. Project Overview

This prototype is a lightweight, browser-based intelligence dashboard designed for agricultural operations. It ingests hyperlocal environmental telemetry from a distributed sensor network, processes it through a simple normalization pipeline, and correlates it with public meteorological datasets to derive actionable field recommendations.

Primary Purpose:
To transform raw sensor telemetry and third-party weather data into farmer-readable guidance — specifically daily irrigation demand, spray windows, atmospheric stress indicators, and soil health metrics.

Scope:
This is a functional proof-of-concept. It demonstrates end-to-end data flow from physical sensing hardware to rendered visualizations, but does not yet include production-grade authentication, multi-tenant isolation, or long-term historical analytics.


2. Tech Stack

LayerTechnology
FrontendReact 18 (Vite build tool), Chart.js / Recharts for data visualization
StylingCSS modules + component-scoped styles
Weather APIOpen-Meteo (public NOAA/GFS downstream correlation)
Data TransmissionLoRaWAN (Long Range Wide Area Network)
Backend StorageTime-series capable store (SQLite/PostgreSQL for prototype)
GeolocationStatic coordinate mapping per monitoring zone

Prototype - as web access and as well as android app/iOS

3. Data Collection Architecture

3.1 Sensor Hardware (Source X)

Field-deployed environmental stations are equipped with the following telemetry array:

  • Soil moisture probe: Capacitance-based volumetric water content (%)
  • Soil temperature sensor: Thermistor at 6-inch depth (deg F)
  • Soil pore EC sensor: Electrical conductivity (dS/m)
  • Ambient air sensors: Temperature, relative humidity, barometric pressure
  • Rain gauge: Tipping bucket (inches accumulation)
  • Anemometer: Wind speed and direction
  • Solar radiation / UV sensor

All sensors are polled by a microcontroller at 15-minute intervals. The readings are packetized into a compact binary payload and transmitted via LoRaWAN to a cellular-enabled gateway.

3.2 LoRaWAN Transmission Flow

Sensor Node → LoRaWAN Gateway → Network Server → HTTP Endpoint

The payload is intentionally small to respect LoRaWAN duty-cycle constraints:

At the network server, the payload is decoded from Base64 and forwarded as a JSON POST to the ingestion endpoint.

3.3 Ingestion Endpoint

The backend exposes a simple REST receiver:

Example payload:


4. Data Storage & Schema

Telemetry is stored in a relational schema optimized for time-series insertions.

Core Table: telemetry_readings

Table: forecast_cache

Public weather forecast responses are cached to reduce API calls and enable offline dashboard rendering.


5. Data Processing Pipeline

5.1 Normalization

Raw readings are normalized to consistent units before any derived computation:

  • All temperatures stored as Fahrenheit
  • Rainfall as inches (cumulative per 24-hour window)
  • Wind speed as mph
  • Soil moisture as volumetric percent

5.2 Derived Metrics

The pipeline computes several derived values per zone:

Water Demand (ET deficit)

Where et0 is reference evapotranspiration retrieved from the public weather API.

Vapor Pressure Deficit (VPD) - Atmospheric Stress

High VPD indicates atmospheric stress demanding higher irrigation.

Spray Window Suitability

5.3 Aggregation Scheduler

A lightweight cron task runs every 6 hours to:

  1. Fetch latest 24h of sensor telemetry per zone.
  2. Compute rolling averages and daily totals.
  3. Pull fresh 5-day forecast from the external API.
  4. Write derived metrics to a daily_summary table.

6. Correlation with NOAA / Public Meteorology

The prototype does not ingest NOAA data directly. Instead, it uses Open-Meteo, which is a public aggregation service that normalizes multiple global meteorological inputs including NOAA GFS (Global Forecast System), ECMWF, and regional models.

6.1 Why This Indirection?

  • NOAA GFS requires GRIB2 decoding and large bandwidth; Open-Meteo provides a lightweight JSON REST layer.
  • It handles spatial interpolation automatically for the provided lat/lon.
  • It exposes agriculturally relevant parameters: ET0, soil temperature, humidity, precipitation probability.

6.2 Correlation Logic

The system correlates local sensor data with the regional model by computing deltas:

These deltas are not yet surfaced to the UI in the prototype, but they are stored in daily_summary for future calibration use.

6.3 NOAA GFS Reference

When reporting to agronomists or regulators, the system can reference the upstream model lineage:

  • Primary upstream source: NOAA GFS (Global Forecast System) via Open-Meteo pipeline
  • Resolution: 0.25 deg x 0.25 deg global grid
  • Update frequency: 4 times daily (00Z, 06Z, 12Z, 18Z)

7. Frontend Dashboard

7.1 Component Architecture

7.2 Critical Frontend Code: Forecast Labeling

One critical requirement was making the X-axis labels human-readable for farm operations. The shared formatter is:

Used in both the chart resolvers and the outlook strip.

7.3 Chart Resolvers

The chart system is resolver-based. Each chartKey maps to a function that transforms a zone object into Chart.js-compatible data:

7.4 Date Display Pattern

The header separates two distinct temporal concepts:


8. Forecast Data Format

The raw forecast from the upstream API is simplified into a flat array for frontend consumption:

Critical rule: date is stored as an ISO string; all formatting is deferred to the UI layer.


9. Future Directions

9.1 Near-term (Prototype → Alpha)

  • Real-time socket layer: Replace 6-hour cron polling with WebSocket pushes from the LoRaWAN network server.
  • Historical trending: Render 30-day soil moisture and ET0 trend lines rather than point-in-time snapshots.
  • Alerting: Push SMS/email alerts when VPD crosses crop-specific thresholds or soil moisture drops below refill points.
  • NOAA direct ingestion: For operations requiring regulatory-grade audit trails, implement direct GRIB2 ingestion from NOAA NOMADS rather than the simplified API.

9.2 Medium-term (Alpha → Beta)

  • Crop modeling integration: Feed water demand and GDD into simple crop growth models (e.g., ASCE standardized ET, CIMIS coefficients).
  • Multi-tenant zoning: Support distinct ranches with RBAC and zone-level configuration.
  • Mobile PWA: Add service worker, offline forecast caching, and field-friendly touch targets.
  • Sensor calibration dashboard: Surface the sensor-vs-forecast delta scores to agronomists for hardware recalibration.

9.3 Long-term (Production)

  • Machine learning pipeline: Train regression models on sensor + satellite + weather data to predict irrigation demand 7-14 days ahead with confidence intervals.
  • Valley integration: API integration with irrigation valve controllers for semi-automated pivot scheduling.
  • Regulatory reporting: Automated export of water usage and ET reports for state water board compliance.

10. Security & Data Integrity Notes

  • LoRaWAN payload includes AES-128 encryption at the physical layer.
  • The HTTP ingestion endpoint should implement basic API-key validation.
  • Sensor battery voltage is included in every payload to flag hardware degradation before data loss.
  • All timestamps are stored in UTC; localization happens only at the presentation layer.

11. Glossary

TermMeaning
ET0Reference evapotranspiration - the baseline water loss from soil and plants
VPDVapor pressure deficit - the atmospheric dryness driving plant water demand
GDDGrowing degree days - accumulated heat units for crop phenology
LoRaWANLow-power, long-range radio protocol for IoT telemetry
NOAA GFSNOAA Global Forecast System - global numerical weather prediction
GRIB2Standard binary format for meteorological grid data

© Dr. Balaji Ramanathan