TUR-100 with Arduino, ESP32, Raspberry Pi and Python

How to wire the TUR-100 Stainless Steel Turbidity Sensor to your own microcontroller or computer and read it over RS485 Modbus RTU. The tables are the ones in the datasheet, and both code examples are run against the datasheet example frame before this page is published.

Product page Datasheet (PDF) Datasheet (Markdown) Arduino sketch (.ino) Python script (.py)

TUR-100 Stainless Steel Turbidity Sensor

Connecting the TUR-100

The probe is an RS485 device, so it needs a transceiver between it and your board. On a computer or a Raspberry Pi that is a USB to RS485 adapter. On a microcontroller it is a MAX485-type module on a hardware serial port. Power the probe from a supply within the voltage range in the table and join its ground to the ground of the transceiver.

Wire Color Function Description
Red V+ Power Supply (12 to 24 V DC)
Black GND Power Ground
Yellow RS485-A Data+
Green RS485-B Data-

The wire colours are confirmed by the label on each cable. Wire the sensor with the power off and check every connection before powering up.

Python example (Raspberry Pi, Linux, macOS, Windows)

The script needs only pyserial. It builds the Modbus request itself, checks the CRC of the reply and prints one reading every five seconds. On Windows pass the COM port as the argument.

#!/usr/bin/env python3
"""Read the Agrinovo TUR-100 over RS485 Modbus RTU.

Works on a Raspberry Pi or any computer with a USB to RS485 adapter.
Install the serial library once:  pip install pyserial
Run:  python3 tur_100.py /dev/ttyUSB0
"""
import struct
import sys
import time

import serial

PORT = sys.argv[1] if len(sys.argv) > 1 else "/dev/ttyUSB0"
ADDRESS = 0x01  # the sensor's Modbus address


def crc16(frame: bytes) -> bytes:
    crc = 0xFFFF
    for byte in frame:
        crc ^= byte
        for _ in range(8):
            crc = (crc >> 1) ^ 0xA001 if crc & 1 else crc >> 1
    return struct.pack("<H", crc)


def read_registers(port, address, function, start, count):
    request = struct.pack(">BBHH", address, function, start, count)
    port.reset_input_buffer()
    port.write(request + crc16(request))
    reply = port.read(5 + 2 * count)
    if len(reply) >= 5 and reply[1] == function | 0x80:
        raise IOError(f"sensor returned Modbus error {reply[2]}")
    if len(reply) != 5 + 2 * count or crc16(reply[:-2]) != reply[-2:]:
        raise IOError("no valid reply from the sensor")
    return reply[3:-2]


def read_probe(port):
    data = read_registers(port, ADDRESS, 0x03, 0x0000, 1)
    return {
        "turbidity": struct.unpack(">H", data[0:2])[0] * 0.1,  # NTU
    }


if __name__ == "__main__":
    with serial.Serial(PORT, 9600, bytesize=8, parity="N", stopbits=1, timeout=1) as port:
        while True:
            print(read_probe(port))
            time.sleep(5)

Arduino example (Uno, Mega, ESP32, ESP8266, MKR, Pico)

The sketch uses the Agrinovo library: in the Arduino IDE open Sketch > Include Library > Manage Libraries and install "Agrinovo". The library picks the serial port for your board, and the pins are listed at the top of AgrinovoDefaultPort.h. DE and RE of the transceiver go to one output pin.

// Agrinovo TUR-100 turbidity sensor
// Prints turbidity every 5 seconds.
//
// Sensor cable
//   Red     supply +, 12-24 V DC
//   Black   supply ground, joined to the board's ground
//   Yellow  RS485 A
//   Green   RS485 B
//
// The board talks to the sensor through an RS485 transceiver (MAX485 or
// similar). AgrinovoDefaultPort.h lists the serial pins used on each board.
//
// https://agrinovo.io/products/sensors/aqua/turbidity/tur-100-turbidity-sensor/

#include <Agrinovo.h>
#include <AgrinovoDefaultPort.h>

const int DE_PIN = 4;  // transceiver DE and RE, tied together

AgrinovoBus bus(AGRINOVO_PORT, DE_PIN);
AgrinovoTUR100 sensor(bus);  // Modbus address 1

void setup() {
  Serial.begin(115200);
  agrinovoPortBegin(9600);
  bus.begin();
}

void loop() {
  if (sensor.read()) {
    Serial.print("Turbidity: ");
    Serial.print(sensor.turbidity(), 1);
    Serial.println(" NTU");
  } else {
    Serial.println(sensor.errorText());
  }
  delay(5000);
}

What the examples read

Both examples send one request, function 0x03, 1 registers from 0x0000, and decode these values:

Value Unit Register Encoding
Turbidity NTU 0x0000 Unsigned 16-bit integer, scaled

Other Modbus tools

The same request works from any Modbus RTU master: pymodbus, minimalmodbus, Node-RED, LabVIEW, a PLC or a third-party data logger with a Modbus port. Use the serial settings, function code and register addresses above.

Logging without writing code

The Omni Genesis controller reads the TUR-100 and sends the readings to the Agrinovo cloud over the cellular network, where they can be exported or read through the cloud API.

Datasheet reference

Specifications

Parameter Specification
Measurement Principle 90° infrared scattered light
Measurement Ranges 0 to 10, 0 to 20, 0 to 100, 0 to 400, 0 to 1000 or 0 to 4000 NTU (custom ranges available)
Accuracy ±2%
Resolution 0.1 NTU (register value ÷10)
Stability ≤1 NTU per 24 hours
Output RS485, Modbus-RTU (4 to 20 mA optional)
Supply Voltage 12 to 24 V DC
Power Consumption ≤0.5 W
Operating Environment 0 to 60°C, ≤85% RH
Protection IP68
Housing Stainless steel
Cable Low-noise cable, runs of 20 m and more

Communication Settings

Parameter Value
Protocol Modbus-RTU
Baud Rate 9600 bps
Data Bits 8
Parity None
Stop Bits 1
Default Address 0x01
Broadcast Address 0xFE (one sensor on the bus only)

Register Map

Address Description Type R/W Notes
0x0000 Turbidity Int R NTU = value ÷10
0x0050 Slave Address Int W New address
0x0053 Slope Int W Value ÷1000, default 1000 (1.000)
0x0054 Intercept Int W Default 0

Reading Data

Read turbidity (1 register from 0x0000):

Request:  01 03 00 00 00 01 84 0A
Response: 01 03 02 1A 0A 33 23

Decoding:

Register Raw Decimal Result
Turbidity 0x1A0A 6666 666.6 NTU

Address Configuration

Change Address (0x01 to 0x02)

01 06 00 50 00 02 08 1A

If the current address is unknown, send the read or write to the broadcast address 0xFE with only one sensor connected:

FE 03 00 00 00 01 90 05

Calibration

The sensor ships calibrated. A linear correction is applied in the field by writing a slope and an intercept.

Set Slope to 1.200

01 06 00 53 04 B0 7A AF

Set Intercept to 10

01 06 00 54 00 0A 48 1D

Revision History

Rev Date Changes
1.0 October 2026 Initial release

Contact

Agrinovo, https://agrinovo.io/products, [email protected], +972 54 688 8148 (direct / WhatsApp). Specifications subject to change without notice.

Questions about wiring or the protocol?

Tell us which board or logger you are using and what you need to measure.