Go Down

Topic: DS18B20 Reads -12700C, was working before (Read 205 times) previous topic - next topic

RedyAu

Aug 19, 2019, 03:28 pm Last Edit: Aug 19, 2019, 03:51 pm by RedyAu
Hello!
I have a project in which I use a DS18B20 sensor in a waterproof seal to measure the water temperature (a sensor like this)
This worked properly before, but I've just come back from a few weeks of vacation and the sensor stopped working correctly.
To be exact, it gives back a temperature of -12700°C.
I googled for a few minutes, but couldn't find anything for this exact problem. Maybe some of you know something about this.
I might add that the sensor sat submerged in 0,5m of cold water in the last two weeks. I guess that's the source of the problem. Do I have to replace the sensor? Or is just my pullup resistor broken?
Thanks for any help.

Edit: Sorry! It's -127.0C of course. I forgot, that I outputted the temperature without a decimal comma. Now I can search this myself better, but help is still welcome :D
Edit 2: I can't seem to be able to track down a good answer to -127. Is it a read error, is the thermometer broken and just outputting the minimal amount, or is -127 the temperature that the library outputs when failing to communicate?
Edit 3: I tried a few ways of testing if the senor is alive, but nothing seems to be able to find it.

GolamMostafa

#1
Aug 19, 2019, 03:53 pm Last Edit: Aug 19, 2019, 03:53 pm by GolamMostafa
You need to trouble shoot your system.

1.  Take out your sensor from the water.

2.  Check the continuity of the wires from the sensor pins to the Arduino Board.

3.  Check the presence of the pull-up by continuity measurement. One end of the pull-up must have connection with signal pin of DS18B20/Arduino and the other end of sensor must have connection with Vcc of the sensor/Arduino.

4.  Power up the Arduino and press the reset button. Check that the sensor is working. If not, try by uploading the sketch.

5.  If the problem is still there, put a new DS18B20 sensor and check the temperature.

floresta

#2
Aug 19, 2019, 03:59 pm Last Edit: Aug 19, 2019, 04:02 pm by floresta
You added your edit while I was composing a comment to that effect.

I have one of those sensors that has been submerged in hot water (my spa) for two years with no adverse effects.  I don't think cold water would be any different.

Since your project worked earlier we can probably rule out the code.  (We can't eliminate the 'probably' without seeing the code.) 

The easiest solution would be to substitute another sensor and see what happens but you may have to wait several weeks for the boat to arrive from China unless you already have one on hand.

Meanwhile check out your physical connections because the -127 value is generated by the library when it believes that the device is disconnected.  A bad, improperly sized, or disconnected pull-up resistor would also cause this result.

Don

EDIT:  I can't keep up with your edits.  Try responding with a new post so that our responses will make some sense.



RedyAu

#3
Aug 19, 2019, 07:16 pm Last Edit: Aug 19, 2019, 07:23 pm by RedyAu
Thank you for your answers and sorry for the edits.

Unfortunately, I don't have another sensor like it, but I still have all the debugging steps to do you mentioned.
The only thing I can add to this right now is that I see some corrosion on the connected pins.
I won't have time this week to follow through with this properly but I was glad to hear that -127 indeed means that the library has lost the sensor.
I can rule out the code for sure, as the official testing sketches output the same.
I won't post my code as it's pretty big and I don't want to steal your time. The temperature reading passes trough multiple stuff before it gets sent.

I'm sorry that I might have posted about this probably the 1000th time. If I knew it was -127 rather than -12700 I would've never written about this in the first place :D

Thank you again and have a nice week!

hammy

If this is one of the sensors housed in the steel tube with black heat shrink around the cable , from China - they are not water proof ( despite what they say ) and fail very quickly .

When you get a new one fix it inside a tube with a sealed end and lower that into the water .


floresta

If this is one of the sensors housed in the steel tube with black heat shrink around the cable , from China - they are not water proof ( despite what they say ) and fail very quickly .

When you get a new one fix it inside a tube with a sealed end and lower that into the water .
That describes my sensor precisely.  Perhaps not all of the Chinese sensors are as bad as you describe.  

Don

jremington

Quote
I see some corrosion on the connected pins
That is a serious problem, if not THE problem.

terryking228

Quote
Perhaps not all of the Chinese sensors are as bad as you describe.
A reputable manufacturer can make these waterproof in epoxy, then the heatshrink.  The CHIPS are made in USA or under license from Maxim.

I have sold close to 10,000 of these sensors to large automation and IOT companies, over 5 or 6 years, with virtually zero fails / returns / problems.  I HAVE had a couple fail... on 30 foot cables into my swimming pool, after a lightning storm! There ARE 1-wire transient voltage protectors available: cost more than the DS18B20, though... 

BUT: Every very-popular item seems to have someone, somewhere, making counterfeits or outright fakes...

...Sigh
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Go Up