tjbynum
Posts: 7
Joined: Wed Oct 05, 2016 8:03 pm

DS18B20 sensor stops working

Wed Oct 05, 2016 8:11 pm

i purchased a handful of SUNKEE DS18B20 Temperature Sensors (https://www.amazon.com/gp/product/B008HODWBU) that i've been tinkering with, but i keep finding that the sensors stop reading/providing temps and it becomes 0. i haven't been able to reboot the device to get the sensors to function again, but have to shut it completely down. once it's powered back on, everything works fine for ~24hrs.

kinda beating my head against the wall with this one. i've replaced the power supply and as of today, replaced the sensor with a different one, but i won't know anything for at least another 24hrs.

anyone have any ideas what might be up? i don't see anything in the logs that stands out, but i could be overlooking something.

any and all help would be greatly appreciated!

philipBC
Posts: 14
Joined: Fri Aug 12, 2016 1:15 pm

Re: DS18B20 sensor stops working

Fri Oct 07, 2016 1:43 pm

I have been working with DS18B20s for some time now using Raspberry Pi 3, Raspbian Jessie Lite and NODEJS.

Can you show me the content of the w1_slave file for one of the sensors returning 0.

My experience is that getting a zero result comes from the device being in parasitic power mode and not being able to supply enough current to operate properly. The Device Tree Overlay driver then reports 0.

You may not intend the device to be parasitic power mode, but if the supply has a 'brown out' then that is how the device will try to operate.

I have discovered it is possible to get a number of results from the supplied driver.

85 - which happens when the senor is first initialized
0 - as described above
-22.5 (happens occasionally) when you try to re-read the device too quickly (12 bit resolution requires 750ms)
and finally the correct temperature

Hope this helps.

tjbynum
Posts: 7
Joined: Wed Oct 05, 2016 8:03 pm

Re: DS18B20 sensor stops working

Mon Oct 10, 2016 2:13 pm

philipBC wrote:I have been working with DS18B20s for some time now using Raspberry Pi 3, Raspbian Jessie Lite and NODEJS.

Can you show me the content of the w1_slave file for one of the sensors returning 0.

My experience is that getting a zero result comes from the device being in parasitic power mode and not being able to supply enough current to operate properly. The Device Tree Overlay driver then reports 0.

You may not intend the device to be parasitic power mode, but if the supply has a 'brown out' then that is how the device will try to operate.

I have discovered it is possible to get a number of results from the supplied driver.

85 - which happens when the senor is first initialized
0 - as described above
-22.5 (happens occasionally) when you try to re-read the device too quickly (12 bit resolution requires 750ms)
and finally the correct temperature

Hope this helps.
first off, thanks for the reply and the added information about the possible results i could get from the sensor(s).

i swapped out the sensor with another one and haven't had the issue since, but i also stopped posting data to ThingSpeak.com every minute and disconnected the buzzer that i had attached and not only have an LED. i'm not sure if either or both of those had anything to do with my issues, or if it was just a bad sensor.

i may not have the breadboard wired up correctly which could have been causing the issue. i'm happy to share a drawing of the circuits if you think it will help eliminate it from the source of my issues.

tjbynum
Posts: 7
Joined: Wed Oct 05, 2016 8:03 pm

Re: DS18B20 sensor stops working

Thu Oct 20, 2016 3:17 am

came in and after 2 days the frickin' sensor is giving me a temp of 0°. i'm at a loss here and i'm not sure what's going on, but it's now gotten personal. :-/

3 devices are now showing up:
./28-ba800026d10d/w1_slave
00 00 00 00 00 00 00 00 00 : crc=00 YES
00 00 00 00 00 00 00 00 00 t=0
./28-fa800026d10d/w1_slave
00 00 00 00 00 00 00 00 00 : crc=00 YES
00 00 00 00 00 00 00 00 00 t=0
./28-7a800026d10d/w1_slave
00 00 00 00 00 00 00 00 00 : crc=00 YES
00 00 00 00 00 00 00 00 00 t=0

i'm guessing maybe it failed in here?
[204045.249744] gpiomem-bcm2835 20200000.gpiomem: gpiomem device opened.
[204105.240430] gpiomem-bcm2835 20200000.gpiomem: gpiomem device opened.
[204132.518051] w1_master_driver w1_bus_master1: w1_search: max_slave_count 64 reached, will continue next search.
[204170.548159] gpiomem-bcm2835 20200000.gpiomem: gpiomem device opened.
[204230.842311] gpiomem-bcm2835 20200000.gpiomem: gpiomem device opened.

any help would be GREATLY appreciated. i'm pretty much just beating my head against the wall with this one.

tjbynum
Posts: 7
Joined: Wed Oct 05, 2016 8:03 pm

Re: DS18B20 sensor stops working

Thu Oct 20, 2016 3:18 am

tjbynum wrote:
philipBC wrote:I have been working with DS18B20s for some time now using Raspberry Pi 3, Raspbian Jessie Lite and NODEJS.

Can you show me the content of the w1_slave file for one of the sensors returning 0.

My experience is that getting a zero result comes from the device being in parasitic power mode and not being able to supply enough current to operate properly. The Device Tree Overlay driver then reports 0.

You may not intend the device to be parasitic power mode, but if the supply has a 'brown out' then that is how the device will try to operate.

I have discovered it is possible to get a number of results from the supplied driver.

85 - which happens when the senor is first initialized
0 - as described above
-22.5 (happens occasionally) when you try to re-read the device too quickly (12 bit resolution requires 750ms)
and finally the correct temperature

Hope this helps.
first off, thanks for the reply and the added information about the possible results i could get from the sensor(s).

i swapped out the sensor with another one and haven't had the issue since, but i also stopped posting data to ThingSpeak.com every minute and disconnected the buzzer that i had attached and not only have an LED. i'm not sure if either or both of those had anything to do with my issues, or if it was just a bad sensor.

i may not have the breadboard wired up correctly which could have been causing the issue. i'm happy to share a drawing of the circuits if you think it will help eliminate it from the source of my issues.
file looks normal with the exception of the 0° , no?
./28-36800026d10d/w1_slave
00 00 00 00 00 00 00 00 00 : crc=00 YES
00 00 00 00 00 00 00 00 00 t=0

rppower
Posts: 2
Joined: Fri Nov 18, 2016 8:15 pm

Re: DS18B20 sensor stops working

Fri Nov 18, 2016 8:48 pm

did you find a solution? I have the same problem, it looks like the sensors or gpio is going offline after a 24hr or so and on privateeyepi it reads 0 for all of my 5 sensors. I could set a cron job to reboot daily but then as mentioned before, the 1st reading it would send is 85 if I remember correctly, which would trigger alarms because the remp is too high.

rppower
Posts: 2
Joined: Fri Nov 18, 2016 8:15 pm

Re: DS18B20 sensor stops working

Mon Nov 21, 2016 3:18 pm

At some point rebooting didn't work anymore and I noticed that the SN in /sys/bus/w1/devices/ did not match my sensors, it was some kind of generic number. I unplug all my sensors one by one thinking that maybe one of them was faulty and for some reason messed up the others to find out that there was a wire issue with my main cable making that erratic behavior. So once I fixed this, all is back to normal.

mwh
Posts: 5
Joined: Thu Feb 12, 2015 7:07 am

Re: DS18B20 sensor stops working

Mon Nov 11, 2019 9:23 am

Hi. I am experiencing similar issues.

Did you ever find a solution?

I have five sensors that I at some point used (sucessfully) to measure the temperature at different levels in our refrigerator. Now I would like to do another project, and suddenly I experience issues similar to those described here. And it's really annoying - I want to know what's going on and how to avoid the issues (if possible).

Is it possible to reset the sensors somehow?

User avatar
B.Goode
Posts: 8987
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: DS18B20 sensor stops working

Mon Nov 11, 2019 10:48 am

mwh wrote:
Mon Nov 11, 2019 9:23 am
Hi. I am experiencing similar issues.

Did you ever find a solution?



This is what the previous poster wrote 3 years ago -
there was a wire issue with my main cable making that erratic behavior. So once I fixed this, all is back to normal.


I don't believe these solid state sensors have any intelligence or configuration that can be modified or reset beyond what happens when power is disconnected and reconnected.

Return to “General discussion”