DS18B20 Question

I installed a DS18B20 temp sensor using a 10K pullup resistor. It seems to be functioning correctly but I noticed the datasheet indicated the resistor should be 4.7K. Will that affect the temp indication?

None, the pull up is used to get a better signal (more square wave) and depending on the distance you need a smaller resistor.

It is explained for I2C on this page - http://www.gammon.com.au/forum/?id=10896 - Search for: Pull-up resistors

It works the same for every digital bus.

It works the same for every digital bus.

Well that's perhaps a bit of a simplification - some busses use push-pull drivers, some use matched termination resistors.

If power drain isn't an issue the pull-up resistor would be matched to the signal cable characteristic impedance (typically 150 to 250ohms), but at 5V that's a lot of current, so for short-range busses the compromise of a higher valued resistor is used.

The temperature value coming back from the DS18B20 cannot be affected(*) by the signal path (that's one of its great plus points) as the measurement is made on-chip and digitised before communication takes place. All you need is to provide stable power supply during conversion.

(There is a mode called "parasite power" in which power is provided over the signal path - this is different and requires an additional "strong pullup" as well as the resistor - this is best avoided unless you really have to save on wiring)

(* well it could be completely lost/garbled in the extreme case, but until then it is communicated flawlessly)

Well that's perhaps a bit of a simplification

definitely, thanks for this better explanation.

Good explanations!

For some basic how-to, sample Arduino Software etc: http://arduino-info.wikispaces.com/Brick-Temperature-DS18B20

Hello,

I used the same circuit, as I only had a 10k ohm resistor. I used terryking228's link as well. Is there any link to a website with a circuit diagram for normal (non-parasitic) mode? Thanks everyone for explaining the whole thing, I was dreading the thought of ordering the entire resistor kit (which i have done now) and having to delay my project for a week.

Cheers,

Mark

Hi Mark,

See:

At short distances, 10K usually works. And two 10K in parallel := 5K... Non-critical.

What that diagram doesn't show is that the decoupling capacitor should be mounted right at the sensor and the pull-up resistor is best at the Arduino end of the cable.

Mark,

You're right! I'll update that and try to organize the "Longer Distance and Multiple Sensors" stuff.