DS18B20
5 of 22
The mast er dev ic e can check t he a larm flag status of all DS18B20 s on t he bus by issuing an Alarm Searc h
[ECh] co mmand. Any DS18B20s with a set alarm flag will respond to the command, so the master ca n
determine exactly which DS18B20s have experienced an alarm condition. If an alarm condition exists
and the TH or TL settings have changed, another temperature conversion should be done to validate the
alarm condition .
POWERING THE DS18B20
The DS18B20 can be powered by an external supp ly on the VDD pin, or it can oper ate in “paras ite power”
mode, which allows the DS18B20 to function without a local external supply. Parasite power is very
useful for applications that require remote temperature sensing or that are very space constrained.
Figure 1 shows the DS18B20’s parasite-power control circuitry, which “steals” power from the 1-Wire
bus via the DQ p in when t he bus is hig h. The stolen charge powers the DS18B20 while the bus is high,
and so me o f t he c har ge is stored o n t he par asit e po wer capacitor (CPP) to provide power whe n t he bus is
low. When t he DS18B20 is us ed in parasit e p ower mode, the VDD pin must be connect ed to ground.
In parasit e power mode, the 1-Wire bus a nd CPP c an pro vide sufficient current to t he DS18B20 for most
operations as long as the specified timing and voltage requirements are met (see the DC Electrical
Characteristics and AC Electrical Characteristics). However, when the DS18B20 is performing
t emper at ure convers ions o r copying data fro m the scrat chpad me mo r y to EEP ROM, the o perating cur rent
can be as high as 1.5mA. This current can cause an unacceptable voltage drop across the weak 1-Wire
pullup resistor and is mo re curr ent than can be sup plied by C PP. T o assure that t he DS18B20 has suf ficie nt
supply current, it is necessary to provide a strong pullup on the 1-Wire bus whenever temperature
conversions are taking place or data is being copied from the scratchpad to EEPROM. This can be
accomplished by using a MOSFET to pull the bus directly to the rail as shown in Figure 4. The 1-Wire
bus mu st be sw it c hed to the strong pullup w it hin 1 0µs (max) aft er a Convert T [44h] or Co py Scratchpa d
[48h] command is issued, and the bus must be he ld high by the pu llup for t he durat ion of the conversion
(tCONV) or data transfer (t WR = 10ms). No other activ ity ca n t ake place on t he 1-Wire bus while t he pullup
is enabled.
The DS18B20 can also be powered by the co nvent ional method o f connect ing an externa l power supp ly
to the VDD pin, as shown in Figure 5. The advantage of this method is that the MOSFET pullup is not
requir ed , and t he 1-Wire bus is free t o car r y other traffic during the temperat ur e convers io n t ime.
The use of parasite power is not recommended for temperatures above +100°C since the DS18B20 may
not be able to sustain communications due to the higher leakage currents that can exist at these
temperatures. For app licat io ns in whic h such t emperat ur es are likely, it is stro ngly recommended tha t t he
DS18B20 be powered by an ext ernal power supply.
In so me situat ions the bus master may not know whet her the DS18B20 s on the bus are parasite power ed
o r powered by e xte rna l su pp lies. The mast er need s t his info r mat io n t o det ermine if t he st ro ng bus p u llup
should be used during temper ature conversions. To get this info rmation, the mast er can issue a Sk ip RO M
[CCh] command followed by a Read Power Supply [B4h] command followed by a “read time slot”.
During the read time slot, parasite powered DS18B20s will pull the bus low, and externally powered
DS18B20s will let t he bus remain high. I f t he bus is pu lled lo w, t he master knows t hat it must supply t he
strong pullup on t he 1-Wire bus dur ing temper ature co nversions.