STATIC WATER
ALARMS FAIL BEFORE
THE WAVE HITS.
Single-point threshold gauges trigger only after downstream embankments breach, while floating logs and storm debris cause rampant false alarms on raw ultrasonic sensors. AegisFlood is a 5-Node River Basin Hydrological Digital Twin and distributed early warning system combining ESP32-S3 1D Kalman filtering (|r_k| > 3.8σ debris rejection), 1D Saint-Venant kinematic wave forecasting (+15 to +120 min ahead), dynamic Dijkstra evacuation routing, and automatic 865 MHz LoRaWAN mesh failover.
MULTI-MODAL TRANSDUCER FUSION
Fuses 24 GHz FMCW radar / JSN-SR04T ultrasonic time-of-flight water stage (h = H_datum - c·t/2) with 0.2 mm tipping-bucket hyetograph interrupts and capacitive soil moisture probes.
EDGE 1D KALMAN & INNOVATION GATE
Executes a continuous 1D Kalman state estimator on the ESP32-S3. Instantaneous acoustic spikes (>0.45 m/s) caused by floating timber or debris trigger covariance inflation, preventing false community sirens.
KINEMATIC WAVE PROPAGATION
Couples Manning's open-channel discharge (Q = A·n⁻¹·R²/³·S¹/²) with 1D Saint-Venant kinematic wave celerity to project downstream flood crest arrival and ETA-to-Danger across all 5 river sectors.
DIJKSTRA ROUTING & LORA/CAP ALERT
Prunes inundated low-lying bridges from the community road graph G(V,E), computes shortest high-ground shelter paths via Dijkstra's algorithm, and broadcasts ITU-T CAP v1.2 alerts over 4G-MQTT + 865 MHz LoRa mesh.
Acoustic / Radar Time-of-Flight Burst
ESP32-S3 triggers a 10 µs pulse on GPIO4 and measures echo duration t_us on GPIO5, computing raw river stage h_raw = H_datum - (t_us / 5800).
Tipping-Bucket Hyetograph Interrupt
Hardware ISR on GPIO19 counts 0.2 mm rainfall bucket tips over a rolling 60-second window to compute instantaneous precipitation intensity I (mm/hr).
Soil Saturation & Runoff Coefficient
12-bit SAR ADC on GPIO34 samples volumetric soil moisture θ_v. When θ_v > 80%, infiltration drops and surface runoff coefficient C_r scales up to 1.6x.
Kalman Prior State Prediction
Edge filter projects prior water stage x̂_k⁻ = x̂_{k-1} and increments error covariance P_k⁻ = P_{k-1} + Q (process variance Q = 0.008 m²).
Innovation Gate Debris Rejection
Computes innovation residual r_k = |z_k - x̂_k⁻|. If floating logs or foam cause r_k > 0.45 m (3.8σ), measurement noise R is dynamically scaled by 65x.
Posterior Stage & Velocity Update
Updates Kalman gain K_k = P_k⁻ / (P_k⁻ + R_eff) and true stage x̂_k, then derives vertical rate-of-rise dh/dt (m/hr) from a 15-sample ring buffer.
Manning Open-Channel Discharge
Computes wetted cross-sectional area A(h), hydraulic radius R_h, flow velocity v = n⁻¹·R_h^(2/3)·S^(1/2), and volumetric discharge Q = A·v (m³/s).
1D Saint-Venant Kinematic Wave Lag
Propagates upstream discharge surges (Node 01 → Node 05) using kinematic wave celerity c_k = (5/3)·v, scheduling downstream crest arrival times.
Multi-Horizon Stage Projection
Synthesizes local dh/dt, upstream excess head, and queued wave energy into +15m, +30m, +60m, and +120m water level forecasts and ETA-to-Danger.
Cellular-to-LoRaWAN Mesh Failover
Transmits telemetry over 4G-LTE MQTT TLS. On cellular backhaul timeout, automatically switches to 865 MHz SX1276 LoRa P2P multi-hop mesh.
Dynamic Graph Edge Submergence Pruning
Evaluates road network G(V,E) against node water stages. Low-lying bridges with h_node ≥ H_submerge receive edge weight w(e) = ∞.
CAP v1.2 & Telegram Community Broadcast
Dispatches structured alerts containing current stage, +60m forecast, and turn-by-turn high-ground NDRF shelter routing to community channels.
1D Kalman Filtering, Sensor Fusion & Telemetry Framing
Bridge-Mounted Vertical River Stage Ranging
Disaster-Resilient P2P Mesh Backhaul (Cellular Failover)
Catchment Precipitation & Surface Runoff Coefficient Estimation
Autonomous Off-Grid Monsoon Operation
Community Strobe/Siren Actuation & Mobile Push Dispatch
// Flash to ESP32-S3 Edge Node (240 MHz Xtensa LX7 + FPU)
// JSN-SR04T/Radar: GPIO4/5 | Rain ISR: GPIO19 | SX1276 LoRa: SPI (865 MHz)
float stepEdgeKalman(float rawStageM, bool &anomalyRejected, float &residualM) {
residualM = fabs(rawStageM - kf.x);
anomalyRejected = (residualM > 0.45f); // 3.8σ Innovation Gate (Debris Reject)
kf.p = kf.p + 0.008f; // Prior covariance update
float effectiveR = anomalyRejected ? (0.080f * 65.0f) : 0.080f;
kf.k = kf.p / (kf.p + effectiveR);
kf.x = kf.x + kf.k * (rawStageM - kf.x);
kf.p = (1.0f - kf.k) * kf.p;
return kf.x;
}