Jump to content

Daisy Chain 1-wire sensors


PeterW

Recommended Posts

As it says really. 

 

What are the rules on daisy chaining and hub / spur routing of 1-wire sensors ..? I want to measure the temperature in the cellar and under the slab from the cellar along with the humidity so ideally want a minimum of 3 sensors in the cellar area. I've only got a single 22mm "duct" going in there and I'm using that for a D.C. Supply to the LED lights and potentially a small circulation fan. 

 

Is is it possible just to run a single Cat5/6 down there and just hang all of the sensors off the 3 wires and the rPI end resistor (this is a Python bitbang setup for monitoring) or would I be better creating a mesh of resistors / sensors and run each on its own Cat5/6 core with a common earth..?

Link to comment
Share on other sites

Running 3 1-Wire sensors is just a case of wiring them in parallel and putting the right resistor at the RPi end.  So yes, use a bit of CAT for it.

If you get the right resistor value (it all depends on the number of sensors and cable resistance), they are pretty robust.

 

DHT22's (which are cheap and do RH and Temp) do need to be on separate RPI IO pins and need their own resistor.

Edited by SteamyTea
  • Like 1
Link to comment
Share on other sites

Yes you can, but 1-wire is very sensitive to reflections, so if you are daisy chaining you need to make sure that any stubs are as short as possible. Ideally you would loop the cable at each sensor. I have several runs with multiple sensors attached without stubs using passive mode and they are pretty reliable.

Link to comment
Share on other sites

1 hour ago, billt said:

Yes you can, but 1-wire is very sensitive to reflections, so if you are daisy chaining you need to make sure that any stubs are as short as possible. Ideally you would loop the cable at each sensor. I have several runs with multiple sensors attached without stubs using passive mode and they are pretty reliable.

 

Translation please ..!!!

 

Do you mean make any stub off the main run as short as possible ..?  

Link to comment
Share on other sites

A useful tip is to remember that reducing the resistor value at the processor end can improve performance over long cables.  I found that one of my DS18B20 sensors would very occasionally glitch, maybe once a week or so, for a single reading (they are all read every 6 minutes).  Reducing the resistor from 4k7 to 3k3 fixed the problem.  I believe you can go down to 2k2 on a 5V supply if you need to.

  • Like 1
Link to comment
Share on other sites

  • 6 years later...

(reviving old post but this seems most focused on the topic)

I came across this source that agrees: a daisy chain (linear bus) with short stubs (<3m) to each device is the best topology, and star network the least favourable.

https://www.analog.com/en/technical-articles/guidelines-for-reliable-long-line-1wire-networks.html


Also mentions the possibility of an active pullup rather than the passive 4k7 pull up resistor, which can increase the possible network size further.

 

  • Like 1
Link to comment
Share on other sites

30 minutes ago, joth said:

Also mentions the possibility of an active pullup rather than the passive 4k7 pull up resistor, which can increase the possible network size further.

I found having more than 8 on a wire it became unreliable.

You can change the resistor value which helps, but not sure by how much.  I have used 10K, but never 2K.

Link to comment
Share on other sites

Yeah I found the limit was below 10 too. But I'm using a star topology.

What I do like about a star is if it is unreliable, you have lots options to fix it back at node zero (in my case, split the network to and have multiple master devices. A ESP32 costs pennies, and one can actually drive a few 1-wire networks, so I could even have one master per device if I really had to).

 

While the daisy-chain is more reliable on paper, once you've locked that design in, it's much harder to change up. If well thought through it maybe fairly simple to cut one "ring" in half to make 2x radial lines, but anything else could be very invasive 

1 hour ago, SteamyTea said:

I found having more than 8 on a wire it became unreliable.

 

out of interest, are you using screened twisted pair?
https://www.loxone.com/enen/kb/1-wire-extension/#1wconnect is the clearest guide I've seen: screened CAT6, GND and DQ on one pair, VDD (if connected) on a separate core, and the shield left floating. Remaining pairs must not be used for anything else.  definitely not what I'm doing 

 

Link to comment
Share on other sites

5 hours ago, SteamyTea said:

On the RPi it is easy to assign more GPIO pins to 1-Wire protocol.

 

Right, so the same as an ESP32 just more expensive and more effort to maintain.

 

 

 

Link to comment
Share on other sites

20 minutes ago, joth said:

Right, so the same as an ESP32 just more expensive and more effort to maintain.

Probably.

I have some ESP8266 but not got around to playing with them much.  Going to wait till I am housebound for whatever reasons.

Link to comment
Share on other sites

Interesting thread. I've put some sensors in the core of my ICF wall N,E,S and W elevations. And as they are fixed forever, I piggybacked two sensors in each location for redundancy. So that's 8, and then I've got sensors in the slab in 5 locations, these are in pipe so on theory could be replaced, I've wired these in cat 6 all back the the plant room.  So if 8 is a good max  number I could configure on two sets of pins ( I think I'll use ESP32) I want to create a logging system, but also measure CO² and display the info ( a future project after the build)

 

Is there a calculation to work out resister size needed If I measure the Resistance of each cable?

Link to comment
Share on other sites

Hmm if the ideal pullup resistor was simply a function of the wire resistance, this paper could have been much simpler

https://www.analog.com/en/technical-articles/guidelines-for-reliable-long-line-1wire-networks.html

 

I think the general process ppl use for passive pull up is is start with 4k7, see if you get errors, and if so try reducing the resistor.  Or if needed, divide up the network

 

(Interestingly the Loxone 1-wire extension has the pull up built in, so maybe it is active pullup circuit. Somehow I doubt it though)

 

Edited by joth
Link to comment
Share on other sites

Loxone says max 20 devices, but I've got just over 20 working well and plan to add a couple more.  I'm using a long single run around the house with the probe leads forming short legs.

 

I haven't used any resistors but did tweak how I was using the cat cable slightly to try to reduce noise, without this I was having some issues.

Link to comment
Share on other sites

On 03/07/2023 at 14:06, joth said:

https://www.loxone.com/enen/kb/1-wire-extension/#1wconnect is the clearest guide I've seen: screened CAT6, GND and DQ on one pair, VDD (if connected) on a separate core, and the shield left floating. Remaining pairs must not be used for anything else.  definitely not what I'm doing 

 

I used a decided shielded CAT7 daisy-chained for 1-wire, and radial CAT7 runs to each room for tree and IO.   This means I've got more cores for IO in each room, and means I get 20+ 1-wire devices on a single Loxone extension.

 

I found the following worked well:

- 1 pair: DQ+GND

- 2 pair: VDD+GND

- shield: GND

 

I haven't tested to see if i) twisting VDD with GND or ii) connecting the shield to GND had the most impact, but I know I had some issues before doing this.

  • Thanks 1
Link to comment
Share on other sites

  • 5 months later...

I found a surprisingly accessible illustration of the effects of wave reflections and  wire branches in this video. Despite having a masters in the subject I'd never really considered the interaction of potential voltage and current in this dynamic sort of way. 

 

 

 

  • Like 1
Link to comment
Share on other sites

1 hour ago, joth said:

Despite having a masters in the subject I'd never really considered the interaction of potential voltage and current in this dynamic sort of way. 

Isn't this how the position of breaks, and shorts, in cable runs are detected?

The time and magnitude of the reflected signal shows where, and what, the problem is.

  • Like 2
Link to comment
Share on other sites

  • 1 month later...

I use a little star connection board with 3 pin connectors one-per-thermo, and run the individual OW thermometers back to this.  IIRC, I had to bump the pull-up resistor to get it stable.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...