IoT drinking water quality monitor (pH, TDS, turbidity)
Many homes and hostels drink from borewells, tankers and RO plants without knowing the water quality. A monitor for pH, dissolved solids, cloudiness and temperature, checked against the BIS drinking water limits, gives a quick warning.
- Parts
- ₹4,450
- Build
- 12 weeks
- Board
- ESP32
- Objectives
- 6
Block diagram
- pH probeMeasures acidity
- TDS probeMeasures dissolved solids
- Turbidity sensorMeasures cloudiness
- Temperature probeCompensates the readings
- ESP32Checks against BIS limits
- OLED displayShows a safe or unsafe verdict
- Cloud dashboardStores readings, plots trends and sends alerts+
- Data loggerStores timestamped readings for analysis+
Objectives
- To measure pH, TDS, turbidity and temperature of a water sample.
- To calibrate pH with two buffers and TDS against a known salt solution.
- To compare each value with IS 10500 limits and give a verdict.
- To test ten water sources and compare with a lab or handheld meter.
- To publish readings over MQTT and show them on a live dashboard with threshold alerts.
- To log timestamped data and analyse it to support the conclusions with evidence.
Parts and specifications
- ESP32 DevKit V1Dual-core 240 MHz, 520 KB SRAM, Wi-Fi + Bluetooth, 3.3 V logic, 12-bit ADC (use ADC1 pins when Wi-Fi is on)₹450Buy
- pH sensor kit (analog)pH 0 to 14, ±0.1 at 25 °C, about 59 mV per pH unit at the probe, calibrate with pH 4 and 7 buffers₹1,500Buy
- DS18B20 waterproof probe−55 to 125 °C, ±0.5 °C from −10 to 85 °C, 9 to 12-bit, 1-Wire with 4.7 kΩ pull-up, 750 ms at 12-bit₹120Buy
- pH 4 and 7 buffer powder sachets₹150
- Sample cups and holder₹150
- 5 V USB adapter₹150
- DS3231 RTC moduleTemperature-compensated, ±2 ppm (about 1 minute a year), I²C 0x68, CR2032 backup₹150Buy
Total about ₹4,450 at typical online prices. Tap a part for its pinout and datasheet notes.
Design calculations
Read voltage in pH 7 (V7) and pH 4 (V4) buffers. Slope = (7 − 4) / (V7 − V4); pH = 7 + (V − V7) × slope. If V7 = 2.50 V and V4 = 3.03 V, slope = −5.66 pH/V.
Compensate EC to 25 °C: V25 = V / (1 + 0.02 × (T − 25)). TDS (ppm) = (133.42 V³ − 255.86 V² + 857.39 V) × 0.5 (DFRobot fit).
pH 6.5 to 8.5; TDS acceptable 500 mg/L, permissible 2000 mg/L without another source; turbidity acceptable 1 NTU, permissible 5 NTU.
The ESP32 ADC is non-linear near its ends; use the eFuse calibration (esp_adc_cal) or an ADS1115 for better pH readings.
Pin map
| Signal | Pin or connection |
|---|---|
| pH board PO | GPIO 36 (ADC1) |
| TDS board A | GPIO 39 |
| Turbidity A (5 V module via 10 k / 20 k divider) | GPIO 34 |
| DS18B20 | GPIO 4 (4.7 kΩ pull-up) |
| OLED SDA / SCL | GPIO 21 / 22 |
Firmware outline
- Read temperature first.
- Read each probe 30 times, drop the highest and lowest 5, average.
- Convert pH with the stored calibration; TDS with temperature compensation; turbidity with its curve.
- Compare with IS 10500 limits and show 'Safe', 'Check' or 'Unsafe' with the reason.
- Store calibration in flash and give a calibration menu with a button.
Test plan
| Test | Expected result |
|---|---|
| pH 4 and 7 buffers after calibration | Within ±0.1 |
| Salt solution of known ppm | TDS within ±10% |
| Tap, RO, borewell, bottled, pond water | Compare with a handheld meter |
| Probe left in water for an hour | Drift recorded |
These rows start your results table when you plan the project.
Viva practice
Say your answer out loud first, then check. The first 2 answers are free; Maker opens all 5.
Make it yours
One or two upgrades for a mini project, two to four for a major one.
Datasheets and sources to cite
- IS 10500:2012 Drinking water specification
- DFRobot Gravity analog TDS sensor wiki
- Hach turbidity measurement handbook
About this project
How much does the iot drinking water quality monitor (ph, tds, turbidity) project cost?
About ₹3,840 for the parts in the base list: ESP32 DevKit V1, pH sensor kit (analog), TDS sensor module, Turbidity sensor module, DS18B20 waterproof probe, 0.96 inch OLED (SSD1306, I²C), pH 4 and 7 buffer powder sachets, Sample cups and holder, 5 V USB adapter.
How long does it take?
About 8 weeks for the base project, built on an ESP32. Each upgrade adds time.
Which branches is it suitable for?
Electronics and Communication, Instrumentation, Computer Science / IT (IoT, AI), as a mini or major project.
Which pins and design calculations does it use?
pH board PO on GPIO 36 (ADC1); TDS board A on GPIO 39; Turbidity A (5 V module via 10 k / 20 k divider) on GPIO 34. Worked calculations on this page: ph two-point calibration, tds with temperature, bis limits (is 10500), esp32 adc accuracy.
How do I test it?
pH 4 and 7 buffers after calibration: Within ±0.1. Salt solution of known ppm: TDS within ±10%. Tap, RO, borewell, bottled, pond water: Compare with a handheld meter. Probe left in water for an hour: Drift recorded.
What are the objectives?
To measure pH, TDS, turbidity and temperature of a water sample. To calibrate pH with two buffers and TDS against a known salt solution. To compare each value with IS 10500 limits and give a verdict. To test ten water sources and compare with a lab or handheld meter.
