🌍 Inspiration

Water is one of our most precious resources, yet billions of liters are lost every year to silent, invisible leaks. In university hostels, apartment complexes, and commercial facilities, a faulty toilet cistern, a leaking tap, or a fractured joint in a riser shaft can run undetected for weeks before anyone notices an inflated utility bill.

Traditional municipal water meters only measure cumulative monthly volume—they cannot detect leaks in real time or tell facility managers where a problem is occurring.

We built AquaGuard to make water monitoring proactive, explainable, and accessible. By pairing low-cost IoT hardware with an intelligent diagnostic engine, AquaGuard catches abnormal water usage in minutes rather than months.

Our project is directly aligned with three United Nations Sustainable Development Goals:

  • SDG 6 (Clean Water and Sanitation): Target 6.4 — Substantially increasing water-use efficiency and eliminating wasted potable water.
  • SDG 11 (Sustainable Cities and Communities): Target 11.B — Protecting buildings from structural flooding, ceiling collapses, and foundation water damage.
  • SDG 12 (Responsible Consumption and Production): Target 12.2 — Reducing municipal booster pumping electricity and associated carbon emissions.

💡 What it does

AquaGuard is an AI-powered fluid intelligence system that identifies abnormal water usage and potential leaks in real time across residential and commercial buildings.

Key features include:

  • Live Flow Telemetry: Displays instantaneous water velocity in Liters/Minute (L/min), tracks cumulative volume used today, and compares it against expected baseline demand.
  • Multi-Factor Anomaly Detection: Analyzes flow patterns across 4 distinct operational states:
    1. NORMAL: Flow is within expected diurnal time-of-day campus patterns.
    2. POSSIBLE LEAK DETECTED: Continuous low-to-moderate flow detected during expected low-usage off-hours (e.g., 2.4 L/min sustained for $>15$ minutes).
    3. HIGH-RISK ANOMALY DETECTED: Severe volumetric surges or ruptures (e.g., $>14$ L/min).
    4. INSUFFICIENT EVIDENCE: Defensive fallback triggered when sensor jitter, turbulence, or packet drops make data unreliable.
  • Transparent AI Explanations: Every alert includes a calibrated confidence score (e.g., $87\%$ for steady seepage, $96\%$ for surges), concrete observational evidence, differential root causes (e.g., toilet cistern flapper valve vs. riser joint fracture), and actionable inspection directives.
  • Water Wastage & Cost Estimation: Continuously calculates excess flow ($\text{Current} - \text{Expected}$) and projects potential daily wastage ($L/\text{day}$) and monthly loss ($L/\text{month}$), strictly labeled as empirical estimates.
    • Example: At a baseline of $0.3\text{ L/min}$, an undetected leak flowing at $2.4\text{ L/min}$ wastes an excess $2.1\text{ L/min}$—equating to 3,024 liters wasted every 24 hours (over 90,000 liters monthly).
  • Dynamic Priority Problem Queue: Ranks multi-zone pipe alerts across buildings using: $$\text{Priority Score} = \text{Severity} \times \text{Confidence} \times \text{Continuous Duration} \times \text{Estimated Wastage}$$ (e.g., Escalating Hostel Block B, Pipe Section B-12 to HIGH PRIORITY).
  • Safety by Design Guardrails: Software and hardware interlocks strictly prohibit automated water supply shutoffs to protect emergency fire suppression risers and sanitation from false alarms. Human on-site inspection is always required before intervention.
  • Automated 1-Click Guided Demo: Features an automated live demonstration studio that cycles through all 4 fluid dynamics scenarios with on-screen narration, allowing anyone to evaluate the system with or without physical hardware.

🛠️ How we built it

