Component guide · Beginner · 4 min read
Analog Turbidity Sensor (DFRobot SEN0189 Style)

Wiring, NTU Formula and Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
A turbidity sensor shines infrared light through water and measures how much is scattered by particles, so murky water gives a lower output voltage. These modules give an analog signal (about 4.2 V in clear water) and a digital threshold output. They suit washing machine, filter and water tank projects that need to tell clear water from cloudy, rather than lab-grade NTU readings.
Key specs at a glance
- Principle
- Infrared light transmission and scattering
- Range
- 0 to about 3000 NTU (hobby modules)
- Supply
- 5 V
- Output
- Analog 0 to 4.5 V plus digital (threshold)
- Probe
- Top part waterproof; electronics must stay dry
- UART version
- DFRobot non-contact sensor reads through a clear pipe
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1DFRobot Gravity Analog Turbidity Sensor for Arduino – Probe w/ Adapter₹1,359
Option 2Turbidity Sensor Module for Suspended Solids Detection – 0-4.5V Analog & Digital Output₹769
Option 3Turbidity Sensor with Module – 0-1000 NTU Range, Analog/Digital Output₹489
Option 4Asair AZDM01 Turbidity Sensor Module – Analog Output₹259
Option 5DFRobot Turbidity Sensor Module – Non-contact Optical UART Output for Arduino₹1,259
What the Analog turbidity sensor is
A turbidity sensor shines infrared light through water and measures how much reaches the other side, so it shows how cloudy the water is.
The commonly used curve for the DFRobot sensor is NTU = -1120.4 x V^2 + 5742.3 x V - 4352.9, valid from about 2.5 V to 4.2 V at 5 V supply. Treat the result as approximate; ambient light, bubbles and supply voltage all shift readings.
Calibrate by reading clear tap water and noting that value as your reference, then watch how far readings drop.
Analog turbidity sensor pinout
The pins on the Analog turbidity sensor and what each one does.
| Pin | Function |
|---|---|
| VCC | 5 V |
| GND | Ground |
| AO / OUT | Analog output (A/D switch set to A) |
| DO | Digital output on modules with threshold |
- VCC
- 5 V
- GND
- Ground
- AO / OUT
- Analog output (A/D switch set to A)
- DO
- Digital output on modules with threshold
Wiring the Analog turbidity sensor
Set the module's A/D switch to A for analog. On an ESP32, divide the up to 4.5 V signal down or use an ADS1115.
| Analog turbidity sensor pin | Arduino Uno | ESP32 |
|---|---|---|
| VCC | 5V | 5V (VIN) |
| GND | GND | GND |
| OUT | A0 | GPIO 34 via 10k/20k divider |
- VCC
- Arduino Uno:
- 5V
- ESP32:
- 5V (VIN)
- GND
- Arduino Uno:
- GND
- ESP32:
- GND
- OUT
- Arduino Uno:
- A0
- ESP32:
- GPIO 34 via 10k/20k divider
Example code
The curve is approximate. For decisions, compare against your own clear and dirty reference samples.
void setup() { Serial.begin(9600); }
void loop() {
long sum = 0;
for (int i = 0; i < 50; i++) sum += analogRead(A0);
float v = sum / 50.0 * 5.0 / 1023.0;
float ntu = (v < 2.5) ? 3000 : -1120.4 * v * v + 5742.3 * v - 4352.9;
if (ntu < 0) ntu = 0;
Serial.print(v, 2); Serial.print(" V "); Serial.print(ntu, 0); Serial.println(" NTU");
delay(1000);
}Setup and tuning
the module is designed for 5 V; on a 3.3 V board use a divider on the output.
note the voltage in clean water and adjust the NTU formula to match your module.
only the probe tip is waterproof. Seal the cable entry and keep the board dry.
strong sunlight reaching the probe changes the reading; use it in a shaded tank or pipe.
wipe the probe window regularly, because algae and film look like turbid water.
What you need
Shop this list9 of 10 found in our store · ₹4,929
DFRobot Gravity Analog Turbidity Sensor for Arduino – Probe w/ Adapter: the part this guide coversDFRobot Gravity Analog Turbidity Sensor for Arduino – Probe w/ Adapter₹1,359
Generic Turbidity Sensor Module for Suspended Solids Detection – 0-4.5V Analog & Digital Output: another version this guide coversTurbidity Sensor Module for Suspended Solids Detection – 0-4.5V Analog & Digital Output₹769
Generic Turbidity Sensor with Module – 0-1000 NTU Range, Analog/Digital Output: another version this guide coversTurbidity Sensor with Module – 0-1000 NTU Range, Analog/Digital Output₹489
Asair AZDM01 Turbidity Sensor Module – Analog Output: another version this guide coversAsair AZDM01 Turbidity Sensor Module – Analog Output₹259
DFRobot Turbidity Sensor Module – Non-contact Optical UART Output for Arduino: another version this guide coversDFRobot Turbidity Sensor Module – Non-contact Optical UART Output for Arduino₹1,259- Uno R3 development board: the controller used in the wiring tableFind this part
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
ADS1115 16-bit 4-channel ADC module: better analog readings, especially on ESP32ADS1115 16-Bit 4-Channel ADC Module₹199
16x2 LCD with I2C: to show readings on a character display16×2 LCD with I2C (RG1602A)₹179Closest match, check the specs
Buzzer module 3.3-5 V: for an audible alarmBuzzer Module 3.3–5V₹27
Alternatives and when to choose them
- Water quality sensors: turbidity alongside pH and TDS.
- Analog TDS sensor: dissolved solids rather than particles.
- Liquid level sensors: level rather than quality.
Common mistakes to avoid
- Submerging the whole module instead of only the probe.
- Feeding the 4.5 V output straight into a 3.3 V board.
- Using the sample NTU formula without calibrating it.
- Leaving the probe dirty, so it always reads cloudy.
Frequently asked questions
What does NTU mean?
NTU (nephelometric turbidity unit) measures cloudiness; clean drinking water is below about 1 NTU and muddy water reaches hundreds.
How accurate are these modules?
They are good for clear versus cloudy and trend detection, not precise lab NTU measurement.
Can I use it with an ESP32?
Yes, but divide the 0 to 4.5 V output down to below 3.3 V before the ESP32 analog pin.
Why does my reading change in sunlight?
The sensor uses infrared light, and sunlight adds to it. Shade the probe for steady readings.
What is the digital output for?
It switches when turbidity crosses a level set by the pot, useful for a simple alarm.
Parts for this guide
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

