IDT project
A real-time water quality monitoring system built using an ESP32, TDS sensor, turbidity sensor, and ST7735 TFT display. The system continuously measures Total Dissolved Solids (TDS) and water turbidity, presenting the results through an intuitive graphical interface while providing an overall water quality assessment.
Water quality is a critical factor in environmental monitoring, aquaculture, water treatment, and domestic water supply systems. This project provides a compact and cost-effective solution for monitoring key water quality parameters in real time.
The ESP32 collects analog data from a TDS sensor and a turbidity sensor, processes the readings, and displays the results on a 1.8-inch ST7735 TFT screen. Color-coded indicators allow users to quickly evaluate water quality conditions.
- Real-time TDS measurement (ppm)
- Real-time turbidity measurement (NTU)
- Graphical TFT display interface
- Color-coded status indicators
- Water quality classification system
- Serial Monitor debugging output
- ESP32-based architecture
- Modular and easily expandable design
| Component | Quantity |
|---|---|
| ESP32 Dev Board (38-Pin VROOM) | 1 |
| ST7735 TFT Display (1.8") | 1 |
| TDS Sensor Module | 1 |
| Turbidity Sensor Module | 1 |
| Breadboard | 1 |
| Jumper Wires | As Required |
| USB Cable | 1 |
TDS Sensor ──────┐
│
▼
ESP32 MCU ──────► TFT Display
▲
│
Turbidity Sensor ┘
The ESP32 acts as the central processing unit, acquiring sensor data, performing calculations, and updating the display with processed measurements.
| TFT Pin | ESP32 Pin |
|---|---|
| VCC | 3.3V |
| GND | GND |
| SCK | GPIO 18 |
| MOSI | GPIO 23 |
| CS | GPIO 5 |
| DC | GPIO 2 |
| RST | GPIO 4 |
| Sensor | ESP32 Pin |
|---|---|
| TDS Sensor Output | GPIO 34 |
| Turbidity Sensor Output | GPIO 35 |
Install the following libraries through the Arduino IDE Library Manager:
- Adafruit GFX Library
- Adafruit ST7735 and ST7789 Library
- SPI Library (included with Arduino IDE)
The system samples the TDS sensor multiple times and computes the average voltage. Temperature compensation is applied before converting the voltage into Total Dissolved Solids (ppm).
Where:
V= Compensated sensor voltageTDS= Total Dissolved Solids in ppm
The turbidity sensor output voltage is converted into Nephelometric Turbidity Units (NTU) using a calibrated polynomial equation.
Where:
V= Sensor voltageNTU= Turbidity measurement
| Range (ppm) | Quality |
|---|---|
| < 300 | Good |
| 300 – 600 | Acceptable |
| > 600 | Poor |
| Range (NTU) | Quality |
|---|---|
| < 10 | Good |
| 10 – 100 | Acceptable |
| > 100 | Poor |
The system determines overall water quality using both TDS and turbidity values.
| Condition | Status |
|---|---|
| Low TDS and Low Turbidity | Good Water |
| Moderate TDS and Turbidity | Acceptable |
| High TDS or High Turbidity | Poor Water |
The TFT display presents:
- Project title banner
- Current TDS reading
- Current turbidity reading
- Color-coded measurement values
- Overall water quality status
| Color | Meaning |
|---|---|
| Green | Good |
| Yellow | Acceptable |
| Red | Poor |
TDS: 245 ppm | Turbidity: 5 NTU
TDS: 372 ppm | Turbidity: 24 NTU
TDS: 712 ppm | Turbidity: 135 NTU
git clone https://github.com/your-username/ESP32-Water-Quality-Monitor.gitInstall all required libraries through the Arduino IDE Library Manager.
- Select the ESP32 board.
- Choose the correct COM port.
- Verify the pin assignments if using different hardware.
Compile and upload the firmware to the ESP32.
- Open Serial Monitor at 115200 baud.
- Observe live sensor values on the TFT display.
Potential improvements include:
- pH sensor integration
- Temperature sensor integration (DS18B20)
- SD card data logging
- Wi-Fi dashboard
- Cloud connectivity
- Mobile application support
- Historical trend visualization
- MQTT and IoT integration
- Drinking water quality assessment
- Water filtration systems
- Aquaculture monitoring
- Environmental monitoring
- Educational and research projects
- Smart water management systems
This project is distributed under the MIT License. Feel free to use, modify, and distribute it for personal, educational, or commercial purposes.