Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ESP32/Arduino/DS18B20 unable to change Resolution ?

Status
Not open for further replies.

Wp100

Well-Known Member
Hi,

Had been setting up the DS18B20 on the ESP32 using the standard Miles Burton DallasTemperature Library but found that it always showed the same 9 bit resolution regardless of the 'sensors.setResolution(12); ' instruction.

Went back to the Uno using the same 'Simple' library code Example and found that the sensors.setResolution instruction worked properly and readily changed from 9 to 12 bits.
Repeated the exercise with the sensor powered from the Unos 3v3 pin and again all worked well.

Again repeated the same code on the ESP32 using 3 different pins, eg 16,32,33 but each time they only show 9 bit resolution.
Some old comments about such problems on the web, suggesting changing to lower value pull up resistors, but no change even down to 2k2.
Tried both old and brand new DS18B20 sensors but no change.

Does anyone know if this can be overcome ? or if any other DS18B20 libraries work ok on the ESP32 ?
 
Well been able to find a solution to the problem by using the "onewireNg" library instead of the typical "onewire"
No idea what the Ng does to make it work, but as the developer states is was written to improve on the original onewire.

As can be seen it readily accepts the sensors.setResolution(12) instruction.


001412.jpg





001413.jpg
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top