Smart Water Quality Monitoring System with Automated Flow Control and SMS Alerting
Multi-Parameter Water Analysis with Arduino Mega, pH Sensor, TDS Sensor, Temperature Compensation,
Ultrasonic Level Monitoring, and GSM SMS Alerts
Category: Embedded Systems, Environmental Monitoring, Water Quality
Tools & Technologies: Arduino Mega, pH Sensor (Analog), GravityTDS Sensor, DS18B20 Temperature Sensor,
HC-SR04 Ultrasonic Sensor, SIM800L GSM Module, Relay Module (Water Pump), 20x4 I2C LCD, Buzzer, Arduino
IDE
Status: Completed
Introduction
This project implements a comprehensive water quality monitoring system with automated flow control
for residential and municipal water management. The system measures multiple water quality
parameters including pH level, Total Dissolved Solids (TDS) with temperature compensation, and water
level using an ultrasonic sensor. The pH values are classified as Acidic (<6.0), Neutral
(6.0–8.0), or Alkaline (>8.0), while TDS readings are categorized from ideal drinking water (0–50
ppm) through tap water to high TDS levels. An automated pump system manages water flow based on
level thresholds — activating when water is low (distance >12cm) and deactivating when full
(<6cm). The SIM800L GSM module sends SMS alerts on water state changes and periodic quality
reports every 20 minutes.
System Overview
Aim and Objectives
Aim:
Design and develop a multi-parameter water quality monitoring system with
automated pump control and GSM-based SMS alerting for water management.
Objectives:
- Measure water pH using an analog pH sensor with acidic/neutral/alkaline classification.
- Monitor Total Dissolved Solids (TDS) with DS18B20 temperature compensation for accurate
readings.
- Track water level in real-time using HC-SR04 ultrasonic distance sensor.
- Automate water pump control based on level thresholds with hysteresis logic.
- Send SMS alerts on water availability state changes with quality report via SIM800L GSM.
- Provide periodic water quality SMS reports every 20 minutes for ongoing monitoring.
- Display all parameters on 20x4 LCD with per-condition status messages.
Features & Deliverables
- pH Monitoring: Analog pH sensor with classification — Acidic (<6.0), Neutral
(6.0–8.0), Alkaline (>8.0).
- TDS Analysis: GravityTDS sensor with temperature-compensated readings
classified from ideal drinking to high TDS.
- Water Level Tracking: HC-SR04 ultrasonic sensor mapped to 0–14cm range for tank
level monitoring.
- Automated Pump Control: Relay-controlled pump with ON at low level (>12cm),
OFF at full (<6cm).
- SMS Alerts: State-change notifications with quality report and periodic
20-minute reports via GSM.
- Temperature Compensation: DS18B20 waterproof sensor provides TDS temperature
correction for accuracy.
- LCD Display: 20x4 LCD shows pH, TDS, temperature, water level, and pump status
in real-time.
- Buzzer Alarm: Audible alert when water is unavailable (tank empty).
Process / Methodology
Hardware Assembly
Components: Arduino Mega, pH Sensor, GravityTDS Sensor, DS18B20, HC-SR04, SIM800L GSM, Relay, Water
Pump, 20x4 LCD, Buzzer.
- Submerged pH and TDS sensors in water sample for continuous quality measurement.
- Mounted DS18B20 waterproof temperature probe in water for TDS compensation.
- Positioned HC-SR04 ultrasonic sensor above water tank for non-contact level measurement.
- Connected relay module to water pump for automated flow control.
Software Development
- Developed pH reading with analog calibration and three-state classification logic.
- Implemented GravityTDS library integration with DS18B20 temperature compensation.
- Programmed pump control with hysteresis thresholds to prevent rapid cycling.
- Created SMS alerting with per-condition send-once logic and periodic reporting timer.
Testing & Calibration
- Calibrated pH sensor using standard pH 4.0, 7.0, and 10.0 buffer solutions.
- Validated TDS readings against commercial TDS meter for accuracy verification.
- Tested pump control hysteresis under varying water level conditions.
Challenges & Solutions
- Challenge: pH sensor drift over time requiring periodic recalibration.
Solution: Implemented offset-based calibration that can be adjusted in firmware
without hardware changes.
- Challenge: TDS accuracy varying with water temperature.
Solution: Integrated DS18B20 temperature sensor for real-time TDS compensation
using GravityTDS library.
- Challenge: SMS module sending duplicate alerts on threshold boundary
oscillation.
Solution: Implemented per-condition send-once flags that reset only on state
change.
Results & Impact
- Water Quality Insight: Multi-parameter analysis provided comprehensive water
safety assessment.
- Automated Management: Pump control maintained consistent water levels without
manual intervention.
- Timely Notifications: SMS alerts enabled remote awareness of water quality and
availability changes.
- Periodic Reporting: 20-minute quality reports provided continuous monitoring
data for analysis.
Future Enhancements
- Add turbidity sensor for visual clarity measurement and contamination detection.
- Implement WiFi connectivity with cloud dashboard for historical trend analysis.
- Add dissolved oxygen sensor for comprehensive aquatic health monitoring.
- Develop mobile app for real-time water quality visualization and alert management.
Demonstration / Access
- GitHub Repository: Coming
soon
- Live Demonstration Video: Coming
soon