In a simulation scenario, I measured (second by second) the temperature from the DS18B20:
red line on :
There are 2 points (+/- 120 s and 160 s) where the temperature has measured with 0.6ºC more than expected.
Why this happens?
Component not 100% reliable ?
Thanks in advance.
Post your code, in code tags.
What resolution are you using? It takes about 800ms to get a reading with 12-bit resolution and perhaps you aren't giving the device quite enough time to do that and occasionally it causes glitches.
Why are you reading every second? There are periods where the graph shows the temperature is stable for at least 5 seconds. What happens if you read every 5 seconds instead of every one?
The spec for the DS18B20 is +/- 0.5C between -10C and 85C so your readings aren't necessarily out of spec.
One second intervals are OK. It is probably a resolution problem. Is it 12bit? If not, delete the resolution comnads, i.e. use the default 12bit. It should look better then.