Site icon Circuit Ideas for You

Water Quality Test Circuit using Arduino and Turbidity Sensor

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:

Circuit Working:

Parts List:

ComponentQuantity
Resistor
220Ω 1/4 watt3
Semiconductors
Arduino Uno1
Turbidity Sensor Module1
SPI/I2C Serial 16×2 Character LCD Backpack1
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:

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.

References:

Measuring Water Quality using Arduino and Turbidity
Sensor

Exit mobile version