Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » DIY Turbidity Meter using Turbidity Sensor & Arduino
Arduino Projects

DIY Turbidity Meter using Turbidity Sensor & Arduino

Mamtaz AlamBy Mamtaz AlamUpdated:August 22, 20225 Comments7 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Turbidity Sensor Arduino
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Overview: Turbidity Sensor & Arduino

In this project, we learn to make a DIY Turbidity Meter by interfacing DfRobot Turbidity Sensor with Arduino. Turbidity is the measure of relative clarity of a liquid. It is an optical characteristic of water and is a measurement of the amount of light that is scattered by material in the water when a light is shined through the water sample.

Arduino Turbidity Sensor is applied in projects involving the monitoring of water turbidity in rivers, streams, lakes, water bodies, catchment and research sites, laboratories, tanks with liquids, and so on. Thus by interfacing this sensor with Arduino, we can make a Water Quality Monitoring System device. The water quality measurement also includes some other sensors like Ph Sensor for measuring the Ph value of Liquid, also the TDS Sensor for measuring total dissolved solute in water & DO Sensor to measure dissolved oxygen in water.

We have already discussed Ph Sensor and TDS Sensor earlier. In this entire article, we will cover the basics of Turbidity Sensor and its practical demonstration in measuring Water Turbidity for Water Quality Monitoring. The Turbidity value is measured in terms of NTU which is called Nephelometric Turbidity Units. We will display the Arduino Turbidity Sensor value in the 16X2 LCD Display.


Bill of Materials

The following are the components required for making this project. All the components can be easily purchased from Amazon. The component purchase link is given as well.

S.N.Components NameQuantityPurchase Links
1Arduino UNO Board1Amazon | AliExpress
216x2 I2C LCD Display1Amazon | AliExpress
3Turbidity Sensor1Amazon | AliExpress
4Connecting Wires10Amazon | AliExpress
5Breadboard1Amazon | AliExpress



Turbidity of Water

What Is Turbidity?

Turbidity is the cloudiness or haziness of a fluid caused by large numbers of individual particles that are generally invisible to the naked eye, similar to smoke in the air. The measurement of turbidity is a key test of water quality.

Turbidity is caused by particles suspended or dissolved in water that scatter light making the water appear cloudy or murky. Particulate matter can include sediment, especially clay and silt, fine organic and inorganic matter, soluble colored organic compounds, algae, and other microscopic organisms.

Impact of Turbidity

High turbidity can significantly reduce the aesthetic quality of lakes and streams. It can increase the cost of water treatment for drinking and food processing. It can harm fish and other aquatic life by reducing food supplies, degrading spawning beds, and affecting gill function.

Turbidity Sources

Sediment often tops the list of substances or pollutants causing turbidity. Natural sources can include erosion from upland, riparian, stream bank, and stream channel areas. Algae that grow with nourishment from nutrients entering the stream through leaf decomposition or other naturally occurring decomposition processes can also be a source of turbidity.

Stream channel movement can also release sediment. Organic matter from sewage discharges, especially during treatment plant bypasses, can contribute to turbidity. Human activities that disturb the land, such as construction, mining, and agriculture, can lead to high sediment levels entering water bodies during rainstorms due to stormwater runoff.

Measuring Turbidity

Turbidity is measured using specialized optical equipment in a laboratory or in the field. Light is directed through a water sample, and the amount of light scattered is measured.

The unit of measurement is called a Nephelometric Turbidity Unit (NTU), which comes in several variations. The greater the scattering of light, the higher the turbidity. Low turbidity values indicate high water clarity; high values indicate low water clarity.


DfRobot Turbidity Sensor

DfRobot Turbidity Sensor

The gravity Arduino Turbidity sensor from DfRobot detects water quality by measuring the levels of turbidity. It uses light to detect suspended particles in water by measuring the light transmittance and scattering rate, which changes with the amount of total suspended solids (TSS) in water. As the TTS increases, the liquid turbidity level increases.



