AquaPulse
Smart water management for multi-home buildings. Every home's water metered, billed fairly and watched for leaks, from ESP32 sensors to a web app and an Android app.
The problem, and what AquaPulse does
In many apartment buildings, water is shared and nobody really knows who used what. The tank overflows or runs dry, a leaking pipe can run all night, and the water bill is split by guesswork. AquaPulse turns a normal building into a smart-water building.
Owners
See every home's water use, bill residents fairly from real readings, turn water on or off remotely, watch water quality and get alerts.
Residents
See their own usage and bill, pay online, turn their own water on or off and check that their water is safe.
Devices
An ESP32 node in each home measures flow, pH and temperature and drives a motorised valve. A tank node runs the pump. Without hardware, a digital twin of 10 homes and a tank does the same.
What it can do
Live monitoring
Every home reports its water flow, pH and temperature over encrypted MQTT, and the dashboards update live over a WebSocket. Litres come from the meter's running total, so a lost message never loses water: with 10% of messages dropped in a test, daily totals stayed within 0.5%.
Remote valve control
Residents can turn their own water off and on, and owners can control and lock any home's valve with a written reason. A command only counts as done when the device itself confirms it.
Tank and pump automation
The tank node runs the pump by itself: on when the tank falls to 25%, off at 95% (the owner can change both), and always off at 98%. It never runs the pump dry, and it keeps doing this when the server is down.
Water quality
pH and temperature for every home, with a plain Safe, Check or Unsafe label and live charts. If the water stays outside the safe range for several readings, the resident and the owner get an alert.
Slab billing and payments
The owner sets the prices: litre slabs, extra charges and taxes, in 11 currencies. Monthly bills are made from the real meter readings, as PDFs, and stay fair when people move in or out mid-month. Residents pay by cash, bank transfer or card through Stripe (test mode only).
AI leak detection and forecasts
Every reading is checked for slow leaks and burst pipes, and the owner can let AquaPulse close the valve on its own. It also gives a 7-day water forecast with a month-end bill estimate, and flags unusual days, each with a reason in plain words. On a labelled test set of simulated data, it found all 62 planted leaks and bursts with no false alarms (evaluation).
Alerts
Nine rules watch the building: unsafe pH, hot or freezing water, a device offline, the tank low or overflowing, the pump running dry, high daily use, a failed valve command and a stuck sensor. Alerts arrive in the apps and by email, with optional push notifications through Firebase. A System Admin sees the health of every service.
Light and dark, phone to desktop
The web app installs on a phone like an app, works from 360 px phones to big screens in light and dark mode, and is checked with an automatic accessibility test on every screen.
The hardware
ESP32 firmware for a home node (flow meter, pH, temperature, motorised valve) and a tank node (level sensor, sump switch, pump relay). Both run in the free Wokwi simulator, and the same contract is followed by the digital twin, so a simulated home can be swapped for a real board.
How it fits together
- ESP32 nodesor the digital twin
- MosquittoMQTT over TLS, a password per device
- Ingestorchecks every message
- TimescaleDBreadings, bills, audit log
- FastAPIAPI and live WebSocket, behind Caddy (HTTPS)
- Web app and Android appReact PWA and Flutter
Beside them, a worker makes the bills, runs the alert rules and the AI, and sends email and push. Valve and pump commands go back from the API through the broker to the device. Everything starts with one Docker Compose command.
Security and quality
- 868backend tests, 95.4% line coverage
- 100%branch coverage of the billing engine
- 132firmware checks, plus web, app and simulator tests
- 75 + 30functional and non-functional requirements in an IEEE-style SRS
Built in
- Two-factor login, Argon2id passwords and rotating tokens that end the session if one is reused
- A hash-chained, tamper-evident audit log
- MQTT over TLS only, with a password and its own topics for every device
- A STRIDE threat model and an OWASP ASVS checklist
Checked on every change
CI runs the whole stack, the tests, an accessibility check on every screen and a backup-and-restore check. The test report says plainly what is measured and what is not yet.
Tech stack
- Hardware
- Backend
- Apps
- AI
- Payments
- Testing
My role
I designed and built the whole system, from the software requirements specification to the hardware, backend, web app, Android app, AI and security. Version 1.0.0 was released on 31 October 2026 under the MIT licence.
Background: where this started
AquaPulse grew from my 2023 BS final-year project at BUITEMS, Quetta, "Smart Eco Utilization for Smart Edifice" (the thesis report is titled "IoT based Pure Aqua Utilization in Smart Edifice"). A team of three, supervised by Dr. Raja Asif Wagan, built tank level sensing and automatic pump control with an Arduino, a Bluetooth link and an Android app. AquaPulse keeps the good idea, the self-running tank, and rebuilds everything around it for whole buildings: Wi-Fi and encrypted MQTT instead of Bluetooth, many homes and roles, real billing, security and tests.