DS18S20 High-Precision 1-Wire Digital Thermometer: General Description Benefits and Features
DS18S20 High-Precision 1-Wire Digital Thermometer: General Description Benefits and Features
DS18S20 High-Precision 1-Wire Digital Thermometer: General Description Benefits and Features
General Description
Applications
Thermostatic Controls
Industrial Systems
Consumer Products
Thermometers
Thermally Sensitive Systems
Pin Configurations
TOP VIEW
DS18S20
1
N.C.
N.C.
VDD
N.C.
GND
GND
DS18S20
SO (150 mils)
(DS18S20Z)
GND
DQ VDD
2
BOTTOM VIEW
TO-92
(DS18S20)
N.C.
N.C.
DS18S20
These are stress ratings only and functional operation of the device at these or any other conditions above those indicated in the operation sections of this specification is not implied. Exposure
to absolute maximum rating conditions for extended periods of time may affect reliability.
DC Electrical Characteristics
(VDD = 3.0V to 5.5V, TA = -55C to +125C, unless otherwise noted.)
PARAMETER
SYMBOL
Supply Voltage
VDD
VPU
Thermometer Error
tERR
Input Logic-Low
VIL
Input Logic-High
VIH
Sink Current
IL
CONDITIONS
Local Power (Note 1)
Parasite Power
Local Power
-10C to +85C
-55C to +125C
(Note 1, 2)
Parasite Power
VI/O = 0.4V (Note 1)
MIN
TYP
UNITS
+5.5
+3.0
+5.5
+3.0
VDD
0.5
(Note 3)
(Note 1, 4, 5)
Local Power
MAX
+3.0
(Note 1, 6)
V
C
-0.3
+0.8
+2.2
The lower of
5.5 or VDD
+ 0.3
+3.0
4.0
mA
Standby Current
IDDS
(Note 7, 8)
Active Current
IDD
VDD = 5V (Note 9)
DQ Input Current
IDQ
(Note 10)
(Note 11)
0.2
Drift
750
1000
nA
1.5
mA
www.maximintegrated.com
Maxim Integrated 2
DS18S20
0.4
0.3
+3s ERROR
0.2
0.1
0
-0.1
-3s ERROR
-0.2
-0.3
MEAN ERROR
-0.4
-0.5
10
20
30
40
50
60
70
TEMPERATURE (C)
SYMBOL
CONDITIONS
MIN
tWR
TYP
MAX
UNITS
10
ms
NEEWR
-55C to +55C
50k
writes
tEEDR
-55C to +55C
10
years
AC Electrical Characteristics
(VDD = 3.0V to 5.5V; TA = -55C to +125C, unless otherwise noted.)
PARAMETER
SYMBOL
CONDITIONS
tCONV
(Note 12)
tSPON
Time Slot
tSLOT
(Note 12)
Recovery Time
MIN
60
TYP
MAX
UNITS
750
ms
10
120
tREC
(Note 12)
tLOW0
(Note 12)
60
120
tLOW1
(Note 12)
15
tRDV
(Note 12)
15
tRSTH
(Note 12)
480
tRSTL
480
Presence-Detect High
tPDHIGH
(Note 12)
15
60
s
s
Presence-Detect Low
tPDLOW
(Note 12)
60
240
Capacitance
CIN/OUT
25
pF
www.maximintegrated.com
Maxim Integrated 3
DS18S20
tREC
tREC
tRDV
1-Wire RESET PULSE
RESET PULSE FROM HOST
tRSTL
tRSTH
PRESENCE DETECT
tPDHIGH
tPDLOW
Pin Description
PIN
NAME
FUNCTION
TO-92
SO
GND
DQ
Data Input/Output. Open-drain 1-Wire interface pin. Also provides power to the
device when used in parasite power mode (see the Powering the DS18S20 section.)
VDD
Optional VDD. VDD must be grounded for operation in parasite power mode.
1, 2, 6, 7, 8
N.C.
No Connection
www.maximintegrated.com
Ground
Maxim Integrated 4
DS18S20
Overview
OperationMeasuring Temperature
The core functionality of the DS18S20 is its direct-to-digital temperature sensor. The temperature sensor output
has 9-bit resolution, which corresponds to 0.5C steps.
The DS18S20 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 DS18S20 returns to its idle state.
If the DS18S20 is powered by an external supply, the
master can issue read-time slots (see the 1-Wire Bus
System section) after the Convert T command and the
DS18S20 will respond by transmitting 0 while the temperature conversion is in progress and 1 when the conversion is done. If the DS18S20 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
DS18S20 section.
VPU
4.7k
MEMORY
CONTROL LOGIC
DS18S20
TEMPERATURE
SENSOR
GND
INTERNAL VDD
CPP
64-BIT ROM
AND
1-Wire PORT
VDD
8-BIT CRC
GENERATOR
www.maximintegrated.com
Maxim Integrated 5
DS18S20
OperationAlarm Signaling
The DS18S20 output data is calibrated in degrees centigrade; for Fahrenheit applications, a lookup table or
conversion routine must be used. The temperature data is
stored as a 16-bit sign-extended twos complement number in the temperature register (see Figure 4). The sign
bits (S) indicate if the temperature is positive or negative:
for positive numbers S = 0 and for negative numbers S =
1. Table 1 gives examples of digital output data and the
corresponding temperature reading.
TEMPERATURE
= TEMP_READ 0.25
COUNT_PER_C COUNT_REMAIN
+
COUNT_PER_C
BIT 7
BIT 6
BIT 5
BIT 4
BIT 3
BIT 2
BIT 1
BIT 0
26
25
24
23
22
21
20
2-1
BIT 15
BIT 14
BIT 13
BIT 12
BIT 11
BIT 10
BIT 9
BIT 8
LS BYTE
MS BYTE
S = SIGN
BIT 7
BIT 6
BIT 5
BIT 4
BIT 3
BIT 2
BIT 1
BIT 0
26
25
25
25
22
21
20
+85.0*
00AAh
+25.0
0032h
+0.5
0001h
0000h
-0.5
FFFFh
-25.0
FFCEh
-55.0
FF92h
Maxim Integrated 6
DS18S20
VPU
DS18S20
VPU
GND
DQ
DS18S20
VPU
VDD
GND
DQ
VDD
(EXTERNAL SUPPLY)
VDD
P
4.7k
4.7k
1-Wire BUS
TO OTHER
1-Wire DEVICES
www.maximintegrated.com
1-Wire BUS
TO OTHER
1-Wire DEVICES
Maxim Integrated 7
DS18S20
Memory
8-BIT CRC
MSB
LSB
MSB
MSB
LSB
SCRATCHPAD
(POWER-UP STATE)
BYTE 0
BYTE 1
BYTE 2
BYTE 3
BYTE 4
RESERVED (FFh)
BYTE 5
RESERVED (FFh)
BYTE 6
BYTE 7
BYTE 8
CRC*
(85C)
EEPROM
www.maximintegrated.com
Maxim Integrated 8
DS18S20
CRC Generation
The 1-Wire bus system uses a single bus master to control one or more slave devices. The DS18S20 is always a
slave. When there is only one slave on the bus, the system is referred to as a single-drop system; the system is
multidrop if there are multiple slaves on the bus.
All data and commands are transmitted least significant
bit first over the 1-Wire bus.
The following discussion of the 1-Wire bus system is
broken down into three topics: hardware configuration,
transaction sequence, and 1-Wire signaling (signal types
and timing).
INPUT
XOR
(MSB)
XOR
XOR
(LSB)
www.maximintegrated.com
Maxim Integrated 9
DS18S20
Hardware Configuration
Transaction Sequence
DS18S20
1-Wire PORT
4.7k
Rx
1-Wire BUS DQ
5A
TYP
Tx
Rx
Tx
100
MOSFET
Rx = RECEIVE
Tx = TRANSMIT
Initialization
All transactions on the 1-Wire bus begin with an initialization sequence. The initialization sequence consists of a
reset pulse transmitted by the bus master followed by
presence pulse(s) transmitted by the slave(s). The presence pulse lets the bus master know that slave devices
(such as the DS18S20) are on the bus and are ready
to operate. Timing for the reset and presence pulses is
detailed in the 1-Wire Signaling section.
ROM Commands
www.maximintegrated.com
Maxim Integrated 10
DS18S20
Note that the Read Scratchpad [BEh] command can follow the Skip ROM command only if there is a single slave
device on the bus. In this case, time is saved by allowing
the master to read from the slave without sending the
devices 64-bit ROM code. A Skip ROM command followed
by a Read Scratchpad command will cause a data collision
on the bus if there is more than one slave since multiple
devices will attempt to transmit data simultaneously.
DESCRIPTION
PROTOCOL
NOTES
BEh
4Eh
Copy Scratchpad
48h
None
Recall E2
B8h
Read Power
Supply
B4h
Convert T
Initiates temperature
conversion.
Read Scratchpad
Write Scratchpad
44h
MEMORY COMMANDS
Note 1: For parasite-powered DS18S20s, the master must enable a strong pullup on the 1-Wire bus during temperature conversions and copies from the scratchpad to EEPROM. No other bus activity may take place during this time.
Note 2: The master can interrupt the transmission of data at any time by issuing a reset.
Note 3: Both bytes must be written before a reset is issued.
www.maximintegrated.com
Maxim Integrated 11
DS18S20
Convert T [44h]
www.maximintegrated.com
Recall E2 [B8h]
1-Wire Signaling
The DS18S20 uses a strict 1-Wire communication protocol to ensure data integrity. Several signal types are
defined by this protocol: reset pulse, presence pulse,
write 0, write 1, read 0, and read 1. All these signals, with
the exception of the presence pulse, are initiated by the
bus master.
Maxim Integrated 12
DS18S20
All communication with the DS18S20 begins with an initialization sequence that consists of a reset pulse from the
master followed by a presence pulse from the DS18S20.
This is illustrated in Figure 12. When the DS18S20 sends
the presence pulse in response to the reset, it is indicating
to the master that it is on the bus and ready to operate.
During the initialization sequence the bus master transmits (Tx) the reset pulse by pulling the 1-Wire bus low
for a minimum of 480s. The bus master then releases
the bus and goes into receive mode (Rx). When the bus
is released, the 5k pullup resistor pulls the 1-Wire bus
high. When the DS18S20 detects this rising edge, it waits
15s to 60s and then transmits a presence pulse by pulling the 1-Wire bus low for 60s to 240s.
There are two types of write time slots: Write 1 time slots
and Write 0 time slots. The bus master uses a Write 1
time slot to write a logic 1 to the DS18S20 and a Write
0 time slot to write a logic 0 to the DS18S20. All write
time slots must be a minimum of 60s in duration with a
minimum of a 1s recovery time between individual write
slots. Both types of write time slots are initiated by the
master pulling the 1-Wire bus low (see Figure 13).
To generate a Write 1 time slot, after pulling the 1-Wire
bus low, the bus master must release the 1-Wire bus
within 15s. When the bus is released, the 5k pullup
resistor will pull the bus high. To generate a Write 0 time
slot, after pulling the 1-Wire bus low, the bus master must
continue to hold the bus low for the duration of the time
slot (at least 60s). The DS18S20 samples the 1-Wire
bus during a window that lasts from 15s to 60s after the
master initiates the write time slot. If the bus is high during
the sampling window, a 1 is written to the DS18S20. If the
line is low, a 0 is written to the DS18S20.
MASTER Rx
480s MINIMUM
VPU
DS18S20 Tx
PRESENCE PULSE
60-240s
DS18S20
WAITS 15-60s
1-Wire BUS
GND
LINE TYPE LEGEND
BUS MASTER PULLING LOW
DS18S20 PULLING LOW
RESISTOR PULLUP
www.maximintegrated.com
Maxim Integrated 13
DS18S20
START
OF SLOT
START
OF SLOT
MASTER WRITE 0 SLOT
> 1s
VPU
1-Wire BUS
GND
DS18S20 SAMPLES
TYP
MIN
15S
15S
DS18S20 SAMPLES
MIN
MAX
30S
15S
TYP
MAX
15S
30S
VPU
1-Wire BUS
GND
MASTER SAMPLES
> 1s
MASTER SAMPLES
> 1s
45s
15s
15s
www.maximintegrated.com
Maxim Integrated 14
DS18S20
Read-Time Slots
VPU
VIH OF MASTER
1-Wire BUS
GND
TINT > 1s
TRC
MASTER SAMPLES
15s
VPU
VIH OF MASTER
1-Wire BUS
GND
MASTER SAMPLES
TINT = TRC =
SMALL SMALL
15s
www.maximintegrated.com
Maxim Integrated 15
DS18S20
55h
MATCH ROM
COMMAND
F0h
SEARCH ROM
COMMAND
MASTER Tx
BIT 0
DS18S20 Tx
FAMILY CODE
1 BYTE
DS18S20 Tx
SERIAL NUMBER
6 BYTES
DS18S20 Tx
CRC BYTE
BIT 0
MATCH?
CCh
SKIP ROM
COMMAND
DS18S20 Tx BIT 0
DS18S20 Tx BIT 0
DS18S20 Tx BIT 0
MASTER Tx BIT 0
MASTER Tx BIT 0
BIT 0
MATCH?
DEVICE(S)
WITH ALARM
FLAG SET?
DS18S20 Tx BIT 1
MASTER Tx
BIT 1
BIT 1
MATCH?
ECh
ALARM SEARCH
COMMAND
DS18S20 Tx BIT 0
DS18S20 Tx BIT 1
MASTER Tx BIT 1
BIT 1
MATCH?
Y
DS18S20 T BIT 63
MASTER Tx
BIT 63
BIT 63
MATCH?
Y
DS18S20 Tx BIT 63
MASTER Tx BIT 63
BIT 63
MATCH?
Y
MASTER Tx FUNCTION
COMMAND (FIGURE 17)
www.maximintegrated.com
Maxim Integrated 16
DS18S20
44h
CONVERT
TEMPERATURE
?
MASTER Tx
FUNCTION
COMMAND
48h
COPY
SCRATCHPAD
?
PARASITE
POWER
?
DS18S20 BEGINS
CONVERSION
MASTER ENABLES
STRONG PULL- UP ON DQ
COPY IN
PROGRESS
?
B8h
RECALL E2
?
MASTER DISABLES
STRONG PULLUP
MASTER
Rx 1s
BEh
READ
SCRATCH PAD
?
PARASITE
POWERED
?
MASTER
Rx 0s
MASTER
Rx 1s
B4h READ
POWER SUPPLY
?
MASTER DISABLES
STRONG PULLUP
MASTER
Rx 0s
PARASITE
POWER
?
DS18S20 CONVERTS
TEMPERATURE
MASTER ENABLES
STRONG PULLUP ON DQ
DEVICE
CONVERTING
TEMPERATURE
?
Y
MASTER Tx TH BYTE
TO SCRATCHPAD
4Eh
WRITE
SCRATCHPAD
?
MASTER Tx TL BYTE
TO SCRATCHPAD
MASTER
Rx 1s
MASTER
Tx RESET
?
MASTER
Rx 0s
DEVICE
BUSY RECALLING
DATA
?
N
N
MASTER
Rx 0s
MASTER
Rx 1s
HAVE 8 BYTES
BEEN READ
?
Y
MASTER Rx SCRATCHPAD
CRC BYTE
www.maximintegrated.com
Maxim Integrated 17
DS18S20
In this example there are multiple DS18S20s on the bus and they are using parasite power. The bus master initiates a
temperature conversion in a specific DS18S20 and then reads its scratchpad and recalculates the CRC to verify the data.
MASTER MODE
Tx
Reset
Rx
Presence
Tx
55h
Tx
Tx
44h
Tx
Tx
Reset
Rx
Presence
Tx
55h
Tx
Tx
BEh
Rx
9 data bytes
COMMENTS
Master issues reset pulse.
DS18S20s respond with presence pulse.
Master issues Match ROM command.
In this example there is only one DS18S20 on the bus and it is using parasite power. The master writes to the TH and
TL registers in the DS18S20 scratchpad and then reads the scratchpad and recalculates the CRC to verify the data. The
master then copies the scratchpad contents to EEPROM.
MASTER MODE
Tx
Reset
COMMENTS
Rx
Presence
Tx
CCh
Tx
4Eh
Tx
2 data bytes
Tx
Reset
Rx
Presence
Tx
CCh
Tx
BEh
Rx
9 data bytes
Tx
Reset
Rx
Presence
Tx
CCh
Tx
48h
Tx
www.maximintegrated.com
DS18S20
In this example there is only one DS18S20 on the bus and it is using parasite power. The bus master initiates a temperature conversion then reads the DS18S20 scratchpad and calculates a higher resolution result using the data from the
temperature, COUNT REMAIN and COUNT PER C registers.
MASTER MODE
Tx
Reset
Tx
Presence
Tx
CCh
Tx
44h
Tx
Tx
Reset
Rx
Presence
Tx
CCh
Tx
BEh
Rx
9 data bytes
Tx
Reset
Rx
Presence
www.maximintegrated.com
COMMENTS
Master issues reset pulse.
DS18S20 responds with presence pulse.
Master applies strong pullup to DQ for the duration of the conversion (tCONV).
Master issues reset pulse.
DS18S20 responds with presence pulse.
Master reads entire scratchpad including CRC. The master then recalculates
the CRC of the first eight data bytes from the scratchpad and compares
the calculated CRC with the read CRC (byte 9). If they match, the master
continues; if not, the read operation is repeated. The master also calculates
the TEMP_READ value and stores the contents of the COUNT REMAIN and
Count Per C registers.
Master issues reset pulse.
DS18S20 responds with presence pulse.
CPU calculates extended resolution temperature using the equation in
the OperationMeasuring Temperature section.
Maxim Integrated 19
DS18S20
Ordering Information
PART
TEMP RANGE
Package Information
PIN-PACKAGE
DS18S20
DS18S20+
DS18S20/T&R
DS18S20+T&R
55C to +125C 8 SO
DS18S20Z+
55C to +125C 8 SO
DS18S20Z/T&R
DS18S20Z+T&R
PACKAGE
CODE
OUTLINE
NO.
LAND
PATTERN NO.
8 SO
S8-2
21-0041
90-0096
3 TO-92
(straight leads)
Q3-1
21-0248
3 TO-92
(formed leads)
Q3-4
21-0250
www.maximintegrated.com
Maxim Integrated 20
DS18S20
Revision History
REVISION
NUMBER
REVISION
DATE
DESCRIPTION
PAGES
CHANGED
4/08
8/10
Removed the Top Mark column from the Ordering Information table; added the
continuous power dissipation and lead and soldering temperatures to the Absolute
Maximum Ratings section
2, 20
1/15
For pricing, delivery, and ordering information, please contact Maxim Direct at 1-888-629-4642, or visit Maxim Integrateds website at www.maximintegrated.com.
Maxim Integrated cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a Maxim Integrated product. No circuit patent licenses
are implied. Maxim Integrated reserves the right to change the circuitry and specifications without notice at any time. The parametric values (min and max limits)
shown in the Electrical Characteristics table are guaranteed. Other parametric values quoted in this data sheet are provided for guidance.
Maxim Integrated and the Maxim Integrated logo are trademarks of Maxim Integrated Products, Inc.