AquaGuard was developed as a clean, modular full-stack IoT architecture:

  • IoT Edge Hardware (Firmware Provided):
    • ESP32 DevKit V1: Microcontroller programmed in C++ using hardware interrupt service routines (IRAM_ATTR) on GPIO 4.
    • YF-S201 Hall-Effect Sensor: Measures fluid velocity via turbine-generated magnetic pulses, calibrated using $f = 7.5 \times Q$ to calculate flow in $L/\text{min}$.
    • Sends JSON telemetry over Wi-Fi via HTTP POST (/api/telemetry).
  • Backend & AI Engine:
    • Python 3.13 & FastAPI: High-performance asynchronous REST API and WebSocket streaming with an automatic 2.5-second polling fallback.
    • Anomaly Detection Logic: Uses statistical variance analysis, continuous duration tracking, and a 24-hour diurnal campus consumption curve (modeling morning showers, daytime academic lulls, and deep-night deadbands).
    • SQLite Database: Stores time-series flow logs, active alerts, and multi-zone sensor node registries.
  • Frontend Dashboard:
    • React 19 & Vite: Ultra-fast, single-page reactive interface.
    • Tailwind CSS: Custom dark-mode theme optimized with high-contrast typography and full mobile responsiveness.
    • Recharts: Renders real-time flow dynamic area charts, 24-hour diurnal load comparisons, and cumulative wastage loss curves.
    • Interactive Hardware Lab: In-browser API dispatcher enabling users to inject custom telemetry payloads directly into the backend.

⚡ Challenges we ran into

  • Distinguishing Human Habits from Plumbing Failures: A student taking a shower at 7:30 AM produces the same flow rate as a broken pipe. Rather than relying on simple static thresholds, we incorporated continuous duration tracking and diurnal time-of-day curves. Because humans shut off taps after 1–3 minutes while mechanical leaks flow continuously with near-zero variance, the AI reliably separates legitimate consumption from leaks.
  • Handling Noisy Sensor Data: Air bubbles, pipe turbulence, and wiring flutter can cause turbine pulse sensors to output erratic readings. Instead of triggering false alarms, we engineered an INSUFFICIENT EVIDENCE defensive state that informs maintenance teams to inspect wiring and bleed air pockets before taking action.
  • Balancing Automation and Safety: In critical civic infrastructure, automatically cutting off a water supply could shut down fire sprinkler lines or cut off water during exam hours. We resolved this by building a Safety by Design interlock that keeps automated shutoffs locked, mandating on-site physical inspection.
  • Hardware-Independent Demonstration: To ensure evaluators can test the complete system without needing physical pipes and microcontrollers, we built a Digital Twin Simulator with an automated 1-click walkthrough.

🏆 Accomplishments that we're proud of

  • Successfully bridging physical IoT sensing, real-time backend processing, multi-factor AI diagnostics, and a responsive web dashboard into a single cohesive platform.
  • Creating an explainable AI engine that provides transparent confidence scores, observational evidence, and root causes instead of opaque alerts.
  • Developing a defensive AI that gracefully acknowledges uncertainty through the INSUFFICIENT EVIDENCE state.
  • Accurately converting raw turbine pulses into tangible environmental and cost metrics (liters conserved, pumping kWh saved, and avoided $\text{kg CO}_2\text{e}$).
  • Providing an Automated Live Demo Tour that showcases the complete system in under two minutes.

📚 What we learned

  • Defensive AI builds trust: In building management, a system that transparently admits uncertainty builds far more credibility with facility engineers than one that forces false-positive conclusions.
  • Context is everything in IoT: Flow rate alone is meaningless without knowing the time of day, continuous duration, and signal variance.
  • Clear segregation of data: Directly measured physical sensor readings must always be explicitly separated from algorithmic estimates.
  • Mobile-first design is essential: Maintenance teams inspect pipes with smartphones, so dashboards must prioritize high-contrast typography, large touch targets, and fluid responsive layouts.

🔮 What's next for AquaGuard

  • Acoustic Sensor Fusion: Incorporate low-cost MEMS contact microphones onto pipe unions to correlate volumetric flow anomalies with ultrasonic acoustic vibration for millimeter-level leak localization inside walls.
  • Long-Range LoRaWAN & NB-IoT Connectivity: Expand beyond Wi-Fi to support low-power wide-area networking for campus-wide and municipal water distribution grids.
  • Automated Work-Order Dispatch: Connect AquaGuard's Priority Queue to facility management ticketing platforms (e.g., Jira Service Management or SAP PM) to automatically dispatch certified plumbers.
  • Predictive Valve Health Modeling: Analyze micro-fluctuations over months to detect deteriorating flush seals before leaks escalate.

AquaGuard turns water-flow data into actionable intelligence, helping make every drop count.

Built With

Share this project:

Updates