1-wire DS18B20 sens...
 
Notifications
Clear all

1-wire DS18B20 sensors keep dropping  

Page 1 / 2
  RSS

simpleton
(@simpleton)
Active Member
Joined: 2 weeks ago
Posts: 7
June 25, 2020 7:56 am  

I'm setting up a pi 3 with five DS18b20 sensors to monitor temps for a glycol cooling setup.

I get the sensors added, and everything looks good for a few hours, then I see this in the messages log.

 

Jun 25 03:22:36 raspberrypi kernel: [42621.669299] w1_slave_driver 28-3c01b55643fe: Read failed CRC check
Jun 25 03:22:36 raspberrypi kernel: [42622.149286] w1_slave_driver 28-3c01b5564cca: Read failed CRC check
Jun 25 03:22:36 raspberrypi kernel: [42622.389298] w1_slave_driver 28-3c01b5567e92: Read failed CRC check
Jun 25 03:22:46 raspberrypi kernel: [42631.749444] w1_slave_driver 28-3c01b55643fe: Read failed CRC check
Jun 25 03:22:46 raspberrypi kernel: [42632.309441] w1_slave_driver 28-3c01b5567e92: Read failed CRC check
Jun 25 03:22:49 raspberrypi kernel: [42635.109492] w1_slave_driver 28-3c01b5564130: Read failed CRC check
Jun 25 03:22:49 raspberrypi kernel: [42635.349499] w1_slave_driver 28-3c01b55688d1: Read failed CRC check
Jun 25 03:22:50 raspberrypi kernel: [42636.389516] w1_slave_driver 28-3c01b5564cca: Read failed CRC check
Jun 25 03:22:59 raspberrypi kernel: [42644.949689] w1_slave_driver 28-3c01b5564130: Read failed CRC check
Jun 25 03:22:59 raspberrypi kernel: [42645.429634] w1_slave_driver 28-3c01b55688d1: Read failed CRC check
Jun 25 03:23:00 raspberrypi kernel: [42646.389729] w1_slave_driver 28-3c01b5564cca: Read failed CRC check
Jun 25 03:23:05 raspberrypi kernel: [42651.429778] w1_slave_driver 28-3c01b55643fe: Read failed CRC check
Jun 25 03:23:06 raspberrypi kernel: [42652.149745] w1_slave_driver 28-3c01b5567e92: Read failed CRC check

At this point the mycodo just repeats the last sensor input.

 

If I issue a reboot, the pi does not see the sensors.

 

If I power cycle, the sensors come back.

 

I have been able to repeat this with a second pi3 with a fresh os install and I get the same behavior.

 

Wiring is setup following this page, except I have five sensors.

http://www.d3noob.org/2018/04/this-post-is-part-of-book-raspberry-pi_24.html

 

The only difference is I have mine wired through a pi cobbler breakout board.

 

My first thought was a funky GPIO, that first pi had been through several projects over the years and it was in the vicinity of lightning a while back, so I tried a second one.

 

Next thought was interference on the 1w serial bus, but why wouldn't a reboot clear that?

 

Thoughts on what to chase next?

 

Thanks!

 


Quote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 219
June 25, 2020 4:30 pm  

So are the sensors ceasing to be detected by the operating system? If so, this is not a Mycodo issue, but likely a hardware issue. Have you tested each sensor individually on very short wires to exclude other potentially confounding variables? 

Mycodo Developer


ReplyQuote
simpleton
(@simpleton)
Active Member
Joined: 2 weeks ago
Posts: 7
June 25, 2020 4:53 pm  

@kylegabriel

Yes, the OS loses comms with the sensors.

 

Doing some more testing, I have found that bouncing the 3.3 feed to the sensors and they start talking again.

 

Cables are not crazy long, this is from a five pack of 2m sensors from amazon.

 

I have a old pi 2 that has the GPIO header removed. I think I will solder my jumper wires directly to that pi.

 

If it still tanks, wiring or one of the sensors is sending garbage and I test them one by one.

 

If it work, likely the problem is the cobbler breakout board.

 

One thing I would like to note, when it does lose contact with the sensors, the software reports the last value over and over. It took me  a few hours to notice this the first time.

 

Thanks for your work on this.


ReplyQuote
simpleton
(@simpleton)
Active Member
Joined: 2 weeks ago
Posts: 7
June 25, 2020 8:50 pm  

Still tanks on old SLOW pi 2. How ever did we manage in the single core days?

 

I suspect one of the sensors is the issue. I'm going to split the sensors up between two pi's and see if one or both fail. I am suspecting one of these sensors is sending garbage to the bus.


ReplyQuote
simpleton
(@simpleton)
Active Member
Joined: 2 weeks ago
Posts: 7
July 1, 2020 9:25 am  

I have isolated this to one sensor. I cannot get it to fail reliably, but since I have removed one particular sensor, not 1wire lockups.

 

I have since changed my wiring to a old ethernet patch panel. I wired it so power is on the blue pair and data on white/green. For the pull up resistors, I just crimped a 10K resistor into a RJ45 between the + and sense wire. I cut the end off a patch cord and wire wrapped it to the GPIO pins on the pi and connected that to the patch panel.

 

