-->
Page 1 of 4

Wrong DS18B20 readings

PostPosted: Thu Mar 03, 2016 11:18 am
by fotastisch
Hi there!

I've posted a similar question in the nodemcu subforum, but since then I have switched to the arduino ide due to other problems. So please excuse me asking again, but I still have the same problem.

I want to measure temperatures with the DS18B20. Right now, they just measure the room temperature and the values are totally of. I'm using the example code from the 1wire library for the sensors and they are recognized correctly (I think). The temperature readings on the other hand are reported as 80 - 90 °C, which is a bit hot I guess. So far, I had not noticed that I'm sitting in a sauna. ;)

Temperatures in the low twenties would sound right on the other hand. Is there by any chance a possitbility that would explain a factor of 4 in the temperature conversion?

Thanks for your help!

Re: Wrong DS18B20 readings

PostPosted: Thu Mar 03, 2016 3:10 pm
by piersfinlayson
What library/libraries are you using to read the temperature from the D18B20 and what value are you seeing?

Are you using an external pull-up resistor, and if so what value? (The DS18B20 works just fine with the internal pull-resistor on the ESP8266, although I've not done this with the Arduino framework.)

85C is an error value - indicative of an uninitialized device. You'll typically get it during a first read after power on, but should get correct readings afterwards.

Would also be useful to see your code.

Re: Wrong DS18B20 readings

PostPosted: Thu Mar 03, 2016 3:32 pm
by martinayotte
I would NOT trust the internal "weak" pullup of ESP GPIOs since they are around 100K and OneWire specs requires about 4K7. This is especially true if you use waterproof DS18B20 with 1 meter of wire.

Re: Wrong DS18B20 readings

PostPosted: Thu Mar 03, 2016 3:43 pm
by piersfinlayson
I've had 8xDS18B20s each with 3m wire all working fine at the same time on the same GPIO with the internal pull-up resistor.

To the OP, if it is 85C you're seeing another possibility is you've left DS18B20 VCC floating - rather than tying to 3.3V or GND.