Inspiration

India has over 140 million smallholder farmers, and every year many of them lose 20–30% of their crop yield simply because they irrigate at the wrong time — either too late, after the crop is already stressed, or too early, wasting water right before rain arrives.

Satellite-based water stress detection already exists as a solution — companies like Farmonaut use the same free Sentinel-2 imagery we do. But their clients are agribusinesses like Godrej Agrovet, not individual farmers. Their tools require a smartphone app, account registration, and English literacy — barriers that shut out exactly the marginal farmers who need this the most.

We wanted to build the last-mile delivery layer: take the same satellite intelligence, and deliver it the way a farmer already communicates — over WhatsApp, in their own language, as a voice note.

What it does

A farmer sends a WhatsApp message with just their village name and crop — in Hindi, e.g. "Chitrakoot, gehun." Behind the scenes, JalSense:

  1. Geocodes the village to real coordinates, using a local database with a live OpenStreetMap fallback
  2. Pulls live Sentinel-2 satellite imagery for that exact location via the Copernicus Data Space Ecosystem
  3. Calculates NDWI (water stress index) and NDVI (vegetation health index) for the field
  4. Fetches a real 10-day weather forecast
  5. Runs a crop-specific stress prediction model — different crops (like flooded rice vs. dry-farmed wheat) have very different "healthy" water signatures, so thresholds are calibrated per crop
  6. Replies with a Hindi voice note explaining the situation and what action to take, factoring in whether rain is already on the way

We also built a web dashboard — a live map of registered farmers colored by stress level, a farmer feed, aggregate stats, and a live demo panel where anyone can trigger the full pipeline in real time. The dashboard exists purely for visibility and scale-proof; farmers themselves never see it.

How we built it

  • Backend: Python + FastAPI, with a modular pipeline — separate services for geocoding, weather, satellite analysis, and stress prediction, each independently testable
  • Satellite data: Sentinel-2 imagery via the Copernicus Data Space Ecosystem's Statistical API, using a custom evalscript to calculate NDWI/NDVI directly on their servers — we never download raw imagery
  • Weather: Open-Meteo's free forecast API
  • Geocoding: A local CSV of pre-verified villages for speed and reliability, falling back to OpenStreetMap's Nominatim for anything else
  • Database: SQLite with SQLAlchemy, storing farmers and their alert history
  • WhatsApp bot: Built on Twilio's WhatsApp API, with a clean conversation state machine handling multi-turn interactions (village → crop → analysis → report)
  • Voice generation: Microsoft Edge TTS with a Hindi neural voice, generating audio in under a second
  • Frontend dashboard: React, Tailwind CSS, and Leaflet for the live map

We split the work cleanly: one of us owned the entire data/intelligence pipeline (satellite, weather, stress engine, database), the other built the WhatsApp conversation flow and voice generation. We agreed on a shared API contract early, which let both halves be built and tested in parallel without blocking each other.

Challenges we ran into

  • Satellite API debugging was genuinely hard. Getting real NDWI/NDVI values out of the Statistical API took several rounds of debugging: wrong coordinate reference system units for resolution, a missing dataMask input band causing every pixel to silently report as "no data," and a wrong API endpoint that returned valid-looking but empty responses. Each bug taught us something specific about how satellite remote sensing pipelines actually work under the hood.
  • Crop-specific calibration. Our first version used one universal NDWI threshold for every crop, which incorrectly flagged healthy, dry-farmed wheat as "critical" water stress — because wheat's natural NDWI range is very different from flooded rice. We had to build per-crop baseline ranges instead of a single global threshold.
  • A silent integration bug before our demo. While integrating the WhatsApp bot with the real backend, a request timeout that was too short (2 seconds) for our satellite pipeline (which genuinely takes several seconds) was silently causing every real request to fail and fall back to mock data — with no visible error. We only caught this by manually comparing real backend output against what the bot was actually displaying.
  • Reconciling two independently-built systems. Since we split the work and built our pieces separately, our data contracts didn't match exactly when we integrated — different field names, a 3-level vs. 4-level stress classification, and a message-generation mismatch where the reported severity level and the Hindi message text briefly disagreed with each other. Fixing this taught us the real value of designing and freezing an API contract early.

What we learned

  • How real satellite remote sensing pipelines work end-to-end — from raw spectral bands to normalized indices to crop-specific interpretation
  • The importance of designing a clean API contract before two people build independently, and the real cost when that contract isn't followed precisely
  • That "silent failures" (like a mock fallback with no visible error) are some of the most dangerous bugs, because everything looks like it's working
  • How to build a genuinely accessible product — one that meets its users where they already are, instead of asking them to adopt a new tool

What's next for JalSense

  • Expanding language support beyond Hindi using regional TTS voices
  • Adding crop-stage awareness (e.g., wheat at flowering stage has different water needs than at tillering)
  • A freemium model — free alerts for farmers, paid aggregated data access for agri-input companies and crop insurers who want to reach farmers at the moment they need a product

Built With

Share this project:

Updates

Submission history