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?
I would strongly suggest against that arrangement.
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