Waterproof DS18B20
Waterproof stainless steel probe housing a Maxim DS18B20 digital thermometer that reports temperature from -55 to +125 °C over a single 1-Wire data line.
- Supply3.0 V to 5.5 V, or parasite power from DATA
- Range-55 °C to +125 °C
- Accuracy±0.5 °C from -10 °C to +85 °C, ±2 °C from -55 °C to +125 °C
- Resolution9 to 12 bits (0.5 to 0.0625 °C), 12 bits at power-up

The waterproof DS18B20 is a sealed stainless-steel probe around Maxim's DS18B20 1-Wire thermometer, which runs from 3.0 V to 5.5 V and measures -55 to +125 °C, accurate to ±0.5 °C from -10 to +85 °C (Maxim DS18B20 datasheet, p. 1). Connect red to VCC, black or blue to GND and yellow or white to any digital pin, with a 4.7 kΩ pull-up from DATA to VCC (p. 6). Every probe has a unique 64-bit code, so several can share one pin, and a 12-bit reading takes up to 750 ms (pp. 1, 3).
The Waterproof DS18B20 is a sealed temperature probe built around the Maxim/Analog Devices DS18B20 1-Wire digital thermometer. The sensor die sits inside a stainless steel tube on a flexible lead, so it can be dropped directly into liquids, soil, or outdoor enclosures. It measures from -55 to +125 °C and is accurate to ±0.5 °C across the -10 to +85 °C range (Maxim datasheet, p. 1); the cable and seal of a given probe may limit how hot it can actually go.
Communication uses the 1-Wire protocol on the single DATA (DQ) line. Resolution is programmable at 9, 10, 11, or 12 bits; it powers up at 12 bits, which resolves 0.0625 °C and takes up to 750 ms per conversion (pp. 1, 3). Every DS18B20 carries a unique factory-programmed 64-bit ROM address, so many probes can share one data pin and be read individually by address.
The three flying leads are typically red (3 V to 5 V power), blue or black (ground), and yellow or white (DATA). The device can also run in parasite-power mode, drawing its energy from the data line, though a normal three-wire hookup is more forgiving. On-chip TH and TL alarm registers can flag out-of-range readings without host polling.
Waterproof DS18B20 pinout
| Pin | Function | Type |
|---|---|---|
| VCC | Red: 3-5V3.3 V (max 5.5 V) | power in |
| GND | Black: GND | power in |
| DATA | 1-Wire | bidirectional |
How to wire the Waterproof DS18B20
Pin by pin, for the board you have.
| Waterproof DS18B20 | Arduino Uno | Note |
|---|---|---|
| VCC | 5V | |
| GND | GND | |
| DATA | D2 | with a 4.7 kΩ pull-up resistor from DATA to VCC |
| Waterproof DS18B20 | ESP32 DevKit V1 | Note |
|---|---|---|
| VCC | 3V3 | |
| GND | GND | |
| DATA | GPIO13 (D13) | with a 4.7 kΩ pull-up resistor from DATA to VCC |
| Waterproof DS18B20 | Raspberry Pi Pico | Note |
|---|---|---|
| VCC | 3V3 | |
| GND | GND | |
| DATA | GP0 | with a 4.7 kΩ pull-up resistor from DATA to VCC |
Waterproof DS18B20 code
Every example here compiles for its board.
// Waterproof DS18B20 on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/ds18b20-waterproof
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2 // DATA on D2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
void setup() {
Serial.begin(9600);
sensors.begin();
}
void loop() {
sensors.requestTemperatures();
Serial.print(sensors.getTempCByIndex(0));
Serial.println(" C");
delay(1000);
}
Compiled for arduino:avr:uno on 2026-10-30Before you wire it
- 1-Wire bus: connect DATA to any digital pin
- Power from 3.3-5V (probe works across the range); share GND with the MCU
- A 4.7k pull-up resistor on DATA is required: without it the bus floats and the sensor is never found. Wire it between DATA and VCC: one resistor pin on the DATA net, the other on the VCC net (the server assigns holes automatically).
- Multiple DS18B20 can share one DATA line (each has a unique 64-bit ROM); the library enumerates them with a ROM search.
- On ESP32: DATA to any GPIO; power VCC from 3V3 and tie the 4.7k pull-up to 3V3 (not 5V, ESP32 GPIOs are 3.3V).
- No omitting the 4.7k DATA pull-up
- No wiring the pull-up to GND: it pulls UP, to VCC
- No expecting analog/analogRead: DS18B20 is digital 1-Wire only
- Supply the red lead with 3.0 V to 5.5 V and tie the blue/black lead to ground.
- The yellow/white DATA (DQ) line requires a 4.7 kΩ pull-up resistor to VCC (Maxim datasheet, p. 6); the bus will not communicate without it.
- DATA is open drain and idles at the pull-up's voltage, so on a 3.3 V board such as an ESP32 power the probe from 3.3 V and tie the pull-up to 3.3 V; on an Uno use 5 V.
- Multiple probes can share one DATA pin because each has a unique 64-bit ROM address; a single 4.7 kΩ pull-up serves the whole bus.
- A 12-bit conversion can take up to 750 ms, so wait for the conversion to finish before reading the result.
- Parasite-power mode (DATA and GND only) is possible but the master must switch in a strong pull-up within 10 µs of each conversion command and hold it for the whole conversion (Maxim datasheet, p. 5); Maxim does not recommend parasite power above +100 °C. A dedicated VCC connection is more reliable, especially with several probes.
Specifications
- Supply
- 3.0 V to 5.5 V, or parasite power from DATAMaxim DS18B20 datasheet (rev 042208), p. 1
- Range
- -55 °C to +125 °CMaxim DS18B20 datasheet (rev 042208), p. 1
- Accuracy
- ±0.5 °C from -10 °C to +85 °C, ±2 °C from -55 °C to +125 °CMaxim DS18B20 datasheet (rev 042208), pp. 1, 19
- Resolution
- 9 to 12 bits (0.5 to 0.0625 °C), 12 bits at power-upMaxim DS18B20 datasheet (rev 042208), p. 3
- Conversion time
- 750 ms max at 12 bitsMaxim DS18B20 datasheet (rev 042208), p. 1
- Current
- 1 to 1.5 mA converting, 750 nA typical standbyMaxim DS18B20 datasheet (rev 042208), p. 19
- Pull-up
- 4.7 kΩ from DQ to VDDMaxim DS18B20 datasheet (rev 042208), p. 6
- Addressing
- Unique 64-bit ROM code per sensorMaxim DS18B20 datasheet (rev 042208), p. 1
- Power-on temperature register
- +85 °CMaxim DS18B20 datasheet (rev 042208), p. 4
- Supply voltage
- 3.3 V
- Maximum supply voltage
- 5.5 V
- Interface
- 1-Wire
- Dimensions
- 78 × 68 × 14 mm
- Weight
- 18 g
From the Adafruit / Maxim Integrated's datasheet, published by Adafruit / Maxim Integrated.
Common mistakes
Omitting the 4.7 kΩ pull-up
The 1-Wire bus is open drain and idles high through an external resistor. Without a 4.7 kΩ pull-up from DATA to VCC the sensor is never found, and the DallasTemperature library reports -127 °C, its value for a disconnected device, which looks like a dead sensor.
Reading before the conversion completes
A 12-bit conversion needs up to 750 ms. Reading the scratchpad before the first conversion finishes returns +85 °C, the register's power-on value (Maxim datasheet, p. 4). Either wait the full conversion time or poll the bus until the device signals it is done.
Confusing the wire colors
Cable coloring is not universal. Many probes use blue for ground, but some batches use black for ground and reserve another color for DATA. Verify against the probe's own labeling before wiring, since swapping GND and DATA prevents communication.
Assuming parasite power just works
Parasite power omits the VCC wire but demands a strong pull-up that clamps the bus high throughout every conversion. With long cables or multiple probes it becomes unreliable. Use the normal three-wire connection unless pins are truly scarce.
Hardcoding a single device on a shared bus
Because each probe has its own 64-bit ROM address, code that assumes one sensor breaks when a second is added. Enumerate the addresses on the bus and target each device explicitly instead of relying on a skip-ROM broadcast.
Waterproof DS18B20 questions
Why does my DS18B20 read -127 °C?
-127 °C is the DallasTemperature library's code for a sensor it cannot reach. Check the 4.7 kΩ pull-up from DATA to VCC (Maxim datasheet, p. 6), that DATA goes to the pin your sketch names, and that the ground and data leads are not swapped.
Why does my DS18B20 read 85 °C?
+85 °C is the temperature register's power-on value (Maxim datasheet, p. 4). You are reading before a conversion has finished, often because the supply dipped and reset the sensor; give a 12-bit conversion its full 750 ms (p. 1) and check the power wiring.
Can I use the DS18B20 with an ESP32 or 3.3 V board?
Yes. The DS18B20 runs from 3.0 V to 5.5 V (Maxim datasheet, p. 1), so power the probe from 3.3 V and tie the 4.7 kΩ pull-up to 3.3 V; DATA then never rises above the ESP32's 3.3 V.
Do I need a resistor for the DS18B20?
Yes, one 4.7 kΩ pull-up from DATA to VCC (Maxim datasheet, p. 6). One resistor serves the whole bus, however many probes share the pin.
How many DS18B20 sensors can I put on one pin?
Several, because each carries a unique 64-bit serial code that the master uses to address it (Maxim datasheet, p. 1). Use the library's address search to list them and read each one by address.
How accurate is the DS18B20?
±0.5 °C from -10 to +85 °C and ±2 °C across the full -55 to +125 °C range (Maxim datasheet, p. 19), with up to 12-bit resolution, or 0.0625 °C steps (p. 3).
Build something with the Waterproof DS18B20
- Build this
Sous vide and water bath controller
The waterproof tip sits in the bath while the DS18B20 holds a set temperature, driving a heater relay from the reading.
- Build this
Aquarium and fish tank monitor
Submerge the sealed probe to log tank temperature and trigger alerts when it drifts outside a safe band.
- Build this
Soil and ground temperature logger
Bury the stainless probe to record root-zone or ground temperature for gardening, composting, or greenhouse control.
- Build this
Fermentation and brewing tracker
Clamp the probe to a fermenter or mash tun to watch temperature through the process and keep it in range.
- Build this
Multi-zone temperature network
Chain several probes on one data pin, each addressed by its unique ROM code, to map temperatures across rooms or equipment.
This page as plain Markdown, for ChatGPT, Claude or your own agent. /components/ds18b20-waterproof.md