thebenchmark
Posts: 5
Joined: Sun Mar 19, 2017 3:26 am

DS18B20 network issues after 2 months stable

Tue Apr 09, 2019 9:36 pm

Hello everyone

Firstly sorry for yet another 1 wire network troubleshoot topic. I've read a book worth of them but I'm under the impression that none of the information there helps my case.

Situation: I'm building a solar water heater that can dump its excess water into my pool. Therefore I need 10 temperature sensors connected to my PI read at 1 minute intervals. The network is quite long as the components of the system are spread out.

Build: I've researched before I wired everything and had experience with failing 1 wire networks before. Online I found that a ring network would provide the best behavior. In this ring network there are 4 hubs where 1 metre senors depart from. The wires I used a re bit of a mix & match but are comparable to jumper cable size. The network is close to AC mains cables in some cases for a total of about 5 meters of network length. Some wires were thicker, I recently replaced these as it might increase capacitance. I am still awaiting the results. However I'm skeptical this will amount to much as its only 5 meters of total length in the network.

Stability: This network has worked perfectly for 2 months to my happy delight. Thereafter it started failing. The failures happen randomly after 1 hour, 4 hours or a couple of days. The strange thing is a reboot doesn't help, even pulling the power, I need to pull the entire psu from mains. To debug the system I tried different resistors and psu's/powerbanks all to the same effect. I ended up with a 2k2 resistor placed closest to the pi.

How it fails: As said above after a random while Some or all sensors start reading 85.0 as a temp value. Then after 2 minutes all devices in the network disappear and 2-3 ghost devices appear. A hard reboot by pulling the psu is needed.

I would very much prefer a stable network otherwise I don't have hot water to shower with and the wife acceptance factor diminishes :(

I was thinking of splitting the network in two. I thinks its likely that I'm pushing the limits of what a network can handle.
As far as I know there are 2 options:
- Adding a second network to the pi by defining a new gpio as described here: viewtopic.php?t=156734
(My understanding is that these networks are separate)
- Using a DS2482 I2C to 1-wire this creates a separate network and communicates over i2c.

I would prefer solution 1 as this is the fastest & cheapest to implement but I need to be sure these networks are seperate. I'm very much looking forward to advice. Thanks in advance!

A sketch of the network:
ds18b20 sensor diagram.png
ds18b20 sensor diagram.png (79.18 KiB) Viewed 440 times

blimpyway
Posts: 183
Joined: Mon Mar 19, 2018 1:18 pm

Re: DS18B20 network issues after 2 months stable

Wed Apr 10, 2019 11:44 am

That totals almost 60meters of cable for a single 1 wire loop.

If any problem happens anywhere (interference, bad contact, leakage) it not only affects all sensor readings but it also is quite hard to find it.

Split them as you can to get the shortest lines possible, try even 3 loops instead of 2

That at least will help you narrow the places where the problems begin.

-----------

I had problems when humidity leaked trough to the sensor's pins when I used simple "transistor" type DS18B20 "sealed" in shrink tube.

JohnsUPS
Posts: 122
Joined: Fri Jul 06, 2018 2:13 am
Location: USA

Re: DS18B20 network issues after 2 months stable

Thu Apr 11, 2019 1:09 pm

I would advise against a loop of any sort. Instead, consider stringing them all out along a single length of cable. You're showing ~58m of cable, which should not pose a problem if wired correctly. Consider wiring in a small capacitor at each sensor to see if that improves anything.

User avatar
omegaman477
Posts: 148
Joined: Tue Feb 28, 2017 1:13 pm
Location: Sydney, Australia

Re: DS18B20 network issues after 2 months stable

Fri Apr 12, 2019 10:12 am

Avoid loops in I2C networks at all costs, star topology is best.

A large ring as you describe could introduce all sorts of electrical noise.
..the only thing worse than a stupid question is a question not asked.

User avatar
rpdom
Posts: 15362
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: DS18B20 network issues after 2 months stable

Fri Apr 12, 2019 11:29 am

omegaman477 wrote:
Fri Apr 12, 2019 10:12 am
Avoid loops in I2C networks at all costs, star topology is best.

A large ring as you describe could introduce all sorts of electrical noise.
The DS18B20 is not i2c. It is one-wire. But loops in one-wire are not acceptable either. Neither is star topology. Devices should be daisy-chained or, at least only be a short distance from one main cable.

thebenchmark
Posts: 5
Joined: Sun Mar 19, 2017 3:26 am

Re: DS18B20 network issues after 2 months stable

Mon Apr 15, 2019 5:23 pm

Thanks for the good answers!

I removed the ring topology and spilt the network in 2 parts. This didn't seem to be the root cause and I was able to identify that a temperature sensor in a solarpanel had a cable that had melt a bit. I guess when temperatures rose it would short.

So much for chinese temperature ratings :lol:

Return to “Automation, sensing and robotics”