This liquid sensor provides analog and digital signal output modes. The threshold is adjustable when in digital signal mode. You can select the mode according to your Microcontroller Applications.

Working of a Turbidity Sensor

Working of Turbidity Sensor

The sensor operates on the principle that when the light is passed through a sample of water, the amount of light transmitted through the sample is dependent on the amount of soil in the water. As the soil level increases, the amount of transmitted light decreases. The turbidity sensor measures the amount of transmitted light to determine the turbidity of the wash water.

Sensor Specification

1. Operating Voltage: 5V DC
2. Operating Current: 40mA (MAX)
3. Response Time: <500ms
4. Insulation Resistance: 100M (Min)
5. Output Method: Analog
6. Analog output: 0-4.5V
7. Digital Output: High/Low-level signal (you can adjust the threshold value by adjusting the potentiometer)

Sensor Construction & Circuit

The front-end sensor is an optical device comprising an LED (light sender) and a phototransistor (light receiver). The schematic of the Turbidity Sensor’s inside board is given below. It has a three-wire interface: VCC (+5 V), GND (0 V) & OUT/SIGNAL.

The Turbidity sensor has a signal connector Board as well. The signal connector board is directly connected to the above circuit.

The LMV358 IC-based module provides a three-pin interface to connect with Arduino, and there is also an analog/digital selector switch on the module to flip between analog and digital output mode.

Relationship Between Turbidity and Sensor Voltage

From the DfRobot Article, i got this graph with an equation that relates the voltage from the sensor to turbidity.

From this graph I concluded, while coding for your microcontroller-based project that the equation included in the relationship graph is only applicable if the sensor gives out 4.2 V roughly at zero turbidity (clear water), and it’s only true within the range of 2.5 V to 4.2 V (3,000 to 0 turbidity).

Thus if you are not getting the correct value, calibration is required. This can be done by rotating the small potentiometer inside the turbidity sensor.


Interfacing Turbidity Sensor with Arduino

Now let’s make a simple Turbidity Meter using Arduino. You can do this by simply connecting the Turbidity Sensor with Arduino Board.

Interfacing Turbidity Sensor Arduino

Connect the VCC of the Turbidity Sensor with Arduino 5V, GND to GND & Analog Output to Arduino A0 pin as shown in the image above.

Basic Turbidity Sensor Arduino Interfacing Code

Here is a basic code for Interfacing Turbidity Sensor with Arduino. This code will read the analog value from the sensor and display it on the Serial Monitor.

1
2
3
4
5
6
7
8
9
10
11
12
13
void setup() {
  Serial.begin(9600);
 
}
void loop() {
  int sensorValue = analogRead(A0);
  float voltage = sensorValue * (5.0 / 1024.0);
 
  Serial.println ("Sensor Output (V):");
  Serial.println (voltage);
  Serial.println();
  delay(1000);
}




Arduino Turbidity Meter with LCD Display

Now let us add an extra 16×2 I2C LCD Display to display the Turbidity Value in LCD Screen. The connection diagram is given below.

Turbidity Meter Arduino LCD

We can use the I2C LCD to reduce the number of wiring. Connect the SDA & SCL Pin of I2C LCD to Arduino A4 (SDA) & A5 (SCL) Pin.


Arduino Turbidity Meter Source Code Program

Now let us check the Turbidity sensor Arduino Project code. You need to add the I2C LCD Library to the Arduino IDE. Download the library from this link.

Download I2C LCD Library

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <Wire.h>
#include <LiquidCrystal_I2C.h>    //https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library
LiquidCrystal_I2C lcd(0x27, 16, 2);
 
