18B20 correction

I have 2 18B20 sensors beside each other, and there is a difference in about 0.5 degree C.

If I decide (somehow) which of those sensors have the 'correct' temperature, can I then add/substract 0.5 in software and expect the readings on the "incorrect" sensor to be precise over the entire measuring scale? ...like 30 - 40 C

0.5C is the specified accuracy of the sensor so this is to be expected "error".
You can simply add/sub the value, and I expect that you will get closer values over the whole range,


The fact that it displays a delta of 0.5C does not mean the delta is exact that value.
You can do an analysis of the exact delta first. This is quite time consuming.

For the readouts, I assume you use 9 bits readings, is the difference the same if you use 12 bits?

Then the question which of the two is really right and which has the error?
Best change is that both have an error and none is right...

In practice you can take e.g. 10 sensors and take the one closest to the average of the 10 as the reference.
This minimizes the sum of the offsets/error corrections used.

The difference measured can be a real difference in temperature. You must be sure to cancel that possibility out!

eXistenZ:
I have 2 18B20 sensors beside each other, and there is a difference in about 0.5 degree C.

If I decide (somehow) which of those sensors have the 'correct' temperature, can I then add/substract 0.5 in software and expect the readings on the "incorrect" sensor to be precise over the entire measuring scale? ...like 30 - 40 C

You need to understand thermal radiation. They are probably matched to 0.1C or better,
20 of mine got measured and had a S.D. of better than 0.1C

However to measure them you must get them to the same temperature, which they will
not be in free air near a human body. Being black epoxy these devices are very sensitive
to radiant heat sources like people and radiators and sunlight, and also to any plumes
of warm air flowing past.

You either need to immerse them all in an oil bath or use forced air convention (a fan)
to bring them to the same temperature.

You'll probably then find variations of 0.1C or so. But then perhaps not, I may have
been lucky.