Why this matters:
Amphibian eggs and larvae are immobile, oxygen-hungry and temperature-sensitive. In shallow breeding ponds, small disturbances cascade fast: a warm night lowers dissolved oxygen (DO), a flashlight or lamp adds glare and surface heating and minor chemical pulses (runoff, sunscreen, fertilizers) disrupt gas exchange. These stresses combine (often after dark), when no one is watching.
Shallow ponds show strong day–night swings in dissolved oxygen, with the minimum typically just before sunrise measured surface values as low as ~12–25% saturation have been observed at dawn in natural systems. Periodic, grab-sample monitoring routinely misses these short overnight minima; only continuous, high-frequency sensing captures the diel pattern and transient drops that threaten eggs and larvae. (https://pmc.ncbi.nlm.nih.gov/articles/PMC5597838)
Typical monitoring fails at the exact moments that matter. Handheld probes and periodic surveys miss overnight DO minima and short spikes; commercial multiparameter loggers are costly and rarely deployed at scale; manual aeration risks over-mixing and thermal shock if triggered blindly. The result is preventable cohort loss: eggs suffocate in warm, still layers; larvae endure cold-shock during abrupt mixing; human disturbance goes unflagged.
What’s needed is continuous, local intelligence that can sense stratification and risk proxies (ΔT, dT/dt, lux, acoustic ripples, TDS changes), understand context (night vs glare, natural ripple vs pump self-noise) and then act gently (only when safe). That is the gap UBi-Guardian targets: 24/7 edge-AI stewardship for fragile waters, focused on early warning, minimal intervention and transparent logging suitable for science and conservation.
What sets UBi-Guardian apart:
UBi-Guardian is an explainable, low-cost edge-AI steward that runs entirely on-device (ESP32-S3), turning noisy pond signals into safe, auditable actions with zero cloud dependency. Unlike handheld probes, periodic loggers or cloud-first IoT nodes, it fuses a Composite Gate, on-device TinyML classification and hard duty caps to deliver timely help while preventing over-mixing and keeping decisions transparent.
Every action is gated, explainable and safe. A strict Composite Gate decides if mixing is allowed:
`(%DO band = low) ∧ (night) ∧ (ML ≠ pump-self) ∧ (no glare) ∧ (no overheating)`
- Duty caps: ≤30 min/hr and ≤3 h/night to avoid over-mixing.
- Burst efficacy check: compares pre/post ΔT and DO-proxy; flags “efficacy: fail” if no improvement.
- On-device TinyML: disambiguates calm vs disturbance vs flashlight-night vs pump-self.
- Transparent by design: dashboard shows gate state, duty counter, and alerts; Discord delivers real-time cards; no cloud dependency.
A night-in-the-pond scenario:
- 22:07 — A flashlight sweeps the surface:
lux spikes, micRMS jumps, TinyML --> “flashlight-night”.
The Composite Gate blocks mixing to prevent thermal shock.
- 03:18— Air cools; %DO band = low; glare absent; ML ≠ pump-self --> gate opens. A gentle 5 s burst runs.
- 03:19— Dashboard logs pre/post ΔT and DO-proxy; duty counter updates; a Discord card notifies the caretaker. No over-mixing, no hidden side effects (just enough help and exactly when safe).
Deployment & operations: A caretaker zip-ties the tri-depth probes to a slim rod, lowers them near the breeding zone and clips the pump line to a small airstone. On first power-up, the captive portal “UBiGuardian-Setup” joins Wi-Fi. The FastAPI dashboard comes online at the Raspberry Pi address. From then on, the caretaker mostly watches the duty counter, Composite-Gate state and Discord cards. Maintenance is simple: a weekly visual check, a quick rinse of the airstone and an occasional SD/export of CSV/NDJSON logs for archiving.
Network vignette: Imagine three UBi-Guardian units around a shallow pond near the inlet, mid-shore and a quiet nursery cove. Each runs the same on-device policy and TinyML. If the inlet unit reports repeated low-DO bursts while the cove stays stable, the caretaker adjusts only the inlet habitat (debris removal, shaded cover) instead of disturbing the whole pond. With LoRaWAN planned, the same pattern scales to a cluster of ponds with consistent alerts and comparable, transparent logs.
Broader outcomes & social benefits
Quantified impact targets: With 10 UBi-Guardian units, a small pond complex of ~4–8 hectares can be watched continuously, producing >2, 000 hours of labeled telemetry per month (on-device classifications + composite-gate states) without cloud dependence. Typical alert latency on local Wi-Fi is <10 s from event to Discord card and burst duty remains bounded by design to ≤30 min/hr and ≤3 h/night per unit, ensuring “help without over-mixing.”
Continuous, on-device monitoring catches early signs of hypoxia, stratification collapse and human intrusion that periodic surveys miss. This enables:
- Faster conservation response: alerts during overnight risk windows when cohorts are most vulnerable.
- Protection of endangered species: reduced disturbance around breeding sites; evidence for habitat management.
- Actionable science data: transparent logs (CSV/NDJSON) usable in studies and policy briefs.
- Community engagement: low-cost units that local groups can deploy and interpret (citizen science).
- Scalable coverage: many small guardians > one expensive station; real-time signals without cloud dependence.
What UBi-Guardian does
- Monitors tri-depth temperature, air T/RH, barometric pressure (BMP180), light (VEML7700), IR heat (MLX90614), underwater sound (INMP441) and TDS.
- Understands ripples with a TinyML classifier (calm, disturbance, human-tap, pump-self, flashlight-night, etc.).
- Acts with short oxygenation bursts through a micro-pump, with strict duty caps to avoid over-mixing. Tracks burst efficacy (pre/post ΔT & DO-proxy change).
- Logs and visualizes everything on a FastAPI dashboard and sends alerts to Discord in clean, readable cards. Charts support a median-filtered view for noise-robust trends.
How UBi-Guardian Works:
1. Sensing
- Tri-depth DS18B20 probes (top/mid/bottom).
- Air T/RH (DHT20), barometric pressure (BMP180).
- Lux (VEML7700), IR object/ambient (MLX90614).
- Acoustic ripples (INMP441).
- TDS probe (CQRobot).
2. Policy Engine (ESP32-S3)
- Rules detect stratification, inversion, hypoxia proxy, glare, ripple, cold-shock, TDS spike, baro drop, heater/lamp hazard.
- Built-in duty caps: ≤30 min/hr, ≤3 h/night.
- Safe defaults: mixing never used for overheating.
- Composite Gate = (%DO low) ∧ (night) ∧ (ML≠pump-self) ∧ (no glare) ∧ (no overheating). Bursts run only if this gate passes.
- Burst Efficacy Check — compares ΔT/DO-proxy before vs after bursts; flags “efficacy: fail” if no measurable improvement.
3. TinyML Classifier
- Inputs: micRMS, lux, ΔT, dT/dt, DO proxy, TDS delta.
- Classes: calm, disturbance, human-tap, flashlight-night, pump-self, etc.
- Used to gate ripple detection to make less false alarms.
4. Actions
- Gentle air pump burst via relay.
- Alerts raised (Dashboard and discord) if risks exceed thresholds.
5. Collector & Dashboard (Raspberry Pi / FastAPI)
- Logs telemetry to CSV + NDJSON.
- Serves live smart dashboard with:
- DO proxy graph.
- Ripple RMS chart.
- Lux + TDS timelines.
- Snapshot of tri-temperature, pressure, pump state, ML state.
- Forwards alerts to Discord for remote monitoring.
- UI adds: %DO band badges, Composite-Gate state, last-hour duty counter and efficacy ok/fail indicator.
- Charts: range presets (15m/1h/6h/24h/7d/30d/all) + Median toggle.
Risk Scenarios Covered:
- Hypoxia proxy (warm water, low DO).
- Thermal stratification collapse.
- Uniform overheat.
- Baro drop with low DO.
- Glare / lamp hazard.
- Night flashlight intrusion.
- Human tap / disturbance.
- TDS spike.
- Cold-shock.
- Sensor fault.
- Composite-gated burst prevention (blocks unsafe mixing under glare/overheat/pump-self).
System Snapshot:
Wiring Diagram:
Dashboard Preview:
- Red ALERT card if risks active (5s flash).
- Green when safe.
- Charts: DO proxy, micRMS, Lux, TDS.
- Snapshot panel: tTop, tMid, tBot, ΔT, pump, ML state.
- Median-filtered toggle for all time-series charts.
Results:
- Successfully detected oxygen risk proxies.
- Pump controlled within safe duty cycle.
- TinyML distinguished between calm, tap, disturbance and flashlight.
- End-to-end telemetry from sensors.
- Pump control based on both rules and ML.
- Real-time alerting to Discord.
- Composite gate prevented unsafe bursts (e.g., glare/overheat/pump-self).
- Median-filtered charts improved trend readability without masking anomalies.
Current limitations and how we address them:
- Underwater/off-grid communication: Live alerts depend on local Wi-Fi. Plan: LoRaWAN/Sub-GHz uplink for asynchronous alerts and basic telemetry in the field.
- Power budget for 24/7 duty: Bench setup is mains-powered. Plan: deep-sleep scheduling and a small solar-buoy pack sized to the measured duty (<30 min/hr, ≤3 h/night).
- DO-proxy validity: We infer %DO bands from temperature/pressure; no direct DO yet. Plan: add a galvanic/optical DO probe to calibrate and validate the proxy bands.
- Field robustness: Current build uses breadboard wiring. Plan: custom PCB and strain-relieved probe/pump connectors to withstand outdoor handling.
- False positives / coverage: TinyML classes are limited (calm, tap, disturbance, flashlight-night, pump-self). Plan: expand training set and classes (rain, predator splash, long disturbance) and keep the Composite Gate conservative.
- Multi-node coordination: Present story is single-node with manual interpretation across sites. Plan: Node A↔Node B coordination and simple cross-node rules (e.g., suppress bursts if upstream node is already mixing).
- Sensor fouling and drift: Probes can biofoul over weeks. Plan: add maintenance cadence (weekly rinse) and simple drift checks via median-filtered baselines and redundant probes on critical channels.
Next Steps:
- LoRaWAN / Sub-GHz uplink — for off-grid ponds, send alerts and telemetry without Wi-Fi.
- Direct DO probe — add galvanic/optical dissolved oxygen sensor to validate the proxy method.
- Redundant sensing — second pump relay + duplicate probe for fault tolerance.
- PCB — replace breadboard with custom PCB for field robustness.
- Low-power optimization — deep sleep cycles + duty scheduling for solar-powered deployment.
- Multi-node coordination — Node A (pond edge) ↔ Node B (uplink) for distributed response.
- Extended ML models — include multi-class event recognition (rain, predator splash, long disturbance).
Build it yourself:
Firmware (ESP32-S3): Libraries: OneWire, DallasTemperature, Adafruit_AHTX0, Adafruit_BMP085 (works with BMP180), Adafruit_VEML7700, Adafruit_MLX90614, WiFi, WebServer, Preferences, ESPmDNS, HTTPClient, driver/i2s, TFLite Micro.
Model: convert your.tflite into a C header (or use the provided one: https://github.com/Maitham16/UBi_Guardian )
Flash the provided sketch. First boot exposes a captive portal “UBiGuardian-Setup” to join Wi-Fi.
Collector + Dashboard (Raspberry Pi / Linux):
python3 -m venv .venv && source .venv/bin/activate
pip install fastapi uvicorn requests pandas numpy
# put main.py in this folder (your version with Discord + dashboard)
uvicorn main:app --host 0.0.0.0 --port 5001Run ingest: curl "http://ubiguard.local/collector?host=(raspberrypi_ip)&port=5001&path=/ingest" # UBi_Guardian
You now have:
http://<raspberrypi_ip>:5001/dashboard # Monitoring Dashboard
POST http://<server>:5001/ingest # device posts telemetry here
GET /health, /latest, /export.csv, /events.csv
POST /alert/test (sends a demo alert to Discord)
POST /alert/webhook (persist a new webhook if no env var is set)
You can learn more about how to build and run it on our Github repository:
https://github.com/Maitham16/UBi_Guardian
Edge-AI for Earth Guardians:
UBi-Guardian embodies the contest vision by using low-power, explainable AI deployed at the edge, guarding fragile waters in real time without cloud dependence. By coupling a transparent Composite Gate with TinyML on ESP32-S3 and strict duty caps, it delivers timely, gentle intervention and auditable science-grade logs--scalable from a single pond to networks of sites.
THANK YOU!
PoseiDNN Team










Comments