DS18b20 sensor cant' change resolution

Hi !
I played around with an Arduino Nano and two Ds18b20 sensors. Until I recognized that I can't choose a resolution anymore. It's always 12-bit.

To make sure that it is not a fault in my sketch, I use the example / Dallas Temperature / Multiple. But whatever resolution I choose, I always get 12-bit which is the standard resolution.

How can I reset the SRAM scratchpad and EEPROM storage in a Ds18b20 ? Is there a sketch for that ?

Thanks'

Which version of the library do you use?
Have you tried with one sensor?

DALLASTEMPLIBVERSION "3.7.2"

I have no idea why suddenly I can't set a resulution anymore. Only 12-bit...

Why do you want to lower the resolution. Speed?
For printing/displaying, you can always ignore some or all decimal digits.
Serial.print(temp, 1); // display with one decimal place
Leo..

Are you trying to set resolution globally (all sensors) or to an individual? Please post your code.
How To Post Code

#include <DallasTemperature.h>
#include <OneWire.h>

OneWire oneWire(2);

DallasTemperature sensors(&oneWire);

DeviceAddress tempSensor = {0x10, 0x51, 0x79, 0x29, 0x02, 0x08, 0x00, 0xA6};

float tempC;

void setup(void)
{
  
  Serial.begin(9600);
  
  sensors.setResolution(tempSensor, 9);  //This should change the resolution to 9-bit
    
  Serial.print("Sensor Resolution: ");
  Serial.println(sensors.getResolution(tempSensor), DEC); 
  Serial.println();
}

void loop(void)
{ 
  sensors.requestTemperaturesByAddress(tempSensor); 
 
  tempC = sensors.getTempC(tempSensor);
  
  Serial.print("Temp C: ");
  Serial.print(tempC,4);  //Serial shows 4 positions after decimal point
  Serial.print(" Temp F: ");
  
  Serial.println(DallasTemperature::toFahrenheit(tempC),4);
  delay(1000);
}

With a resolution setting of 9-bit I expect to see a temperature in the format XX.X000. But it shows always a format of XX.XXXX.

Groeg:
With a resolution setting of 9-bit I expect to see a temperature in the format XX.X000. But it shows always a format of XX.XXXX.

Did you read post#3.

Change

Serial.print(tempC, 4); //Serial shows 4 positions after decimal point

to

Serial.print(tempC, 1); //Serial shows 1 positions after decimal point

Leo..

Hi Leo, yes thank you I read that. But with that I only change what will be printed. The sensor is running still with 12-bit resolution. I want to change properly the resolution setting. Or do I get here something totally wrong ?

Definitely genuine DS18B20's and not knock-offs?

Genuine DS18B20's.......and resolution setting have worked before.......

Groeg:
Genuine DS18B20's......

How do you know that?