Documentation

ShillehTek DS18B20 Waterproof Digital Temp Sensor Probe 1M for Arduino Pi | ShillehTek Product Manual
Documentation / ShillehTek DS18B20 Waterproof Digital Temp Sensor Probe 1M for Arduino Pi | ShillehTek Product Manual

ShillehTek DS18B20 Waterproof Digital Temp Sensor Probe 1M for Arduino Pi | ShillehTek Product Manual

ESP32manualRaspberry PishillehtekTemperature Sensor

Overview

The DS18B20 is a digital temperature sensor with a beautifully simple wiring story: power, ground, and a single data wire. This waterproof version embeds the chip inside a stainless-steel probe with a 1-meter PVC-jacketed cable — perfect for water tanks, pipes, soil temperature, fish tanks, sous-vide projects, or anywhere a bare sensor would corrode.

Each DS18B20 communicates over Maxim's 1-Wire protocol and ships with a unique 64-bit factory-burned ID. That means you can put dozens of probes on the same data line and address each one individually — ideal for multi-zone temperature monitoring without burning a GPIO per sensor. Resolution is configurable from 9 to 12 bits, with +/-0.5 degC accuracy across most of its -55 to +125 degC range.

It works with Arduino, ESP32, Raspberry Pi, and Pico through readily available libraries (DallasTemperature for Arduino-class boards, w1-therm on Raspberry Pi).

At a Glance

Sensor IC
Maxim DS18B20
Operating Voltage
3.0V - 5.5V
Range
-55 degC to +125 degC
Accuracy
+/-0.5 degC (-10 to +85 degC)
Protocol
1-Wire (single data line)
Probe
Waterproof, 1 m cable

Specifications

Parameter Value
Sensor IC Maxim Integrated DS18B20
Operating Voltage 3.0V - 5.5V DC
Operating Current 1 mA active, 1 uA standby
Temperature Range -55 degC to +125 degC
Accuracy +/-0.5 degC (from -10 to +85 degC)
Resolution 9-bit (0.5 degC) to 12-bit (0.0625 degC), user-configurable
Conversion Time (12-bit) ~750 ms
Protocol 1-Wire (Maxim/Dallas)
Pull-up Resistor 4.7k from data to VCC (required)
Unique ID 64-bit factory-burned, allows multiple sensors on one bus
Probe Material Stainless steel
Cable Length ~1 meter (PVC jacket)
Wires 3 (Red = VCC, Yellow = Data, Black = GND)

Pinout Diagram

DS18B20 waterproof temperature sensor probe pinout diagram showing the three wires: Red = VCC (3.3V or 5V), Yellow = Data (1-Wire), and Black = Ground

Wiring Guide

Arduino Wiring

The DS18B20 needs a 4.7k pull-up resistor between the Data line and VCC for the 1-Wire bus to work. Don't skip this — without it, you'll get garbage readings or no response at all.

Probe Wire Arduino Pin
Red (VCC) 5V
Black (GND) GND
Yellow (Data) Digital Pin 2
Required: Place a 4.7k resistor between the Yellow (Data) wire and the Red (VCC) wire. Without this pull-up, the sensor cannot communicate.
Tip: Install the OneWire and DallasTemperature libraries via the Arduino Library Manager. They handle the bus protocol so you only deal with degrees C / F.

ESP32 Wiring

Same 4.7k pull-up requirement. The DS18B20 is happy at 3.3V, so power the probe from the ESP32's 3V3 rail and pull-up to 3V3 as well.

Probe Wire ESP32 Pin
Red (VCC) 3V3
Black (GND) GND
Yellow (Data) GPIO 4 (with 4.7k pull-up to 3V3)
Required: 4.7k resistor between Data and 3V3 — same rule as Arduino.

Raspberry Pi Wiring

On the Pi, the 1-Wire driver is built into the Linux kernel. By default it uses GPIO 4 (Pin 7). Enable the 1-Wire interface in raspi-config > Interface Options.

Probe Wire Raspberry Pi Pin
Red (VCC) Pin 1 (3.3V)
Black (GND) Pin 6 (GND)
Yellow (Data) Pin 7 (GPIO 4) with 4.7k pull-up to 3.3V
Required: 4.7k pull-up between Data and 3.3V. Run sudo raspi-config > Interface Options > 1-Wire > Enable, then reboot.
Tip: Once enabled, your sensor appears as /sys/bus/w1/devices/28-XXXXXXXXXXXX/w1_slave. Read that file to get the temperature.

Raspberry Pi Pico Wiring

MicroPython for the Pico has built-in 1-Wire support via the onewire and ds18x20 modules. Pull-up still required.

Probe Wire Pico Pin
Red (VCC) 3V3 (OUT)
Black (GND) GND
Yellow (Data) GP15 (with 4.7k pull-up to 3V3)

Code Examples

Arduino - Read One Sensor

ds18b20_arduino.ino
// DS18B20 - Read temperature on Arduino
// Wire: Red=5V, Black=GND, Yellow=D2 with 4.7k pull-up to 5V
// Install libraries: OneWire, DallasTemperature

