Contact Sales & After-Sales Service

Contact & Quotation

  • Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
  • Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

Notes:
For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.

Turbidity Sensor Arduino: Water Clarity Monitoring

Water quality monitoring has become increasingly important for environmental applications, aquarium maintenance, and industrial process control. The Turbidity Sensor Arduino combination offers an affordable and practical solution for measuring water clarity in real-time. Having integrated this sensor into several water monitoring systems, I can confirm it delivers reliable results when properly calibrated.

This guide covers everything you need to build a working turbidity meter using Arduino, from understanding the measurement principles to implementing complete code examples with NTU conversion.

What Is Turbidity and Why Measure It?

Turbidity refers to the cloudiness or haziness in a liquid caused by suspended particles that are individually invisible to the naked eye. Think of it like smoke in the air, except these particles float in water. The measurement quantifies how much light scatters when passing through a water sample.

Clean drinking water typically has turbidity below 1 NTU (Nephelometric Turbidity Unit), while muddy river water might exceed 1000 NTU. Monitoring turbidity helps assess water quality because high levels often indicate contamination, sediment runoff, or biological growth.

Common Applications for Turbidity Measurement

ApplicationTypical NTU RangePurpose
Drinking Water0 – 4 NTUSafety compliance monitoring
Aquariums0 – 25 NTUFish health maintenance
Swimming Pools0 – 10 NTUClarity verification
Wastewater100 – 4000 NTUTreatment process monitoring
Rivers/Streams10 – 500 NTUEnvironmental assessment
Industrial ProcessesVariesQuality control

How the Turbidity Sensor Works

The Turbidity Sensor Arduino setup operates on a principle called the Tyndall effect. When light passes through water containing suspended particles, those particles scatter the light in various directions. The sensor measures how much light transmission changes due to this scattering.

Sensor Components and Operation

The typical turbidity sensor module consists of two main parts: a sensor probe and an analog-to-digital converter board.

The sensor probe contains an infrared LED (light transmitter) and a phototransistor (light receiver) positioned opposite each other. When submerged in water, the LED emits light through the liquid. Clear water allows most light to reach the receiver, producing a high voltage output (around 4.2V). As water becomes more turbid, suspended particles block and scatter light, reducing the voltage output.

The converter board amplifies the sensor signal and provides both analog and digital output options. A potentiometer on the board allows threshold adjustment for digital mode operation.

Turbidity Sensor Arduino Specifications

Understanding the sensor specifications helps ensure proper implementation in your project.

ParameterValue
Operating Voltage5V DC
Operating Current40mA (max)
Response Time< 500ms
Output SignalAnalog (0-4.5V) or Digital
Detection Range0 – 3000 NTU
Operating Temperature5°C – 90°C
Probe MaterialABS plastic
Interface3-wire (VCC, GND, Signal)

Important Note: The sensor probe is not fully waterproof. The top portion containing the wire connections must remain above the water surface during measurements.

Turbidity Sensor Arduino Pinout and Wiring

The wiring for this sensor is refreshingly simple compared to many other water quality sensors.

Sensor Module Pinout

PinLabelFunction
1VCC5V Power Supply
2GNDGround Reference
3SignalAnalog/Digital Output

Mode Selection Switch

The converter board includes a small switch labeled “A” and “D”:

ModeSwitch PositionOutput Behavior
AnalogAVariable voltage (0-4.5V) proportional to turbidity
DigitalDHIGH when turbidity exceeds threshold, LOW otherwise

For measuring actual turbidity levels, use Analog mode. Digital mode works best for simple detection applications like triggering alarms when water becomes too dirty.

Wiring to Arduino Uno

Turbidity SensorArduino Uno
VCC5V
GNDGND
Signal (Analog Mode)A0
Signal (Digital Mode)D2

The sensor draws minimal current, so powering it directly from the Arduino’s 5V pin works fine for most applications.

Calibrating the Turbidity Sensor Arduino

Proper calibration is essential for accurate readings. Without calibration, your sensor might show incorrect voltage values that don’t match the expected NTU conversion.

