I'm using a DS18B20 temp sensor with is standard having about 1 meter cable.
I do like to extend this cable.
Does anybody now the limit of length to be used?
Is there something to be taken care off beside the length?
Thanks
Re: max lengtth of DS18B20 cable
Some people have used cables of over 10m without any problems. I think they just used ordinary cat5 cable.
Re: max lengtth of DS18B20 cable
Thanks!rpdom wrote:Some people have used cables of over 10m without any problems. I think they just used ordinary cat5 cable.
That will be enough

- MarkHaysHarris777
- Posts: 1820
- Joined: Mon Mar 23, 2015 7:39 am
- Location: Rochester, MN
- Contact: Website
Re: max lengtth of DS18B20 cable
You really should not exceed about 1.5 meters tops. This is similar to the i2c bus length; if you exceed about one meter then you will have intermittent problems due to capacitance issues and|or noise. words to the wise
marcus


Re: max lengtth of DS18B20 cable
One wire is similar to I2C, yes, but has a much lower data rate and a much greater range (maybe 100m or more).
I2C was basically designed for interconnects inside a system (ranges of <1m).
The W1 bus was designed to be used with remote sensors.
I2C was basically designed for interconnects inside a system (ranges of <1m).
The W1 bus was designed to be used with remote sensors.
- MarkHaysHarris777
- Posts: 1820
- Joined: Mon Mar 23, 2015 7:39 am
- Location: Rochester, MN
- Contact: Website
Re: max lengtth of DS18B20 cable
That's an excellent article; a very good read on 'why' to keep 1-Wire networks 'short' and detailing all of the PITA that is involved in making a long 1-Wire network reliable. Almost always folks are willing to push things to what they 'can' do (reliable or not) vs what they were designed to do. The 1-Wire network was designed to be short. Can you make it long, yeah, but will it be reliable? How good are you?B.Goode wrote:http://www.maximintegrated.com/en/app-n ... mvp/id/148
Just saying
marcus


Re: max lengtth of DS18B20 cable
This is utter nonsense. 10m is trivial, 20m is easy, and longer runs are quite achievable.MarkHaysHarris777 wrote:You really should not exceed about 1.5 meters tops. This is similar to the i2c bus length; if you exceed about one meter then you will have intermittent problems due to capacitance issues and|or noise. words to the wise
- MarkHaysHarris777
- Posts: 1820
- Joined: Mon Mar 23, 2015 7:39 am
- Location: Rochester, MN
- Contact: Website
Re: max lengtth of DS18B20 cable
hi ame, I am utterly amazed at how argumentative everyone is here... YMMV is the expression that comes to mind. If you read the article carefully you will notice that running a long 1-Wire is NOT trivial (again, YMMV) and making reliable is more easily said than done (again, YMMV)... but, I am amazed at the sheer number of people who have trouble making the 1-Wire 'bus' work at 'any' length! ... and if you don't think so, just look around the net at all the questions about how to make it work; and it goes up proportionally to the length of the bus 'wire'. (again, YMMV) If its trivial for you, great! Not all people are electrical engineers, nor experienced hobbyists. For them, keeping the 1-Wire short is a great idea (again, YMMV)ame wrote:This is utter nonsense. 10m is trivial, 20m is easy, and longer runs are quite achievable.MarkHaysHarris777 wrote:You really should not exceed about 1.5 meters tops. This is similar to the i2c bus length; if you exceed about one meter then you will have intermittent problems due to capacitance issues and|or noise. words to the wise
marcus


Re: max lengtth of DS18B20 cable
MarkHaysHarris777 wrote:hi ame, I am utterly amazed at how argumentative everyone is here... YMMV is the expression that comes to mind. If you read the article carefully you will notice that running a long 1-Wire is NOT trivial (again, YMMV) and making reliable is more easily said than done (again, YMMV)... but, I am amazed at the sheer number of people who have trouble making the 1-Wire 'bus' work at 'any' length! ... and if you don't think so, just look around the net at all the questions about how to make it work; and it goes up proportionally to the length of the bus 'wire'. (again, YMMV) If its trivial for you, great! Not all people are electrical engineers, nor experienced hobbyists. For them, keeping the 1-Wire short is a great idea (again, YMMV)ame wrote:This is utter nonsense. 10m is trivial, 20m is easy, and longer runs are quite achievable.MarkHaysHarris777 wrote:You really should not exceed about 1.5 meters tops. This is similar to the i2c bus length; if you exceed about one meter then you will have intermittent problems due to capacitance issues and|or noise. words to the wise
The OP want's to extend his single sensor 1 wire network to have a longer cable run, reading the article shows that this is easily within the 1 wire capabilities.
Incorrectly telling someone that they cannot achieve what they want (when someone has already told them that they can do it) will raise people's hackles.
Disputing the evidence and claiming that it backs your position when it doesn't can also irritate people. YMMV.
Doug.
Building Management Systems Engineer.
Building Management Systems Engineer.
Re: max lengtth of DS18B20 cable
I did add about 20 meter of CAT 5 cable to the sensor.
By proving I can tell that it works perfectly well
Thanks for the help everybody
By proving I can tell that it works perfectly well
Thanks for the help everybody
Re: max lengtth of DS18B20 cable
FWIW I have used an ethernet Cat6 cable at approx 40m for my DS18B20 and I have had little or no problems with length thus far.
PiZeroW - May 2017
Pi 3 - Oct 2016
PiZero - June 2016
Pi 2 - Jan 2016
Pi B+ - Dec 25 2014
Pi 3 - Oct 2016
PiZero - June 2016
Pi 2 - Jan 2016
Pi B+ - Dec 25 2014
Re: max lengtth of DS18B20 cable
FWIW I have used an ethernet Cat6 cable at approx 40m for my DS18B20 and I have had little or no problems with length thus far.
There's the answer I'm looking for. I'm setting up a greenhouse (about 30m) with 5 sensors and already bought a box of cat6 cable.
I'm thinking it would be helpful to use a twisted pair (Brown/BrownWhite, etc.) for each 'wire' to the sensors, 3.3 V, Data, and Ground. Does anyone have an opinion on whether this would be helpful or harmful?
There's the answer I'm looking for. I'm setting up a greenhouse (about 30m) with 5 sensors and already bought a box of cat6 cable.
I'm thinking it would be helpful to use a twisted pair (Brown/BrownWhite, etc.) for each 'wire' to the sensors, 3.3 V, Data, and Ground. Does anyone have an opinion on whether this would be helpful or harmful?
Re: max lengtth of DS18B20 cable
The cool kids use pair one (blue and white) for data. Pin 4 (blue) is data and pin 5 (blue/white) is ground.CyEE wrote: There's the answer I'm looking for. I'm setting up a greenhouse (about 30m) with 5 sensors and already bought a box of cat6 cable.
I'm thinking it would be helpful to use a twisted pair (Brown/BrownWhite, etc.) for each 'wire' to the sensors, 3.3 V, Data, and Ground. Does anyone have an opinion on whether this would be helpful or harmful?
Here's one example:
http://dreamgreenhouse.com/designs/auto ... /index.php
There are many variants to choose from, but whatever you do, write it down!
I personally prefer 4-wire flat telephone cable. I can solder my one-wire devices to short pigtails with RJ11 plugs on the end, then plug them into RJ11 phone splitters. I can make my network by daisy-chaining these with other RJ11-RJ11 cables.
I use the cat5 wiring in the house to get me to the 'start' of the network then daisy-chain from there.
Re: max lengtth of DS18B20 cable
I would strongly suggest against that arrangement.CyEE wrote:I'm thinking it would be helpful to use a twisted pair (Brown/BrownWhite, etc.) for each 'wire' to the sensors, 3.3 V, Data, and Ground. Does anyone have an opinion on whether this would be helpful or harmful?
The reasons are as follows:
1. Twisted pairs should be both parts of the signal-carrying pair. The twisting of the pair increases it's immunity to noise (external electro-magnetic radiation). Using untwisted pairs of twisted pairs effectively means you are carrying the signal over an untwisted cable.
2. According to the manufacturer's notes all unused pairs should be left unconnected. By using 6 wires when 3 would do, you are adding a very large amount of extra capacitance, which is a real killer for the 1-wire system. The increased capacitance far outweighs the value of reduced resistance.
3. 1-wire signaling is heavily dependent on the voltages rising and falling within short periods of time. Line capacitance is just like adding a capacitor to a circuit, it slows down the rise in voltage as it charges (signal goes from low to high) and it slows down the fall in voltage as it discharges (signal goes from high to low)
So use one twisted pair for data and ground and a single wire from another pair for power.
Leave unused wires disconnected - do not attach them to ground at either end.
30 metres and five sensors should be OK. It is noted that more sensors at the end of the line will impact performance. So start with one and if it works then add more and try again.
As I said, 5 sensors and 30 metres should be OK.
Two approaches if it is less than perfect:
1. change the value of the resistor at the Pi end of the cable
2. use a dedicated 1-wire line driver instead of the Pi's built-in system. These use an active pull-up rather than the passive resistor pull-up. I use the HA7s from Embedded Systems.
3. Add an error-correction algorithm to your reading process so that you re-read if the result shows an error.
Regards
anita2R
Re: max lengtth of DS18B20 cable
I am using about 10m of 6-conductor twister pair telephone cable to carry the signal of two DS18B20 sensors from outside my house into my basement. My project has only been live for a few days but I read the temperatures every 5 minutes and I have yet to have a bad reading from the sensors. These are then connected in parallel with another DS18B20 sensor that has about a 3m run.