DS18B20 length of wires limitation

I have waterproof sensor DS18B20 to measure water temperature.
Range of temperature is between 10C to 30C
I do not need very accurate measurement - +/-1C is OK
The original length of wires is about 1m.
I have to place this sensor about 10m from Arduino board.
My question is:
Should I compensate this in my sketch/code?
Any suggestion about AWG number for this extension?
Thx in advance

There should be no need to adjust the code. CAT5 cable is commonly used for this. You may need to use a smaller pullup resistor, 2.2k

Marmadoc:
I have waterproof sensor DS18B20 to measure water temperature.
Range of temperature is between 10C to 30C
I do not need very accurate measurement - +/-1C is OK
The original length of wires is about 1m.
I have to place this sensor about 10m from Arduino board.
My question is:
Should I compensate this in my sketch/code?
Any suggestion about AWG number for this extension?
Thx in advance

all to be known about that is here.

Hi, Most people use readily-available CAT5 Ethernet cable. There are no definite "Standards" for pinout of the cable but here is one that is often used. It also provides separate 5V and 12V power for remote devices:

More than you wanted to know about long 1-wire interfacing :slight_smile: : Guidelines for Reliable Long Line 1-Wire | Maxim Integrated

And, as long as you have to run a cable, go with VDD powering rather than parasite. That will make things easier.

terryking228:
Hi, Most people use readily-available CAT5 Ethernet cable. There are no definite "Standards" for pinout of the cable but here is one that is often used. It also provides separate 5V and 12V power for remote devices:

Thx to all of you. It is very helpful.

I agree with MrMark in that you should see the datasheet for your device.
That being said, I have been successful with > 100’ of CAT 5 wire. Just use the most tightly wound pair and try to avoid paralleling anything carrying AC. Also, no parasite mode.

Just use the most tightly wound pair and try to avoid paralleling anything carrying AC.

Also ground the unused wire/pairs in the cat5. It's "Almost Like Shielding"...