My project is a seawater temperature logger transmitter
The DS18B20 sensor is mounted on an offshore navigation pole. The data is acquired by a Pico2 and transmitted hourly by a SX1262 LoRa/Pico Meshtastic. The set up is solar powered
The receiver is about a Km away and logs to file and uploads to www.Adafruit io hourly
My problem is the temperature values occasionally are exactly the same for 2 or 3 hourly readings eg 21.88, 21.88, 21.88
This doesnt seem correct as the temperature at the site is not stable to 2 decimals places. Does the sensor need a significant change to update the value? Perhaps the buffer is not refreshing every time
Today at 5:33 and 6:33 the readings were both 20.69 , also 1:33 and 2:33 , 20.94 Its highly unlikely the identical reading is correct with a 2 degree diurnal range of temperature
1 The sensor always responds with a value. During bench testing a I did get the default dud value of 85 but that was a poor breadborad connection on the 4.7K PU resitier
2 The sensor reads realistic values and follows expected trends
3 I have a Hobo logger deployed at the site that is recovered monthly. Previous data has good correlation to the DS18B20 (a small offset within sensor specifications
I would be interested in what you onsite logs show compared to what this sensor setup is reporting.
I assume its still running at the default 12 bit resolution ?
If, for example it some how was running at 9 bit, the it will be with 0.5 Deg C so you would need enough change to see a difference.
Bits Resolution
9 0.5°C
10 0.25°C
11 0.125°C
12 0.0625°C
The default resolution at power-up is 12-bit.
Im guessing you would need to adjust the configuration register as needed.
Note: I have not looked into how to do that, but your API/Library may already have something ?
If I’m reading the datasheet Michael provided correctly, 12-Bit actually corresponds to an amount of 0.0625.
“The resolution of the temperature sensor is user-configurable to 9, 10, 11, or 12 bits,
corresponding to increments of 0.5°C, 0.25°C, 0.125°C, and 0.0625°C, respectively. The default resolution at power-up is 12-bit” - p.5.
That definitely would correlate to your data, with 0.06 degrees celcius between 20.69, 20.75, and 20.81. The sensor would just be incapable of recording any fluctuation more precise than that.