Calibration Procedure

  1. Connect the sensor to Arduino and upload a basic analog reading sketch
  2. Place the sensor probe in clean, clear water (distilled water works best)
  3. Check the voltage reading on the Serial Monitor
  4. If the reading differs from 4.2V, adjust the potentiometer on the converter board
  5. Turn the potentiometer slowly until you achieve approximately 4.2V in clear water
  6. Verify by testing in turbid water (muddy water should read significantly lower voltage)

Voltage to NTU Conversion

The relationship between voltage and NTU is non-linear. DFRobot provides this polynomial equation for conversion:

NTU = -1120.4 × voltage² + 5742.3 × voltage – 4352.9

This equation works when the sensor outputs 4.2V in clear water. At this calibrated state, 4.2V corresponds to approximately 0 NTU, while lower voltages indicate higher turbidity.

Voltage OutputApproximate NTUWater Condition
4.2V0Crystal clear
3.5V500Slightly cloudy
3.0V1500Moderately turbid
2.5V3000Very turbid

Turbidity Sensor Arduino Code Examples

Let me share the code patterns that have proven most reliable in my projects.

Basic Voltage Reading

Start with this simple sketch to verify your sensor is working:

void setup() {

  Serial.begin(9600);

}

void loop() {

  int sensorValue = analogRead(A0);

  float voltage = sensorValue * (5.0 / 1024.0);

  Serial.print(“Voltage: “);

  Serial.print(voltage);

  Serial.println(” V”);

  delay(500);

}

Complete Turbidity Meter with NTU Conversion

This code converts voltage readings to NTU values and provides water quality assessment:

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

const int turbidityPin = A0;

void setup() {

  Serial.begin(9600);

  lcd.init();

  lcd.backlight();

  lcd.setCursor(0, 0);

  lcd.print(“Turbidity Meter”);

  delay(2000);

  lcd.clear();

}

void loop() {

  int sensorValue = analogRead(turbidityPin);

  float voltage = sensorValue * (5.0 / 1024.0);

  // Convert voltage to NTU using polynomial equation

  float ntu = 0;

  if (voltage < 4.2) {

    ntu = -1120.4 * voltage * voltage + 5742.3 * voltage – 4352.9;

  }

  // Ensure NTU doesn’t go negative

  if (ntu < 0) ntu = 0;

  // Display on LCD

  lcd.setCursor(0, 0);

  lcd.print(“NTU: “);

  lcd.print(ntu, 1);

  lcd.print(”     “);

  lcd.setCursor(0, 1);

  if (ntu < 10) {

    lcd.print(“Water: Clean    “);

  } else if (ntu < 100) {

    lcd.print(“Water: Moderate “);

  } else {

    lcd.print(“Water: Dirty    “);

  }

  // Serial output for logging

  Serial.print(“Voltage: “);

  Serial.print(voltage);

  Serial.print(“V | NTU: “);

  Serial.println(ntu);

  delay(500);

}

Digital Mode Alarm System

For simple threshold detection, use digital mode:

const int turbidityPin = 2;

const int buzzerPin = 8;

const int ledPin = 13;

void setup() {

  Serial.begin(9600);

  pinMode(turbidityPin, INPUT);

  pinMode(buzzerPin, OUTPUT);

  pinMode(ledPin, OUTPUT);

}

void loop() {

  int turbidityState = digitalRead(turbidityPin);

  if (turbidityState == HIGH) {

    // Water is turbid – trigger alarm

    digitalWrite(ledPin, HIGH);

    tone(buzzerPin, 1000, 200);

    Serial.println(“WARNING: High turbidity detected!”);

  } else {

    // Water is clear

    digitalWrite(ledPin, LOW);

    noTone(buzzerPin);

    Serial.println(“Water clarity: OK”);

  }

  delay(500);

}

Improving Measurement Accuracy

After working with turbidity sensors across multiple projects, here are the techniques that consistently improve results.

Averaging Multiple Readings

Single readings can fluctuate due to electrical noise or particles momentarily passing through the sensor. Average 10-20 readings for more stable results:

