DS18B20¶
Maxim/ADI's Dallas 1-Wire digital temperature sensor. ±0.5 °C accuracy over -10 to 85 °C. Each chip has a unique 64-bit ID — you can hang many sensors on one wire. Waterproof probe and TO-92 bare versions are common.
In stock
Analog Devices
Specs¶
| Spec | Value |
|---|---|
| Temp range | -55 to +125 °C |
| Accuracy | ±0.5 °C (-10 to +85 °C) |
| Resolution | 9 / 10 / 11 / 12-bit (configurable) |
| Conversion time | 750 ms @ 12-bit |
| Bus | 1-Wire (Dallas) |
| Power | 3.0–5.5 V or parasite mode |
| Pinout (TO-92, flat side facing) | GND, DQ, VDD |
Wiring (Arduino Uno, one sensor)¶
| DS18B20 | Arduino |
|---|---|
| GND | GND |
| DQ | D2 |
| VDD | 5 V |
| Pull-up | 4.7 kΩ between DQ and VDD |
Waterproof probe colors:
| Wire | DS18B20 pin |
|---|---|
| Red | VDD |
| Yellow / White | DQ |
| Black / Blue | GND |
Code¶
#include <OneWire.h>
#include <DallasTemperature.h>
OneWire bus(2);
DallasTemperature sensors(&bus);
void setup() {
Serial.begin(9600);
sensors.begin();
}
void loop() {
sensors.requestTemperatures();
Serial.print(sensors.getTempCByIndex(0)); Serial.println(" °C");
delay(1000);
}
Libraries: OneWire + DallasTemperature (Library Manager).
Schematic¶
Internal block diagram and application circuit on page 1 + page 19 of the datasheet PDF.
Last updated: 2026-05-13 · Source on GitHub