Water looks clean but can hide dirt we cannot see.
Tiny dust, clay and silt make water cloudy.
This cloudy thing is called turbidity.
More turbidity means more dirt and bad water.
Less turbidity means clean and safe water.
This project uses Arduino and turbidity sensor to check water.
It shows result on LCD and color lights.
This article shows working, coding and how to build it.
Circuit Coding:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
int sensorPin = A0;
int red = 2;
int green = 3;
int blue = 4;
void setup() {
lcd.init();
lcd.backlight();
pinMode(red, OUTPUT);
pinMode(green, OUTPUT);
pinMode(blue, OUTPUT);
}
void loop() {
int value = analogRead(sensorPin);
float voltage = (value / 1023.0) * 5.0;
lcd.setCursor(0,0);
lcd.print("Turbidity:");
lcd.setCursor(0,1);
lcd.print(voltage);
lcd.print(" V");
if(voltage > 4.0){
digitalWrite(red, HIGH);
digitalWrite(green, LOW);
digitalWrite(blue, LOW);
}
else if(voltage > 2.5){
digitalWrite(red, LOW);
digitalWrite(green, LOW);
digitalWrite(blue, HIGH);
}
else{
digitalWrite(red, LOW);
digitalWrite(green, HIGH);
digitalWrite(blue, LOW);
}
delay(1000);
}
Coding Explanation:
- Add LCD library.
- Set sensor pin as A0.
- Set RGB LED pins as D2, D3, D4.
- In setups start LCD.
- Turn ON LCD backlight.
- Set RGB pins as output.
- In loop read sensor value from A0.
- Change value to voltage.
- Show voltage on LCD.
- If voltage > 4.0 then red LED will be ON.
- Else if voltage > 2.5 then blue LED will be ON.
- Else green LED will be ON.
- Wait 1 second.
- Loop runs again.
- Arduino keeps checking water.
Circuit Working:

Parts List:
Component | Quantity |
---|---|
Resistor | |
220Ω 1/4 watt | 3 |
Semiconductors | |
Arduino Uno | 1 |
Turbidity Sensor Module | 1 |
SPI/I2C Serial 16×2 Character LCD Backpack | 1 |
RGB LED (Common Cathode) | 1 |
Turbidity sensor has IR LED and photodiode inside.
Clear water lets more light pass.
Dirty water blocks light.
Sensor gives analog output voltage.
Arduino reads this from A0.
Arduino shows value on LCD through I2C.
RGB LED gives quick visual signal.
For each LED pins resistor R1 to R3 are connected to limit the current flowing through it.
LCD and RGB LED connect to digital pins.
Put sensor in water.
Arduino reads analog value.
When water is clean then voltage is low.
When water is dirty then voltage goes high.
Arduino checks voltage and changes LED color.
LCD shows the voltage.
Through this user can know water quality.
Formulas:
Below is the general formula for Water Quality Test Circuit using Arduino and Turbidity Sensor:
Voltage = (AnalogValue / 1023) * 5
Example: if AnalogValue = 820 then
Voltage = (820/1023)*5 = 4.00V
Higher voltage means more turbidity
Lower voltage means less turbidity
How to Build:
To build a Water Quality Test Circuit using Arduino and Turbidity Sensor follow the below steps for connections:
- Gather all parts as shown in circuit diagram.
- Turbidity sensor 5V go to Arduino 5V.
- Turbidity sensor GND go to Arduino GND.
- Turbidity sensor analog pin go to Arduino A0.
- Connect LCD VCC to Arduino 5V.
- Connect LCD GND to Arduino GND.
- Connect LCD SDA to Arduino A4.
- Connect LCD SCL to Arduino A5.
- Connect RGB LED common cathode to Arduino GND.
- Connect RGB LED Red pin to Arduino D2.
- Connect RGB LED Green pin to Arduino D3.
- Connect RGB LED Blue pin to Arduino D4.
- And cathode pin 2 of RGB LED connect to GND
- Add resistors R1 to R3 220Ω in series with each LED pin (R, G, B)
Conclusion:
This project for Water Quality Test Circuit using Arduino and Turbidity Sensor is easy and with low cost.
It checks water quality using turbidity sensor.
Arduino shows result on LCD and color lights.
It helps to know clean or dirty water.
Useful for home, school and lab use.
Leave a Reply