#include <OneWire.h>
#include <DallasTemperature.h>

const int ONE_WIRE_BUS = 2;
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

void setup() {
  Serial.begin(9600);
  sensors.begin();
}

void loop() {
  sensors.requestTemperatures();
  float c = sensors.getTempCByIndex(0);
  float f = c * 9.0 / 5.0 + 32.0;

  Serial.print("Temp: "); Serial.print(c, 2); Serial.print(" C  /  ");
  Serial.print(f, 2); Serial.println(" F");
  delay(1000);
}

Arduino - Multiple Sensors on Same Bus

ds18b20_multi.ino
// DS18B20 - Multiple probes sharing one data wire
// All sensors share Red, Black, Yellow; one 4.7k pull-up for the whole bus

#include <OneWire.h>
#include <DallasTemperature.h>

OneWire oneWire(2);
DallasTemperature sensors(&oneWire);

void setup() {
  Serial.begin(9600);
  sensors.begin();
  Serial.print("Found "); Serial.print(sensors.getDeviceCount()); Serial.println(" sensors");
}

void loop() {
  sensors.requestTemperatures();
  for (int i = 0; i < sensors.getDeviceCount(); i++) {
    Serial.print("Sensor "); Serial.print(i); Serial.print(": ");
    Serial.print(sensors.getTempCByIndex(i)); Serial.println(" C");
  }
  Serial.println("---");
  delay(2000);
}

Raspberry Pi (Python)

ds18b20_rpi.py
#!/usr/bin/env python3
# DS18B20 on Raspberry Pi via 1-Wire kernel driver
# Enable 1-Wire first: sudo raspi-config -> Interface Options -> 1-Wire

import glob, time

base = "/sys/bus/w1/devices/"
device = glob.glob(base + "28-*")[0] + "/w1_slave"

def read_temp():
    with open(device, "r") as f:
        lines = f.readlines()
    while not lines[0].strip().endswith("YES"):
        time.sleep(0.2)
        with open(device, "r") as f:
            lines = f.readlines()
    pos = lines[1].find("t=")
    if pos != -1:
        return float(lines[1][pos+2:]) / 1000.0
    return None

while True:
    c = read_temp()
    print("Temp: {:.2f} C  /  {:.2f} F".format(c, c * 9/5 + 32))
    time.sleep(1)

Raspberry Pi Pico - MicroPython

ds18b20_pico.py
# DS18B20 on Raspberry Pi Pico (MicroPython)
# Wire: Red=3V3, Black=GND, Yellow=GP15 with 4.7k pull-up to 3V3

from machine import Pin
import onewire, ds18x20, time

ow = onewire.OneWire(Pin(15))
ds = ds18x20.DS18X20(ow)

roms = ds.scan()
print("Found", len(roms), "DS18B20 sensors")

while True:
    ds.convert_temp()
    time.sleep_ms(750)
    for rom in roms:
        c = ds.read_temp(rom)
        print("{}: {:.2f} C".format(bytes(rom).hex(), c))
    time.sleep(1)

Frequently Asked Questions

Why do I need a pull-up resistor?
The 1-Wire bus is open-drain — devices pull the line LOW, but releasing it back to HIGH requires a pull-up resistor. 4.7k from Data to VCC is the standard value. Without it, the bus stays floating and communication fails.
Is it really waterproof?
The stainless-steel probe is sealed and rated for full immersion in water. The PVC-jacketed cable is splash-resistant but not designed for permanent submersion at the cable joint. For long-term underwater use, seal the cable entry with marine epoxy or heat-shrink tubing.
Can I really put multiple sensors on one wire?
Yes — that's the magic of 1-Wire. Each DS18B20 has a unique 64-bit factory ID. Connect their Yellow wires together (and red and black), use a single 4.7k pull-up for the whole bus, and your code can address each sensor by its ROM ID. You can run 5-10 sensors easily; even 20+ on short bus lengths.
Why does my reading say -127 degC?
That's the DallasTemperature library's "no sensor found" error code. Check (1) the pull-up resistor is in place, (2) all three wires are connected correctly, (3) the data pin in your code matches the GPIO you wired, and (4) the sensor isn't damaged.
How accurate is it really?
Datasheet spec is +/-0.5 degC over -10 to +85 degC. In practice, individual sensors are usually accurate to within a few tenths of a degree. For high-accuracy work, do a one-point or two-point calibration against a reference (e.g., ice water at 0 degC) and apply an offset in software.
How long can the cable be?
In normal mode, runs of 10-20 meters with the supplied 1-meter cable plus extension generally work fine. For longer runs (50+ meters), drop the bus speed and consider a stronger pull-up or a dedicated 1-Wire driver IC like the DS2480B.
Can I use it in parasite power mode?
Yes — connect Red (VCC) and Black (GND) together to GND, and the chip will draw power from the data line during bus idle periods. Saves a wire but reduces conversion speed and reliability. The standard 3-wire mode is recommended unless wiring is a constraint.