A real-time IoT-based water tank monitoring system that tracks water quality, temperature, level, and environmental conditions using multiple sensors and provides live visualization through a modern web dashboard.
- Live Monitoring: Real-time sensor data updates via WebSocket (Socket.IO)
- 5 Sensor Integration: Temperature, water level, turbidity, TDS, and environmental monitoring
- Smart Alerts: Automatic notifications when readings exceed safe thresholds
- Historical Data: Tracks and displays last 200 readings per sensor
- Modern UI: Beautiful, responsive dashboard with animated visualizations
- Tank Integrity Assessment: Compares internal and external temperatures
- Cloud-Based: Deployed on Render with HiveMQ Cloud MQTT broker
- Detailed Analytics: Individual sensor pages with technical information and trends
| Sensor | Parameter | Purpose |
|---|---|---|
| DS18B20 | Water Temperature | Monitor if water is too hot/cold for storage |
| HC-SR04 | Water Level | Track volume and prevent overflow/shortage |
| Turbidity Sensor | Water Clarity | Detect contamination and sediment |
| TDS Sensor | Water Purity | Measure dissolved solids for safety |
| DHT11 | Ambient Conditions | Monitor external temperature & humidity |
- NodeMCU ESP8266 β WiFi-enabled microcontroller
- Arduino UNO β Sensor data collection
- DS18B20 β Digital temperature sensor (1-Wire)
- HC-SR04 β Ultrasonic distance sensor
- Turbidity Sensor β Water clarity measurement
- TDS Sensor β Total dissolved solids meter
- DHT11 β Temperature & humidity sensor
- Backend: Node.js, Express.js
- Real-Time Communication: Socket.IO
- MQTT Broker: HiveMQ Cloud
- Frontend: Vanilla JavaScript, Chart.js
- Deployment: Render (Backend), HiveMQ Cloud (MQTT)
- Node.js 18+ installed
- Arduino IDE with ESP8266 board support
- HiveMQ Cloud account
- Git
git clone https://github.com/AdityaGupta0001/aquamonitor.git
cd aquamonitornpm installCreate a .env file in the root directory:
MQTT_HOST=your-hivemq-cluster.s1.eu.hivemq.cloud
MQTT_PORT=1883
MQTT_PROTOCOL=mqtt
MQTT_USERNAME=your-username
MQTT_PASSWORD=your-password
PORT=3000- Open
arduino/sensor_reader.inoin Arduino IDE - Update sensor pin configurations if needed
- Upload to Arduino UNO
-
Open
nodemcu/mqtt_bridge.inoin Arduino IDE -
Update WiFi credentials:
const char* ssid = "Your_WiFi_Name"; const char* password = "Your_WiFi_Password";
-
Update HiveMQ credentials:
const char* mqtt_server = "your-cluster.hivemq.cloud"; const char* mqtt_user = "your-username"; const char* mqtt_password = "your-password";
-
Upload to NodeMCU ESP8266
npm startVisit http://localhost:3000 to view the dashboard.
- Push code to GitHub
- Create a new Web Service on Render
- Connect your repository
- Add environment variables
- Deploy!
- Landing Page:
https://aquamonitor.onrender.com/ - Main Dashboard:
https://aquamonitor.onrender.com/dashboard - Individual Sensors:
/sensor/temperature,/sensor/distance,/sensor/turbidity,/sensor/tds,/sensor/environment
Adjust thresholds in server.js:
const config = {
tankTotalVolume: 1000, // Tank capacity in liters
distanceFull: 1, // Distance when tank is full (cm)
distanceEmpty: 100, // Distance when tank is empty (cm)
turbidityThreshold: 1000, // Max turbidity (NTU)
tdsMin: 50, // Min TDS (ppm)
tdsMax: 300, // Max TDS (ppm)
tempMin: 15, // Min water temp (Β°C)
tempMax: 30, // Max water temp (Β°C)
outsideTempMax: 45 // Max outside temp (Β°C)
};- Overview of all 5 sensors
- Real-time animated visualizations
- Status indicators for each parameter
- Alert notifications
Each sensor has a dedicated page with:
- Current readings with visual widgets
- Trend graphs (last 50 readings)
- Historical data table (last 200 readings)
- Technical specifications
- Working principles
- Pin connection diagrams
Automatic pop-up notifications when:
- Water level drops below 20%
- Temperature exceeds safe range
- Turbidity indicates contamination
- TDS levels are unsafe
- Tank integrity is compromised
- Verify WiFi credentials
- Check HiveMQ username/password
- Ensure port 1883 is accessible
- Check Serial Monitor for error codes
- Check Render logs for MQTT connection status
- Verify HiveMQ credentials in environment variables
- Test MQTT connection using HiveMQ Web Client
- Ensure NodeMCU is publishing to
sensor/datatopic
- Calibrate sensors individually
- Check wiring connections
- Verify Arduino serial output
- Adjust sensor-specific configurations
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Landing page |
/dashboard |
GET | Main dashboard |
/sensor/:type |
GET | Individual sensor page |
/api/latest |
GET | Latest sensor data (JSON) |
/health |
GET | Health check status |
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
Your Name
- GitHub: @AdityaGupta0001
- Project Link: https://github.com/AdityaGupta0001/AquaMonitor
- HiveMQ Cloud for free MQTT broker
- Render for hosting platform
- Chart.js for beautiful visualizations
- ESP8266 community for excellent documentation
Built with β€οΈ for smart water management