The IoT-Based Smart Water Quality Monitoring System measures and monitors water parameters including Turbidity, pH, TDS, NPK levels, Gas presence, and Temperature using Arduino and ESP32 modules. The data is sent to a cloud server and visualized on a web/mobile dashboard, enabling real-time water quality monitoring for farmers, environmental agencies, and industries.
Manual water testing is time-consuming, costly, and prone to errors. This project automates water quality monitoring by:
- Providing real-time data collection and analysis.
- Reducing manual intervention.
- Sending data to cloud for easy access and decision-making.
| Component | Technology Used |
|---|---|
| Microcontroller | Arduino Uno / ESP32 |
| Cloud Platform | Thingspeak / AWS IoT / Firebase |
| Sensors | Turbidity, pH, TDS, NPK, Gas (MQ-series), Temperature |
| Communication | Wi-Fi (ESP32) / Serial |
| Database | Cloud database (MySQL / Firebase Realtime DB) |
| Frontend Dashboard | Web / Mobile App |
| Language | C/C++ (Arduino IDE) |
| Component | Description |
|---|---|
| Arduino Uno / ESP32 | Main controller for data acquisition and transmission. |
| Turbidity Sensor | Measures water clarity (NTU). |
| pH Sensor | Measures acidity/alkalinity. |
| TDS Sensor | Detects total dissolved solids in ppm. |
| NPK Sensor | Measures nitrogen, phosphorus, potassium. |
| MQ Gas Sensor | Detects harmful gases or contamination. |
| Temperature Sensor | Reads water temperature. |
| LCD Display | Displays sensor readings locally. |
| Wi-Fi Module | Sends collected data to cloud. |
| Power Supply | 5V regulated power input. |
| Sensor | Arduino Pin | Description |
|---|---|---|
| Turbidity Sensor | A0 | Analog input for turbidity |
| pH Sensor | A1 | Analog input for pH |
| TDS Sensor | A2 | Analog input for TDS |
| NPK Sensor | A3 | Analog input for NPK |
| MQ Gas Sensor | A4 | Detects harmful gases |
| Temperature Sensor | D2 | Digital input |
| ESP32 / ESP8266 | TX/RX | Wi-Fi data transmission |
| LCD Display | D4βD7 | Display output |
| Power | 5V & GND | Common ground & power |
- Sensor Data Collection: Each sensor reads its parameter (pH, TDS, Turbidity, etc.).
- Data Processing: Arduino converts analog values to digital, applies calibration.
- Data Transmission: ESP32 uploads processed data to cloud via Wi-Fi.
- Cloud Storage: Data is stored for historical tracking and visualization.
- Dashboard Visualization: Displays live values, trends, and alerts.
[ Sensors ]
β
[ Arduino / ESP32 ]
β (Wi-Fi)
[ Cloud Database (AWS / Firebase / Thingspeak) ]
β
[ Web / Mobile Dashboard ]
| Timestamp | Turbidity (NTU) | pH | TDS (ppm) | N (mg/L) | P (mg/L) | K (mg/L) | Gas Level | Temp (Β°C) | Water Quality |
|---|---|---|---|---|---|---|---|---|---|
| 2025-10-25 10:30 | 2.5 | 6.8 | 320 | 12 | 5 | 18 | 50 | 28.5 | Good |
| 2025-10-25 10:45 | 6.9 | 7.2 | 420 | 15 | 8 | 22 | 65 | 29.1 | Moderate |
Start β Sensors Initialize β Measure Parameters β Send to Cloud β Display Dashboard
git clone https://github.com/<your-username>/iot-water-quality.git
cd iot-water-quality- Install required libraries:
WiFi.hHTTPClient.hLiquidCrystal.hOneWire.hDallasTemperature.hThingSpeak.h
Connect sensors as per circuit table and verify COM port.
const char* ssid = "YourWiFiName";
const char* password = "YourWiFiPassword";
const char* server = "https://your-cloud-endpoint/api/";- Select your board: Arduino Uno / ESP32
- Upload the
.inofile.
Check live readings via Serial Monitor.
- ThingSpeak: Create channel & API key, link ESP32 HTTP POST.
- AWS IoT Core: Create device & topic, upload certificates.
- Firebase: Connect via REST API, visualize in Flutter/web app.
| Parameter | Safe Range | Alert Condition |
|---|---|---|
| pH | 6.5 β 8.5 | <6 or >9 |
| TDS | 0 β 500 ppm | >500 |
| Turbidity | 0 β 5 NTU | >5 |
| NPK | Optimal nutrient range | Out of range |
| Gas | <100 ppm | >150 ppm |
Alerts can trigger buzzers or SMS/email notifications.
- Real-time readings
- Graphs for each sensor
- Water quality classification
- Historical reports
Iot Sensors
Application Working Dashboard

https://youtube.com/shorts/c4t2vuDY0r4?si=7bTsnMxe-LTXeFo6
- AI-based contamination detection
- Automated water treatment control (valves/pumps)
- Solar-powered IoT module
- Mobile app integration with Flutter
- Voice-based water quality alerts
| Name | Role | Description |
|---|---|---|
| S. Chandu | Lead Developer & IoT Engineer | Designed sensor circuit, coded Arduino + ESP32, integrated cloud APIs. |
This project is licensed under the MIT License β see LICENSE file for details.
If you have any questions or suggestions regarding the Coffee app, feel free to contact us at kingchandus143@gmail.com