Skip to Content
Circuitera

DS18B20 digital thermometer

Read the TO-92 pinout, supply options and conversion timing for a DS18B20, including what changes when several sensors share one wire.

DS18B20 digital thermometer photograph
SparkFun DS18B20 2.jpg by SparkFun Electronics · CC BY 2.0. Resized and encoded as WebP without cropping.

How it works

Each sensor has a unique 64-bit ROM code. Several thermometers can share the same data line, and software uses those codes to choose which sensor to read.

Source: Analog Devices

Pinout and wiring

For the TO-92 package, the documented pins are 1 GND, 2 DQ and 3 VDD. Use the datasheet drawing to determine viewing orientation. In a simple externally powered bus, connect DQ to the controller and use the bus pull-up shown in the datasheet.

Source: Analog Devices

Reading conversions

Higher resolution takes longer, up to 750 ms for a 12-bit conversion. Wait for conversion to finish before reading. Parasite power has additional pull-up requirements, so separate VDD is an easier first wiring approach.

Source: Analog Devices

Specifications

ParameterValue or conditionSource
External supply3.0–5.5 VAnalog Devices
Temperature range−55 to +125 °CAnalog Devices
Resolution9–12 programmable bitsAnalog Devices

Compatibility and practice

3.0–5.5 V externally powered device; match the pull-up to the bus logic.

Sources and datasheets