int sensorPin = A0;
float volt;
float ntu;
void setup()
{
  Serial.begin(9600);
  lcd.begin();
  lcd.backlight();
}
void loop()
{
    
    volt = 0;
    for(int i=0; i<800; i++)
    {
        volt += ((float)analogRead(sensorPin)/1023)*5;
    }
    volt = volt/800;
    volt = round_to_dp(volt,2);
    if(volt < 2.5){
      ntu = 3000;
    }else{
      ntu = -1120.4*square(volt)+5742.3*volt-4353.8;
    }
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print(volt);
    lcd.print(" V");
    lcd.setCursor(0,1);
    lcd.print(ntu);
    lcd.print(" NTU");
    delay(10);
}
float round_to_dp( float in_value, int decimal_place )
{
  float multiplier = powf( 10.0f, decimal_place );
  in_value = roundf( in_value * multiplier ) / multiplier;
  return in_value;
}


Code Explanation

1
2
3
#include <Wire.h>
#include <LiquidCrystal_I2C.h>  
LiquidCrystal_I2C lcd(0x27, 16, 2);

First, we declared the Library for 16×2 LCD Display which has I2C Pins with I2C address of 0x27.

1
2
3
4
5
6
volt = 0;
    for(int i=0; i<800; i++)
    {
        volt += ((float)analogRead(sensorPin)/1023)*5;
    }
    volt = volt/800;

The output analog voltage from the sensor has huge variations and its too noisy to measure. Hence we took the 800 readings and then took the average value for reading.

1
ntu = -1120.4*square(volt)+5742.3*volt-4352.9;

Using this formula we converted the analog voltage value to NTU.

1
2
3
4
if(volt < 2.5)
{
      ntu = 3000;
    }

If the analog voltage reading goes below 2.5 V, the NTU is set to 3000. Thus 3000 is the maximum NTU value of the project.



Results & Observations

To check the working of the project, you can dip the sensor in different types of water sources. You can mix mud, or clay and check the water Turbidity in NTU.

For example in clean water, the voltage will remain 4.2V. If it’s not showing 4.2 then you need to adjust the calibration by rotating the Potentiometer in Sensor.

Turbidity Sensor dfrobot Arduino

Thus, the final Arduino Turbidity Meter is ready now and can be used for Water Quality Monitoring.


Video Tutorial & Guide

DIY Turbidity Meter using Arduino & Analog Turbidity Sensor
Watch this video on YouTube.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleESP32 MicroPython – Interfacing Ultrasonic Sensor HC-SR04
Next Article Interfacing APDS9960 Gesture & RGB Color Sensor with Arduino

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
View 5 Comments

5 Comments

  1. brian faux on February 11, 2022 5:39 PM

    Looks like this sensor only works at the surface ie not submersible- is this the case?

    Reply
  2. zweerius on September 22, 2022 12:17 AM

    Seems so indeed. It is not hard to make your own that can be fully submerged. I used two testtubes, one with LED, other with phototransistor

    Reply
  3. SANJAIKUMAR M on March 4, 2023 9:22 AM

    sir or madam turbidity value constantly showing 3000 thousand but voltage will be vary for example voltage became 0.21v that time turbidity value is showing 3000 thousand what will i do please help

    Reply
  4. NoamKali on May 29, 2023 3:38 PM

    hello, the ciruit schematic of the The LMV358 is not correct, you can find the correct circuit in the following link (click on the word “schemtic” under the headline “more”)https://wiki.dfrobot.com/Turbidity_sensor_SKU__SEN0189

    Reply
  5. Anish on December 1, 2023 11:24 PM

    how to know which jumper wire is connected

    Reply

CommentsCancel reply

Latest Posts

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 14, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • IoT Based PM & Air Quality Monitoring System using ESP32
    IoT Based PM & Air Quality Monitoring System using ESP32
  • How to use LDR Sensor Module with Arduino
    How to use LDR Sensor Module with Arduino
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • How to use Modbus RTU with ESP32 to read Sensor Data
    How to use Modbus RTU with ESP32 to read Sensor Data
  • ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
    ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
  • Silicon Controlled Rectifier (SCR): Construction, Working & Applications
    Silicon Controlled Rectifier (SCR): Construction, Working & Applications
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.