Have had this running for a couple days monitoring glycol temps at a brewery and no problems so far.


ReplyQuote
grajohnt
(@grajohnt)
New Member
Joined: 20 hours ago
Posts: 4
July 3, 2020 8:30 am  

@simpleton - I'm having the exact same problem with the same sensors.

I originally thought it was a flaky breadboard connection, but just had a board fabbed, and I'm having the same problem.

How did you determine which sensor was throwing garbage?

Thanks!


ReplyQuote
simpleton
(@simpleton)
Active Member
Joined: 2 weeks ago
Posts: 7
July 3, 2020 8:42 am  
Posted by: @grajohnt

@simpleton - I'm having the exact same problem with the same sensors.

I originally thought it was a flaky breadboard connection, but just had a board fabbed, and I'm having the same problem.

How did you determine which sensor was throwing garbage?

Thanks!

Trial and error, mostly.

 

My original setup was using a 10K resistor for the pull-up. I added another one to drop it to 5K, no difference.

 

I ended up connecting three to one pi and two to another pi. One pi would loose coms, the other would not. Swapped the wires and the problem followed the probe.

 

I tried but I could not get the one problem sensor to fail if it is the only one connected.

 

How many sensors are you running and what is the total cable length? Pull-up resistor value? Are you powering it off of a 3.3 pin on the pi and do you have a GOOD power supply?

 

I have seen so many odd problems caused by a bad power supply, or even a good power supply with bad cable.

 


ReplyQuote
grajohnt
(@grajohnt)
New Member
Joined: 20 hours ago
Posts: 4
July 3, 2020 8:45 am  

@simpleton

Four sensors and a 4.7K pullup. Yes, powering off of the 3.3V, and a known good power supply, but can definitely swap and try another one.


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 219
July 3, 2020 8:53 am  

Also beware of counterfeit DS18B20s: https://github.com/cpetrich/counterfeit_DS18B20

Mycodo Developer


ReplyQuote
simpleton
(@simpleton)
Active Member
Joined: 2 weeks ago
Posts: 7
July 3, 2020 9:07 am  
Posted by: @kylegabriel

Also beware of counterfeit DS18B20s: https://github.com/cpetrich/counterfeit_DS18B20

If I read that correctly, mine are knockoffs.

 

If you look at my first post in this thread, my serial number do not match the 28-xx-xx-xx-xx-00-00-xx pattern.

 

Right now three of the sensors are in use at a brewery. I'll give them a few weeks then I will probably test the probes again. They were within half a degree C when new, I want to see if they are drifting.

 


ReplyQuote
grajohnt
(@grajohnt)
New Member
Joined: 20 hours ago
Posts: 4
July 3, 2020 9:07 am  

That is very likely the case here - thanks for the link!


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 219
July 3, 2020 9:19 am  

I just went through Mycodo issues that include "28-" and "DS18B20" and couldn't find an authentic ID among them. So, if true, it appears all issues associated with these sensors on my Github may be a result of the low quality of the counterfeits.

https://github.com/kizniche/Mycodo/issues?q=is%3Aissue+28-+ds18b20+is%3Aclosed

Mycodo Developer


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 5 years ago
Posts: 219
July 3, 2020 9:25 am  

I'll probably add to the message that's visible in the Input settings, to warn of counterfeit sensors, since it seems like it's a significant issue. There's already a link to the counterfeit information (which I only found a few weeks ago), but it couldn't hurt to draw even more attention to the link. It could save a lot of time troubleshooting if we can determine if the sensor isn't authentic as the first step. 

Mycodo Developer


ReplyQuote
simpleton
(@simpleton)
Active Member
Joined: 2 weeks ago
Posts: 7
July 3, 2020 11:01 am  
Posted by: @kylegabriel

I'll probably add to the message that's visible in the Input settings, to warn of counterfeit sensors, since it seems like it's a significant issue. There's already a link to the counterfeit information (which I only found a few weeks ago), but it couldn't hurt to draw even more attention to the link. It could save a lot of time troubleshooting if we can determine if the sensor isn't authentic as the first step. 

Agreed. I wasted a lot of troubleshooting time focusing on my breadboad and interconnects before isolating it to the sensor itself. If I had done better research and found this I would have focused on the sensors themselves much sooner.

All part of the DIY fun.

If I can get the relay control to do what I want, I'll replace the sensors with legit ones.

 

Again, I'd like to say thanks for your work on this project.

 

 


ReplyQuote
grajohnt
(@grajohnt)
New Member
Joined: 20 hours ago
Posts: 4
July 3, 2020 1:21 pm  

Identical case for me - I even had a circuit board fabbed because I didn't trust the breadboard.

It looks like finding authentic sensors is hard, especially the waterproofed ones I need. Any thoughts on these?
https://www.newark.com/mcm/287-18000/thermometer-type/dp/25AC5059


ReplyQuote
Page 1 / 2