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.







 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…