Back to Truptimayee's profile
9views

AquaNex

EcoEstate AI turns passive campus buildings into self-protecting smart estates—using a ₹2,600 local-first edge network and real-time Machine Learning to predict

Truptimayee Parida
  • Video of it working
  • Problem, approach and result explained
  • Public source code
  • Answered the full brief· 13 of 13
  • Expert reviewed· 6 reviews
AquaNex

—

97.9

—

<1 sec.

—

<3 mos

Walkthrough

Overview

The problem

Indian engineering colleges, residential universities, and multi-block institutional campuses still manage their core utilities reactively—meaning maintenance teams only step in after an overflow, a motor burnout, or an electricity bill shock has already happened. Across a typical campus in Odisha during monsoon weeks or peak semester hours, four silent failures happen every day: 1-Underground water sumps overflow or burn out dry-running extraction pumps because staff rely on manual visual checks instead of real-time level tracking. 2-Rooftop solar microgrids quietly lose 25–30% generation from dust soiling or loose junction boxes while heavy pumps run during peak ₹8.00/kWh grid tariff slabs. 3-Campus waste bins overflow in hostel and canteen zones hours before housekeeping rounds. 4-Basement and academic parking bays bottleneck at peak lecture hours because drivers have zero bay-level guidance. We set out to build EcoEstate AI—a closed-loop Cyber-Physical SCADA and Predictive Decision-Support System that turns passive campus infrastructure into an intelligent, self-protecting network. Rather than building another static chart viewer, our goal was to unify live edge sensors, predictive Machine Learning, automated physical actuators (pumps, buzzers, and servo gates), and role-based governance for Deans, Maintenance Teams, and Green Campus ESG Cells inside one local-first platform

The approach

Hardware & Edge Architecture:We built a hierarchical two-tier edge network so sensors remain modular across distant campus blocks:Master Gateway (ESP32-WROOM-32): Reads underground sump depth via an ultrasonic sensor (HC-SR04), monitors rooftop solar voltage/current/wattage via an INA219 I2C power sensor, tracks 4 parking bays using FC-51 infrared sensors with Red/Green guidance LEDs, and drives an SG90 servo boom barrier, a 30A substation pump relay, and an alarm buzzer. Zone Sub-Node (Arduino Nano): Mounted at the smart waste bin on 5V logic to measure fill height, operate a touchless auto-opening lid servo (which locks shut above 95% fill to prevent spills), and stream bin telemetry over I2C (0x08) to the ESP32.Backend, ML & SCADA Stack:FastAPI (Port 8000) & SQLite (WAL Mode): The ESP32 posts 1-second JSON telemetry to FastAPI and receives bidirectional actuator commands (such as remote buzzer mute or relay overrides) in the same HTTP response cycle. Dual Scikit-Learn Models: A Random Forest Regressor engineers real-time water rise rate ($\frac{d(\text{Sump})}{dt}$) to forecast sump overflow ahead of time against an 80% threshold, while an unsupervised Isolation Forest detects multi-sensor equipment anomalies like sudden daytime solar drops. Streamlit Frontend (Port 8501): Delivers four live operational views—Real-Time SCADA & Live ML Telemetry, 2.5D Geospatial Campus Twin, What-If Scenario Sandbox, and ESG Governance & AI Copilot—tailored across three institutional user tiers. The One Tricky Part:Running 1-second continuous hardware writes from the ESP32 while Streamlit simultaneously queried live charts initially caused SQLite file-lock contention—and on the hardware side, sharing an I2C bus between a 5V Arduino Nano and a 3.3V ESP32 risked voltage mismatch. We solved both cleanly by enabling SQLite Write-Ahead Logging (PRAGMA journal_mode=WAL) for lock-free concurrent reads/writes, and disabling the Nano's internal 5V I2C pull-ups in firmware so the bus stays safely clamped to 3.3V.What We Left Out on Purpose:Cloud Vendor Lock-In & Monthly Fees: We intentionally avoided paid cloud IoT platforms (like Blynk or AWS IoT) and bound FastAPI/Streamlit to 0.0.0.0 on a local network so an estate office PC can run the entire campus with sub-15ms latency and zero internet dependency. Hardcoded "Demo Fake" Switches: We removed artificial override buttons from our firmware so all stress tests happen either physically on the sensors or through FastAPI's live /docs ingestion endpoint.

The result

We deployed and stress-tested the complete physical prototype end-to-end across hydraulic, solar, waste, and parking scenarios: Hydraulic Surge & Fail-Safe Response: During live surge testing (visible on our Substation Sump Dynamics & Predictive Trajectory chart, where sump depth spiked from 0.0% baseline to 100% past the 80% overflow limit), the ESP32 triggered the substation extraction relay and alarm buzzer immediately in its local non-blocking loop, while the dashboard's Silence / Ack control muted the physical buzzer over Wi-Fi within 1 second. Predictive Forecasting Accuracy: Measured on our 1-second SQLite telemetry ledger merged with baseline campus profiles, our Random Forest sump forecaster achieved $R^2 = 0.979$ with a Mean Absolute Error (MAE) of 0.89% (predicting a 19.9% steady-state trajectory in nominal conditions). Smart Parking & Solar Fault Detection: Covering the solar panel dropped live generation toward 0.00 W and triggered immediate anomaly flagging, while placing vehicles in the parking bays flipped physical bay LEDs from Green to Red and automatically swung the servo boom gate down to 0° (LOCKED) at full capacity. Campus Baseline vs. EcoEstate AI Impact: Against a manual campus baseline (periodic guard rounds and unscheduled motor runs at ₹8.00/kWh), a complete ESP32 + Nano edge node costs under ₹2,600 per academic block—recovering its hardware cost in under 3 months by shifting heavy pump loads into peak 11:00 AM–3:00 PM solar windows and preventing motor dry-run burnouts.

Reflection

What we would do differently:Dedicated 5V Power Regulation & Custom PCB: On our breadboard prototype, powering the SG90 servo motors, ultrasonic sensors, and ESP32 Wi-Fi radio from a shared VIN rail caused voltage dips and brownout resets under peak current spikes. If we built this again from scratch, we would design a custom PCB with an onboard LM2596 5V buck regulator and isolated ground planes for high-current actuators (relays and servos) versus 3.3V microcontroller logic.Long-Range Industrial Bus Between Zones: Using I2C (0x08) between our Arduino Nano waste sub-node and ESP32 master gateway works reliably on a tabletop prototype, but real campus buildings sit 50 to 100 meters apart. For a campus-wide rollout, we would replace inter-building I2C links with Sub-GHz LoRa or RS-485 Modbus.Onboard Resistive Load for Solar Testing: During indoor bench testing, our INA219 solar sensor initially read bus voltage with 0.00 W because an open-circuit panel carries zero current. Integrating a switched battery-charging or resistive load circuit from day one would have made indoor wattage calibration immediate.What is unfinished or known broken:2 Active IR Bays on a 4-Bay Controller: Our ESP32 firmware and Streamlit dashboard support all 4 parking bays (Bay B-1 through B-4) with 8 Red/Green LEDs, but only 2 bays currently have physical FC-51 IR sensors wired on the model while Bays 3 and 4 are tied to steady 3.3V baseline states. Wiring the remaining 2 IR sensors and adding RFID/ANPR vehicle identification is still pending.Standalone Battery Operation Under Peak Load: Running the entire dual-microcontroller and dual-servo setup purely on a small portable battery without an external 5V buck stage risks Wi-Fi dropouts when both servos actuate together, so the demo currently requires a regulated 5V USB power source.Live Campus Smart-Meter & Weather API Feeds: Our energy disaggregation engine and ₹8.00/kWh tariff-spike estimator currently scale live INA219 solar readings against simulated building load profiles rather than pulling directly from a 3-phase CT-clamp campus main meter or live solar irradiance forecast API.What we learned:Hardware-Level Safety Must Live on the Edge: Cloud or dashboard logic is too slow and fragile for physical fail-safes. Pre-loading Active-LOW relay pins HIGH before pinMode() to stop boot-time pump chatter, disabling internal 5V I2C pull-ups on the Arduino Nano to protect 3.3V ESP32 GPIOs, and keeping local control loops non-blocking taught us how real industrial SCADA systems stay safe even when Wi-Fi drops.Database Concurrency at 1 Hz Telemetry: Streaming 1-second hardware packets into SQLite while Streamlit queried live charts initially caused file-lock errors—teaching us how enabling SQLite Write-Ahead Logging (WAL mode) eliminates read/write contention cleanly.Auditability Builds Trust in Applied AI: Removing fake demo override buttons and instead exposing a live FastAPI /docs endpoint alongside one-click CSV dataset exports and live Scikit-Learn accuracy metrics ($R^2$ and MAE) made our predictive models genuinely verifiable in front of evaluators.

Submitted to Sustainable Facility & Estate Intelligence

Your idea in one line

Our idea is an IoT and Machine Learning decision platform for Indian campuses that predicts flash floods and solar power losses, automatically activating backup-powered drainage and safety alarms before damage occurs.

What will be working by the finale?

1. End-to-End Edge-to-Cloud Closed Loop: Working ESP32 hardware edge node streaming real-time sensor telemetry over Wi-Fi via FastAPI into SQLite. 2. Predictive AI & Anomaly Engines: Scikit-learn Random Forest model generating 1-hour advance stormwater flood predictions, and Isolation Forest detecting rooftop solar dust/shading losses (>35% drop). 3. Automated Edge Safety Interlocks: Instant actuation of 12V battery-backed drainage pump relay, physical multi-pattern buzzer, and status LEDs when flood thresholds are breached. 4. Role-Based SCADA Web Dashboard: Responsive Streamlit UI featuring Executive, Maintenance (with manual actuator overrides), and Green Campus ESG views, complete with interactive "What-If" monsoon scenario sliders.

Tech stack and hardware you plan to use

1-Software & Backend: Python 3.11, FastAPI (REST API), Uvicorn, SQLite3, Pandas, NumPy. 2-Machine Learning: Scikit-learn (RandomForestRegressor, IsolationForest), Joblib. 3-Frontend / SCADA: Streamlit, Plotly Graph Objects, HTML5 Audio (Sirens), Streamlit-Autorefresh. 4-Edge Microcontroller & Firmware: ESP32-WROOM-32 (C++/Arduino framework), FreeRTOS/HTTPClient. 5-Sensors & Peripherals: HC-SR04 Ultrasonic Sensor, INA219 I2C Current/Voltage Sensor, FC-51 IR Obstacle Sensor, SSD1306 0.96" OLED Display. 6-Power & Actuation Hardware: 5V Single-Channel Relay Module, 3-6V Submersible DC Water Pump, 12V Lithium Battery Pack, LM2596 Buck Converter, 5V Mini Solar PV Panel, Active Buzzer, Traffic Light LEDs.

What have you built or tested so far?

1-Built and validated the complete software stack: FastAPI ingestion server, SQLite database, and Streamlit SCADA dashboard with interactive role-based views. 2-Trained and serialized both ML models (Random Forest sump forecaster and Isolation Forest PV soiling detector). 3-Tested the ESP32 Wi-Fi firmware pipeline: verified successful HTTP POST JSON telemetry transmission (HTTP 200 OK) directly into the database. 4-Assembled the benchtop hardware diorama: wired ultrasonic, IR, solar, OLED, buzzer, and relay circuits with isolated 12V battery backup power.

Pitch deck (PDF)
Pitch deck (PDF)PDF
What's working now?

What is working:End-to-End 1 Hz SCADA & SQLite WAL Pipeline: Our ESP32 Master Gateway streams live telemetry every second to FastAPI (Port 8000) and SQLite (WAL mode) with zero database locks, updating the Streamlit dashboard (Port 8501) in real time.Sump Flood Fail-Safe & Bidirectional Control: Crossing the 80–85% sump threshold automatically energizes the Active-LOW pump relay and Active-HIGH alarm buzzer locally, while clicking Silence / Ack on the dashboard mutes the physical buzzer over Wi-Fi within 1 second.Arduino Nano Smart Dustbin (I2C 0x08): Ultrasonic fill measurement, touchless servo lid actuation (with auto-lock above 95% fill), and live bin percentage syncing to the webpage work end-to-end.4-Bay Parking Guidance & Servo Gate: Physical Red/Green bay LEDs and the SG90 boom barrier automatically close and lock (0°) when parking hits capacity.Live ML Forecasting & On-Site Retraining: Our Random Forest sump forecaster ($R^2 = 0.979$, MAE $= 0.89\%$), Isolation Forest anomaly detector, one-click model retraining, and CSV/ESG PDF audit exports are fully operational.What is partly working:4-Bay IR Sensor Coverage: All 4 bays have working Red/Green LEDs and live dashboard tiles, though only 2 bays have physical FC-51 IR sensors mounted on the prototype while Bays 3 and 4 are tied to steady 3.3V baseline states.Solar Wattage & Portable Power: The INA219 sensor measures solar voltage and wattage accurately under a resistive load on regulated 5V USB power, whereas running both servos and Wi-Fi together on a small standalone battery causes voltage dips.Campus Load Disaggregation: Solar generation is measured live from hardware, while building HVAC/pump load curves are modeled against a ₹8.00/kWh campus tariff baseline.What we did not get to:Custom PCB & Dedicated Buck Regulator: Adding an onboard LM2596 5V power stage to isolate servo current spikes from the 3.3V ESP32 logic for untethered battery operation.Long-Range Inter-Building Communication: Replacing the tab

Deck or report (PDF)
Deck or report (PDF)PDF
A photo or screenshot
A photo or screenshot: AquaNex

AI tools used

GeminiClaudeGitHub Copilot

for better guidance

Links & files

Artifacts

2

Gallery

5