Adjust your sensor values DS18B20


I’m using a DS18B20 temperature sensor and I would like to adjust the value. It would be great if al the values you measure, can be adjusted. Then I can measure all kinds of analoge values and present them at the right value?

A good idea?




I’m curious why you would want to adjust the value of a DS18B20 sensor?


Because they are not presenting the same value. For example, one DS18B20 measures 20,2 another one measures 19,7 degrees Celcius.


like this



Welcome to the Cayenne community!

From the Maxim Integrated Datasheet for the DS18B20-
±0.5°C Accuracy from -10°C to +85°C

Your DS18B20’s appear to be operating within specification. If greater accuracy is needed, these may not be the best sensor for your application. Sadly more accuracy will come at a much greater cost.

I’m curious, what is the application?

Again, welcome,



I want to measure small temperature differences between the temperature of the ventilation air (cooled) and the room temperature. The difference will be someting like 2 degrees C. The offset of 0,6 degrees C is a problem.

I’ve tried the DHT22 sensor in other raspberry pi projects. They need also adjusments. But thats easy in a python script or shell file.

Therefor i like to adjust te value + or - of x or /. It would be even better if I can use other measured values to calaculate a new value.




I don’t think you really want to go down that path. Your sensor is giving you a value that it is “sensing”. It doesn’t really matter if it is what you are expecting, that’s not how sensors work.


I agree that DS18B20 are as good as out of the packet. Check the thermal bonding and any stray effects caused by heat gain / loss via leads and un insulated probes.

However I am looking forward to a patch bay / sand box facility that would allow calibration of one signal into a secondary / generic variable. This will help to take input signals and patch things up to create new variables for controlling or plotting complex functions. E.g. a simple PID controller type action with remote or dashboard setpoint and local / remote set points. The output (a generic variable) can then be sent or patched to say a PWM output or servo controlling something electro-mechanical.

~ Andrew


That should be super useful, at least for my project since I need to install more temperature sensors on my hot water tanks.
The challenge is that they will be installed in contact with the tank aided by a thermal silicone heat conductive pad and the appropriate insulation whereas the other temp sensors I am currently using are immersed in direct contact with water.
Your idea of a potential adjustment would allow correct calibration of the values registered by the external sensors and compensate for the heat loss induced by the materials between the sensor and water (steel tank or water pipe and heat pad in my case) allowing an accurate representation of the values read by the sensors.