This project implements a Smart Water Quality Monitoring System using IoT and Machine Learning to provide real-time insights into water quality. It addresses the key challenges of traditional water monitoring systemsβnamely their expense, time consumption, and lack of automationβby integrating low-cost sensors, microcontrollers, and data analytics tools.
The system measures multiple parameters such as pH, turbidity, temperature, TDS, COβ, conductivity, and humidity using dedicated sensors. It then processes and transmits the data to the cloud via wireless modules. The processed data is analyzed using trained ML models to classify the water as potable or impure, with actionable insights provided for remediation.
- pH Sensor: Measures water acidity/alkalinity (Range: 0β14; Normal: 6β8.5)
- TDS Sensor: Detects total dissolved solids (higher TDS = less pure water)
- Turbidity Sensor: Measures water cloudiness (indicator of suspended particles)
- Temperature Sensor (DS18B20): Measures water temperature (Range: -55Β°C to +125Β°C)
- Conductivity Sensor: Measures water's electrical conductivity to assess ion levels
- Humidity Sensor: Monitors environmental moisture around the system
- COβ Sensor: Monitors the carbon dioxide concentration in the water environment
- ESP32 or Arduino
- Reads sensor data
- Processes readings
- Transmits data using built-in WiFi or Bluetooth
- Wireless Module: Transmits data to a cloud server or central database
- Displays real-time sensor readings
- Centralized data storage and visualization
- Tools: Apache Hadoop, Apache Spark
Water-Quality-Monitoring-using-IoT/
βββ assets/
β βββ system_architecture.png
β
βββ data/
β βββ water_quality_dataset.csv
β
βββ models/
β βββ trained_model.pkl
β
βββ src/
β βββ sensor_readings.ino
β βββ model_deployment.py
β βββ lcd_display.ino
β
βββ analysis/
β βββ eda_and_training.ipynb
β
βββ pattern/
β βββ pattern.ino
β βββ name.ino
β
βββ README.md
βββ requirements.txt
git clone https://github.com/yashdew03/Water-Quality-Monitoring-using-Iot.git
cd Water-Quality-Monitoring-using-Iot
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
- Trained using real-time and historical water quality datasets
- Algorithms Used:
Decision Trees
Random Forest
Support Vector Machines (SVM)
- Classifies water as potable or impure
- Provides suggestions to improve water quality
- Identifies potential use cases for impure water
- Sensor Initialization β Setup and calibration of sensors
- Data Acquisition β Real-time data captured from water
- Data Transmission β Wireless data upload to cloud
- Data Storage β Centralized logging in database
- Model Deployment β Predict water quality using trained ML models
- Alerts & Suggestions β Provide alerts and improvement strategies
- Visualization β Real-time display on LCD and dashboard
Real-time values and classification result are displayed on a 16Γ2 LCD display and wirelessly sent to the cloud. A machine learning model classifies the water and suggests purification methods or usage recommendations.
- Python (
Pandas
,NumPy
,scikit-learn
) - R
- MATLAB
These tools are used for:
- Visualization
- Exploratory Data Analysis (EDA)
- Model training and evaluation
pH Sensor
Turbidity Sensor
TDS Sensor
DS18B20 Temperature Sensor
ESP32
/Arduino
COβ Sensor
Conductivity Sensor
Humidity Sensor
16x2 LCD Display
OLED Display
WiFi module
(if using Arduino)
- Arduino IDE / ESP32 SDK
- Python 3.x
- Jupyter Notebook / Google Colab
- ML libraries (scikit-learn, matplotlib, seaborn)
- Apache Hadoop or Spark (optional for big data)
- Add GPS module for location-specific data
- Integration with mobile apps for notifications
- Automatic chemical dosing system based on feedback
- Enhanced anomaly detection using deep learning models
Contributions are welcome! Please open an issue or submit a PR for enhancements or fixes. Feel free to check the issues page (if you have one) or open a new issue to discuss changes. Pull requests are also appreciated.
This project is licensed under the MIT License.
- Built by Yash Dewangan
- Github: YashDewangan
- Email: yashdew06@gmail.com
- Linkedin: YashDewangan
Enjoy using the Water Quality Monitoring using Iot in any type of Water! π