Device Temperature DS18B20 from flipping from 9 to 12bit

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
glsf91
New user
Posts: 7
Joined: 04 Oct 2017, 18:41

Device Temperature DS18B20 from flipping from 9 to 12bit

#1 Post by glsf91 » 04 Oct 2017, 18:50

I have 2 DS18B20 connected to an esp8266. I´am using esp easy v2.0.0-dev11.
I have added 2 devices with Temperature - DS18b20. I put the resolution on 9 bits. The devices are working fine.
But after a while (can be one hour or shorter or longer) the devices are giving a reading of 85.00. When I look into the device config, the resolution is changed from 9 to 12 bit.

Is this normal ?
Can I prevent this behaviour?

TD-er
Core team member
Posts: 8830
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Device Temperature DS18B20 from flipping from 9 to 12bit

#2 Post by TD-er » 04 Oct 2017, 22:59

I have no personal experience with these Dallas sensors.

Does it also happen when only one sensor is being used?
The function to set the resolution is only being called when the device is being saved via the web interface.
The code suggests the resolution is being stored in the flash on the sensor itself. So it should only being changed when using the web interface.

So maybe there is some bug when using more than one of these sensors and just looking around in the device tab of ESPeasy?

Try to stay away from the web interface and just let it run to see if it keeps working longer.

glsf91
New user
Posts: 7
Joined: 04 Oct 2017, 18:41

Re: Device Temperature DS18B20 from flipping from 9 to 12bit

#3 Post by glsf91 » 05 Oct 2017, 16:55

I will try with 1 sensor.

I'am not using the the web interface.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Device Temperature DS18B20 from flipping from 9 to 12bit

#4 Post by Shardan » 05 Oct 2017, 23:09

Hello,

just tested:
Dev11 on a neodeMCU with 3 x DS18B20 on a q&d breaboard circuit.
Running now for 4,5 hours without any issue.

Are you sure that's a firmware problem?
Possibly it might be a problem of pull up or of power supply.


Regards
Shardan
Regards
Shardan

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Device Temperature DS18B20 from flipping from 9 to 12bit

#5 Post by Shardan » 06 Oct 2017, 18:36

I've changed the settings now to get reporting to my home control server and will let it run
for a while - it's up for 120 minutes now and running flawlessly.

Regards
Shardan
Regards
Shardan

glsf91
New user
Posts: 7
Joined: 04 Oct 2017, 18:41

Re: Device Temperature DS18B20 from flipping from 9 to 12bit

#6 Post by glsf91 » 07 Oct 2017, 13:54

I'am running it now with 1 sensor for a while also with no problem. Sensor is also working on 12bit.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Device Temperature DS18B20 from flipping from 9 to 12bit

#7 Post by Shardan » 07 Oct 2017, 16:16

As said this might be a problem of the pullup resistors or a noisy power supply.
Another possible thing is a faulty cable somewhere in the circuit.

Check the cabling first.
Use an external pullup resistor with 4.7KOhm.
Maybe try a capacitor of about 100µF at the end of the cables
between Vcc and Gnd.

Regards
Shardan
Regards
Shardan

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Device Temperature DS18B20 from flipping from 9 to 12bit

#8 Post by Drum » 08 Oct 2017, 09:06

Which DS18b20 are you using? Bare chip or long black cable with stainless steel end?
The long cables with stainless steel end generally have a pull-up resister inside. Spec says the ESP8266 can supply 12mA to the GPIO pins, and max draw on the DS18B20 is 5mA, so pull-up is needed with 2 or more, but I don't know if that can change it from 9 to 12 bit...

The default for the DS18b20 is 12bit. It is possible this could be a plugin issue. I am using V144 on my NodeMCU with DS18b20 and there is no selection for resolution. I have to assume this was added more recently. I am a bit behind on firmware, I think the latest I am using is 148.....

It is possible when using multiple DS18b20, there is a problem which causes it to revert to the default. IF there is a power issue and the plug-in does not set the resolution every time it reads temperature, that might explain it as well.

Other then the silliness of using 0.0625C resolution on a device with an accuracy of 0.5C, is there any reason not to use the default of 12bit and let ESPEasy round it? Obviously it would be good to find the problem here, but the net result should be the same.

I have to assume Dallas thought this would be more accurate than it is, otherwise why have the 12bit option?

glsf91
New user
Posts: 7
Joined: 04 Oct 2017, 18:41

Re: Device Temperature DS18B20 from flipping from 9 to 12bit

#9 Post by glsf91 » 08 Oct 2017, 09:19

I forgot to mention: when it is switched to 12bit on its own, it is not working anymore with 2 DS18B20. So with 2 connected it is only working when choosing 9 bits. When I connect one, it is also working on 12 bits.
I use the ones with the long cable. I also use a pull-up.
I also used this 2 with same cabling with a nodemcu with lua. That was working for days. Don't know if it was using 12 or 9 bits.

For the moment I'am using it now with one DS18B20 so no problem. I will look at this later again.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Device Temperature DS18B20 from flipping from 9 to 12bit

#10 Post by Shardan » 08 Oct 2017, 13:36

Something is definitely broken with your circuit.
I've tested with 12 bit and 3 DS18B20:
DS18B20x3_12bit.jpg
DS18B20x3_12bit.jpg (308.63 KiB) Viewed 8740 times
Runs quite fine.

How did you do cabling? All sensor cables come together at the ESP or more cabling between the DS18B20 cables?
Regards
Shardan

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest