User avatar
janroc
Posts: 10
Joined: Tue Apr 26, 2016 4:02 pm
Location: Sweden

DS18B20 wrong temp

Sun Jun 05, 2016 4:47 pm

Hi all,

I have two DS18B20 connected to my PI 3 model b.
Both is showing the same temperature, but if I compare them with other thermometer they a bit to high C around +2C.
I have google and it seems that I am not alone of this problem.

Any suggestion what I can do?
Right now will try to get the result from the python script and remove -2.0 if I success.
Regards Jan

User avatar
saper_2
Posts: 240
Joined: Sun Aug 03, 2014 10:08 am
Location: PL

Re: DS18B20 wrong temp

Mon Jun 06, 2016 8:42 pm

Hi,

I don't know what kind precision you want from ds18b20 but that is about normal, maxim specify +/- 0,5degC... I have quiet few of those chips: original from Dallas (now Maxim or Maxim integrated - or whatever they want to call them now...) and Chinese knockouts, all of them report temperature form 1 to 2,5deg different (usually higher by this 1 to 2,5degC - the ~ +2,5degC I got on Chinese parts). This probably is influenced by external heat sources like: voltage regulators, processors, your hand, or even sensor heat-up itself too, lying around phone and/or close wifi/bt/router antennas can introduce some errors to the analog and ADC circuit inside ds18b20 chip too...
The "reference" temperature sensor (thermometer) might be off too - unless you're using certified high precision thermometer.

I usually use 2 or 3 different sensors and calculate their mean temperature, e.g.:
(temperature from barometric sensor + temperature from humidity sensor + ds18b20 temperature) / 3 = mean temp.

Or jut use the approach as your already using: compensate temperature by adding/subtracting from result constant value - the simplest way and it should give your good results too.

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: DS18B20 wrong temp

Mon Jun 06, 2016 9:42 pm

janroc wrote:Hi all,

I have two DS18B20 connected to my PI 3 model b.
Both is showing the same temperature, but if I compare them with other thermometer they a bit to high C around +2C.
I have google and it seems that I am not alone of this problem.

Any suggestion what I can do?
Right now will try to get the result from the python script and remove -2.0 if I success.
You can check the sensor with ice and boiling water (assuming you aren't significantly far from sea level) as these will be at known values.

User avatar
janroc
Posts: 10
Joined: Tue Apr 26, 2016 4:02 pm
Location: Sweden

Re: DS18B20 wrong temp

Tue Jun 07, 2016 12:42 pm

Yes the China sensors seems to show a bit higher, arround 2C. So I guess this is normal. I found out to fix this in the python script so I am fine now. Where do do I buy one that is more precise?
Regards Jan

DavidMS
Posts: 139
Joined: Fri May 25, 2012 8:48 pm
Contact: Website

Re: DS18B20 wrong temp

Tue Jun 07, 2016 1:13 pm

One point to note is that the actual temperature sensing element is bonded to the middle pin of the DS18B20, not the device case. As such it can pick up / be cooled by conduction from the PCB it is soldered to. I have seen this in a board I developed which ran 'warm' causing the DS18B20 to read slighty above room temperature. If I separated it from the board which jumper wires it read room temp correctly
http://meanderingpi.wordpress.com/
11 Raspberry Pi's and counting....

Return to “Interfacing (DSI, CSI, I2C, etc.)”