Minestrone
Posts: 4
Joined: Thu Jun 20, 2019 1:38 pm

1-Wire Ds18B20 temperature sensor disappearing when over 60°C

Thu Jun 20, 2019 2:16 pm

Hey Guys,
so I build a small pool automation, with 4 relays and 3 temperature sensors. I connected the sensors via a pcb board using the 3v3 from the raspberry and a 4k7 resistor as pullup. Everything works exactly as intended until one (and it normally does not matter which one of the three it is) goes above 60°C. As soon as that happens, all three sensors disappear after a few (1-2) correct readings (meaning that the files from /sys/bus/w1/devices are all gone except for w1_master) until I disconnect everything from the power (so full shutdown from the raspberry, then disconnect the whole system from the power, reconnect and startup, only shutting down the raspberry does not help). Any help would be highly appreciated, I do not really get what's going on, as those sensors are rated from -40° to 125°C. I read that a few other people had had similar problems, but those posts were very old and none found the underlying cause of failure.
Thanks in advance !

Andyroo

Re: 1-Wire Ds18B20 temperature sensor disappearing when over 60°C

Thu Jun 20, 2019 2:54 pm

I would try one at once as that temp is not unusual for these sensor (though unusual for the UK).

Double check the resistor and make sure the cable is good quality and the power to the Pi is stable.

How long to you wait between each reading? I've fallen back to around 3-5 minutes max read rate.

Did you sensors come from a 'known' supplier or are they cheap items from eBay?

Minestrone
Posts: 4
Joined: Thu Jun 20, 2019 1:38 pm

Re: 1-Wire Ds18B20 temperature sensor disappearing when over 60°C

Thu Jun 20, 2019 3:03 pm

Hey, thanks for your reply,
I am using the original raspberry PSU and have never had any problems with power outages, the sensors itself are from a german online shop and should be of enough quality, the are connected via 3m cables. The high temperature only occurs when the solar panels are providing the pool with hot water (basically when the temperature of the solar panel is high, I activate a pump). I have a delay of around 120s between each temperature reading.

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

Re: 1-Wire Ds18B20 temperature sensor disappearing when over 60°C

Fri Jun 21, 2019 2:05 am

Are your sensors wired in a star topology (one wire per sensor back to the Pi), or are they all strung out along a single length of cable?
If each sensor does have its own cable, try disconnecting two of the sensors (at the Pi - not just removing them from the end) and then see if things fail above 60 deg.
If so, I'd suspect the sensor. If not, then I'd suspect the wiring - the star topology. Try stringing the sensors out along a single length of wire, and consider adding a small capacitor between Vdd and Gnd at each sensor - about 10uF or so.

Minestrone
Posts: 4
Joined: Thu Jun 20, 2019 1:38 pm

Re: 1-Wire Ds18B20 temperature sensor disappearing when over 60°C

Mon Jun 24, 2019 9:25 am

My system is wired in star topology, so each sensor has its own line. I thought from an electronic standpoint, star and daisy chained is the same? (or does the different cable length make such a big difference?)
I will try to rewire the network in the next few days. Do you think a arduino would maybe solve the problem or is this a one wire specific error?

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

Re: 1-Wire Ds18B20 temperature sensor disappearing when over 60°C

Tue Jun 25, 2019 3:14 am

When it comes to sending signalling over a long wire, the length of the wire can influence how quickly a voltage transition will appear at the other end. The topology, type of wire and the characteristics of the wire used will influence this.
As it turns out, the 1-wire protocol is sensitive to signal reflections in the line, and a star topology exacerbates this.

See this Maxim note on the subject:
https://www.maximintegrated.com/en/app- ... mvp/id/148

It illustrates the series and star topologies and in general, recommends against a star.

From a wiring standpoint, if it is more convenient to run a single line to each sensor, then a multi-channel driver chip can be used, such as the DS2482-800. This uses I2C communication back to the Pi, so no GPIOs are used (other than the pins for the I2C), and will support up to eight individual lines. Otherwise, since your run is fairly short, experiment with a different type of wire. I would recommend either security system wire or Category type cable. If you use Category type wire (Ethernet cable), group the twisted pairs together on either end. For example, connect org/org wht together on each end for, say, Vdd, blu/blu wht together for data, grn/grn wht + brn/brn wht together for ground. Connecting the twisted pairs together like this minimizes the line capacitance:
https://i.pinimg.com/originals/ee/15/e4 ... 15176b.jpg

This is what I did:
https://i.pinimg.com/originals/7f/37/49 ... 5d2811.jpg

Electronique
Posts: 3
Joined: Tue Jun 25, 2019 6:52 pm

Re: 1-Wire Ds18B20 temperature sensor disappearing when over 60°C

Tue Jun 25, 2019 8:03 pm

I'm intrigued as to what might be special about 60degC since you say it doesn't matter which sensor gets there first. Is it at all possible that the magic number is actually 64degC? 64 would be represented by a single '1' bit among 15 '0' bits and this could cause problems with the star network you have. Also at 1/16 of a degree below 64 the data is 6 '0' bits followed by 10 '1' bits which is quite a 'high energy' data value.
However, wouldn't the same happen at other single bit data values such as 32degC or 16degC if there was a failure mechanism such as this...?

If it is always 60 (and exactly 60) you surely have to wonder if they are genuine Dallas devices.

Minestrone
Posts: 4
Joined: Thu Jun 20, 2019 1:38 pm

Re: 1-Wire Ds18B20 temperature sensor disappearing when over 60°C

Tue Jun 25, 2019 8:10 pm

Thanks a lot for all the input. I will try to rewire the network the next few days, and then come back with results.

It could be that the special spot is actually 64°, the last time it failed, the last correctly logged temperature was actually 63.5°. As it only logs every 5 minutes it could therefor be that this was the spot. I will try to continuously monitor the temperature and then look at what happens. The sensors are from a reliable supplier so I think they should be the real deal, but would there be any way to make sure?
Thanks again for all the input!

Return to “Interfacing (DSI, CSI, I2C, etc.)”