Overview
Figure 3 shows a block diagram of the DS18B20, and
pin descriptions are given in the Pin Description table.
The 64-bit ROM stores the device’s unique serial code.
The scratchpad memory contains the 2-byte temperature
register that stores the digital output from the temperature
sensor. In addition, the scratchpad provides access to the
1-byte upper and lower alarm trigger registers (T
H
and
T
L
) and the 1-byte configuration register. The configura-
tion register allows the user to set the resolution of the
temperature-to-digital conversion to 9, 10, 11, or 12 bits.
The T
H
, T
L
, and configuration registers are nonvolatile
(EEPROM), so they will retain data when the device is
powered down.
The DS18B20 uses Maxim’s exclusive 1-Wire bus proto-
col that implements bus communication using one control
signal. The control line requires a weak pullup resistor
since all devices are linked to the bus via a 3-state or
open-drain port (the DQ pin in the case of the DS18B20).
In this bus system, the microprocessor (the master
device) identifies and addresses devices on the bus
using each device’s unique 64-bit code. Because each
device has a unique code, the number of devices that
can be addressed on one bus is virtually unlimited. The
1-Wire bus protocol, including detailed explanations of the
commands and “time slots,” is covered in the 1-Wire Bus
System section.
Another feature of the DS18B20 is the ability to oper-
ate without an external power supply. Power is instead
supplied through the 1-Wire pullup resistor through the
DQ pin when the bus is high. The high bus signal also
charges an internal capacitor (C
PP
), which then supplies
power to the device when the bus is low. This method of
deriving power from the 1-Wire bus is referred to as “para-
site power.” As an alternative, the DS18B20 may also be
powered by an external supply on V
DD
.
Operation—Measuring Temperature
The core functionality of the DS18B20 is its direct-to-
digital temperature sensor. The resolution of the tempera-
ture sensor is user-configurable to 9, 10, 11, or 12 bits,
corresponding to increments of 0.5°C, 0.25°C, 0.125°C,
and 0.0625°C, respectively. The default resolution at
power-up is 12-bit. The DS18B20 powers up in a low-
power idle state. To initiate a temperature measurement
and A-to-D conversion, the master must issue a Convert
T [44h] command. Following the conversion, the resulting
thermal data is stored in the 2-byte temperature register
in the scratchpad memory and the DS18B20 returns to its
idle state. If the DS18B20 is powered by an external sup-
ply, the master can issue “read time slots” (see the 1-Wire
Bus System section) after the Convert T command and
the DS18B20 will respond by transmitting 0 while the tem-
perature conversion is in progress and 1 when the con-
version is done. If the DS18B20 is powered with parasite
power, this notification technique cannot be used since
the bus must be pulled high by a strong pullup during the
entire temperature conversion. The bus requirements for
parasite power are explained in detail in the Powering the
DS18B20 section.
Figure 3. DS18B20 Block Diagram
TEMPERATURE
SENSOR
SCRATCHPAD
MEMORY
CONTROL LOGIC
64-BIT ROM
AND 1-Wire
PORT
PARASITE POWER CIRCUIT
POWER-
SUPPLY SENSE
INTERNAL V
DD
GND
DQ
V
PU
4.7kΩ
CONFIGURATION
REGISTER (EEPROM)
8-BIT CRC
GENERATOR
V
DD
C
PP
DS18B
20
ALARM LOW TRIGGER (T
L
)
REGISTER (EEPROM)
ALARM HIGH TRIGGER (T
H
)
REGISTER (EEPROM)
DS18B20 Programmable Resolution
1-Wire Digital Thermometer
www.maximintegrated.com
Maxim Integrated
│
5