Pages: [1]   Go Down
Author Topic: DS18B20 Question  (Read 1455 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11718
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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)
Logged

[ I won't respond to messages, use the forum please ]

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
Well that's perhaps a bit of a simplification
definitely, thanks for this better explanation.
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 32
Posts: 1867
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Good explanations!

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

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Detroit, Michigan, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Arduino is awesome! smiley

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 32
Posts: 1867
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Mark,

See:

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

Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11718
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

[ I won't respond to messages, use the forum please ]

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 32
Posts: 1867
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Mark,

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

Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Pages: [1]   Go Up
Jump to: