YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
๐ง smart_irrigation_mesh
Smart Irrigation Mesh Network โ Federated ML Water Optimisation
Low-power IoT sensor mesh โ soil moisture + weather + crop model โ zero water waste
๐ The Problem
Agriculture consumes 70% of all global fresh water โ and most is wasted.
- Traditional irrigation: fixed schedule, uniform zones, no feedback
- A farmer irrigates at 6am every day โ regardless of last night's rain
- Result: 40โ60% of irrigation water evaporates, runs off, or over-saturates roots
- In Algeria alone: 7 billion mยณ/year wasted on inefficient irrigation
- The Sahara aquifer is being depleted at 10ร its recharge rate
The root cause: Farmers have no real-time data on what the soil actually needs.
โ The Solution
A self-organising mesh network of low-cost soil sensors that:
- Senses โ each node reads soil moisture, temperature, salinity, pH every 15 min
- Communicates โ LoRaWAN gossip protocol propagates readings across the mesh (10km range)
- Predicts โ on-device ML forecasts soil moisture 24h ahead using weather API
- Decides โ irrigation controller opens/closes valves per zone, per need
- Learns โ federated learning: each farm improves the shared model without sharing raw data
Soil sensor mesh (LoRaWAN)
โ readings every 15 min
Mesh gateway (edge aggregation)
โ fused field map
ML forecaster (soil moisture 24h ahead)
โ irrigation schedule
Valve controller (zone-by-zone)
โ feedback
Federated model update (privacy-preserving)
๐งฎ Core Algorithms
Soil Moisture Model (Bucket Model)
dฮธ/dt = P(t) + I(t) - ETโ(t)ยทKc - D(t)
ฮธ = volumetric soil moisture [mยณ/mยณ]
P(t) = precipitation rate
I(t) = irrigation rate (what we control)
ETโ = reference evapotranspiration (Penman-Monteith)
Kc = crop coefficient (wheat=1.15, tomato=1.05, date palm=0.9)
D(t) = deep drainage (when ฮธ > field capacity)
Penman-Monteith Evapotranspiration
ETโ = [0.408ยทฮยท(Rn-G) + ฮณยท(900/(T+273))ยทuโยท(eโ-eโ)] / [ฮ + ฮณยท(1+0.34ยทuโ)]
Rn = net radiation, G = soil heat flux
T = air temperature, uโ = wind speed at 2m
eโ = saturation vapour pressure
eโ = actual vapour pressure
ฮ = slope of vapour pressure curve
ฮณ = psychrometric constant
Irrigation Decision Rule
Trigger: ฮธ(t) < ฮธ_threshold(crop, growth_stage)
Volume: I* = (ฮธ_fc - ฮธ(t)) ร D_root ร A_zone
Cutoff: stop when ฮธ(t+ฮt_predicted) โฅ ฮธ_fc ร 0.9
Federated Learning (FedAvg)
Round r:
Each farm k computes: ฮwโ = โL(wแตฃ, Dโ) (local gradient)
Server aggregates: wแตฃโโ = ฮฃโ (nโ/n) ยท (wแตฃ - ฮทยทฮwโ)
Privacy: only ฮwโ is shared โ raw data Dโ never leaves the farm
๐๏ธ Architecture
smart_irrigation_mesh/
โโโ core/
โ โโโ sensor_node.py # SensorNode โ soil readings + LoRaWAN tx
โ โโโ mesh_network.py # Mesh topology + gossip routing
โ โโโ irrigation_controller.py # Valve control + decision logic
โโโ sensors/
โ โโโ soil_model.py # Bucket model โ soil moisture dynamics
โ โโโ et0_calculator.py # Penman-Monteith ETโ computation
โโโ ml/
โ โโโ moisture_forecaster.py # 24h soil moisture forecast (LSTM-lite)
โ โโโ federated_learner.py # FedAvg โ privacy-preserving farm learning
โโโ mesh/
โ โโโ lorawan_sim.py # LoRaWAN packet simulation
โ โโโ gossip_protocol.py # Epidemic mesh propagation
โโโ examples/
โโโ algeria_farm_demo.py # Full Algeria farm simulation
โก Quick Start
from smart_irrigation_mesh import IrrigationMesh
mesh = IrrigationMesh(
farm_name = "Ferme Mitidja โ Algeria",
area_ha = 50.0,
crop = "wheat",
n_nodes = 20, # sensor nodes
lat, lon = 36.5, 3.1, # GPS coordinates
)
# Deploy mesh โ nodes self-organise
mesh.deploy()
print(f"Mesh coverage: {mesh.coverage_pct:.0f}%")
print(f"Node density : {mesh.nodes_per_ha:.1f} nodes/ha")
# Run one day of smart irrigation
for hour in range(24):
state = mesh.tick(hour)
if state.irrigation_triggered:
print(f"Hour {hour}: Irrigation zone {state.zone} โ {state.volume_m3:.1f} mยณ")
# Season summary
report = mesh.season_report()
print(f"Water used : {report.water_used_m3:.0f} mยณ")
print(f"Water saved : {report.water_saved_pct:.0f}% vs traditional")
print(f"Yield estimate : {report.yield_estimate_t_ha:.1f} t/ha")
๐ Impact for Algeria
| Metric | Value |
|---|---|
| Agricultural area | 8.5 million ha |
| Current water waste | ~7 billion mยณ/year |
| Expected savings with mesh | 40โ55% reduction |
| Water saved | 3โ4 billion mยณ/year |
| Economic value (at $0.05/mยณ) | $150โ200M/year |
| Aquifer depletion rate reduction | Significant in Mitidja, Souf, Saoura |
๐บ๏ธ Roadmap
- v1.0 โ Soil bucket model + Penman-Monteith ETโ
- v1.0 โ LoRaWAN mesh simulation (20 nodes)
- v1.0 โ Irrigation decision engine
- v1.0 โ 24h moisture forecaster
- v1.0 โ Federated learning (FedAvg)
- v1.1 โ Real LoRaWAN hardware (RAK Wireless / Dragino)
- v1.2 โ Satellite ETโ (Sentinel-2 integration)
- v1.3 โ Arabic SMS alerts for farmers
- v2.0 โ National mesh (Algeria Ministry of Agriculture API)
๐ License
MIT License โ Copyright (c) 2026 swordenkisk github.com/swordenkisk/smart_irrigation_mesh
Idea score: 89.0/100 โ Novelty: 97 | Feasibility: 79 | Impact: 97 From ideas_database.db โ swordenkisk ๐ฉ๐ฟ March 2026
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support