float getAverageTurbidity(int samples) {

  float total = 0;

  for (int i = 0; i < samples; i++) {

    total += analogRead(A0);

    delay(10);

  }

  return (total / samples) * (5.0 / 1024.0);

}

Temperature Considerations

The sensor’s output varies slightly with temperature. For precise applications, measure water temperature simultaneously and apply compensation. According to the datasheet, the sensor maintains reasonable accuracy between 10°C and 50°C.

Proper Probe Positioning

Always submerge the sensor probe vertically with the sensing window facing away from direct light sources. Ambient light can interfere with the infrared measurement. In outdoor applications, consider adding a light shield around the probe.

Useful Resources for Turbidity Sensor Arduino Projects

ResourceURLDescription
DFRobot Wikiwiki.dfrobot.comOfficial sensor documentation
DFRobot Product Pagedfrobot.comPurchase sensor modules
Arduino Referencearduino.cc/referenceProgramming documentation
Seeed Studio Wikiwiki.seeedstudio.comGrove sensor tutorials
GitHub Librariesgithub.comCommunity code examples

Component Sources:

  • DFRobot (dfrobot.com) – Original Gravity Turbidity Sensor
  • Seeed Studio (seeedstudio.com) – Grove Turbidity Sensor
  • Amazon – Various compatible modules
  • AliExpress – Budget sensor options

FAQs About Turbidity Sensor Arduino Projects

How accurate is a Turbidity Sensor Arduino setup compared to professional equipment?

Arduino turbidity sensors provide accuracy of approximately ±5-10% when properly calibrated, suitable for comparative measurements and general water quality assessment. Professional nephelometric turbidimeters offer higher precision (±2%) but cost significantly more. For hobby projects, aquarium monitoring, and educational purposes, the Arduino setup delivers perfectly adequate results. Laboratory-grade testing still requires certified equipment.

Can I use the turbidity sensor for drinking water safety testing?

The turbidity sensor gives a general indication of water quality, but it should not be the sole measure for drinking water safety. Safe drinking water requires testing multiple parameters including pH, TDS (Total Dissolved Solids), bacterial content, and specific contaminants. The turbidity sensor detects suspended particles but cannot identify what those particles are. Consider adding pH and TDS sensors to your monitoring system for a more complete assessment.

Why does my turbidity sensor show different readings in the same water sample?

Inconsistent readings typically result from air bubbles on the sensor probe, particles settling in the water, temperature changes, or electrical noise. Ensure the probe is completely submerged without air bubbles, stir the water sample before measurement, allow the sensor to stabilize for a few seconds, and average multiple readings. Also verify your calibration is correct by testing in distilled water.

Is the turbidity sensor waterproof for long-term submersion?

The sensor probe can remain submerged during measurements, but the top portion with wire connections is not waterproof. For continuous monitoring applications, you’ll need to waterproof the connection area or design a housing that keeps the connector above water level. Some users apply marine-grade epoxy around the wire entry point for extended underwater use, though this may void any warranty.

What is the difference between NTU, FNU, and JTU turbidity units?

NTU (Nephelometric Turbidity Units) and FNU (Formazin Nephelometric Units) are essentially equivalent and represent the modern standard for turbidity measurement using 90-degree light scattering. JTU (Jackson Turbidity Units) is an older standard based on visual observation through water columns. For the DFRobot turbidity sensor, 1 NTU equals 1 JTU equals approximately 1 mg/L of suspended solids. Most Arduino turbidity projects use NTU as the primary unit.

Conclusion

The Turbidity Sensor Arduino combination provides an accessible entry point into water quality monitoring. With proper calibration and the code examples provided, you can build a functional turbidity meter for aquarium maintenance, environmental monitoring, or educational projects.

Start with the basic voltage reading code to verify your hardware works correctly, then progress to the NTU conversion code for meaningful measurements. Remember that accuracy depends heavily on proper calibration in clear water and consistent probe positioning during measurements.

For comprehensive water quality systems, consider combining the turbidity sensor with pH and TDS sensors to create a complete monitoring solution that provides multiple indicators of water condition.

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Sales & After-Sales Service

Contact & Quotation

  • Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.

  • Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.

Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

Notes:
For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.