rpiho
Posts: 4
Joined: Mon May 23, 2016 9:56 pm

1-wire Temperature Inaccuracy

Mon May 23, 2016 10:06 pm

I have temp measurement running with a DS18B20 on GPIO. I gives a temp measurement but after checking it is about 1 to 1.5 degrees C high when checked with a Fluke temp meter and compared with an other 1-wire setup using a Mac, digitemp and a LinkUSB 1-wire adapter.

I have tried a few DS18B20's and another Pi but the temp inaccuracy is still the same. Has anyone else noticed this problem? Is it caused by the Pi using bit banging to get the temp rather than a dedicated 1-wire adapter? Anyone else run into this?

duckvader
Posts: 11
Joined: Thu Apr 23, 2015 2:41 pm

Re: 1-wire Temperature Inaccuracy

Mon May 23, 2016 11:37 pm

I have noticed that some can be a little off. That is why when I bought mine I bought more than one and tested them and chose the ones that were the most accurate.

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

Re: 1-wire Temperature Inaccuracy

Mon May 23, 2016 11:58 pm

You don't mention whether you have the to-92 package or the waterproof version, but if you have the latter, test with an ice-cube and boiling water (assuming you are somewhere not too far above or below sea level will give 0 and 100 respectively).

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Tue May 24, 2016 5:32 am

Calibrated, certified DS1820s are available but expect they may be significantly more expensive than non-calibrated.
Any DS1820 can be calibrated in water or water/ice if placed in the finger of a latex glove though I am not sure if latex will stand boiling water. Some time has to allowed for temperature stabilisation of course., plenty of guides online

Sorry, that doesn't answer OP's question, I use Sheeepwalk Electronics host adapters here and always see consistent results.

rpiho
Posts: 4
Joined: Mon May 23, 2016 9:56 pm

Re: 1-wire Temperature Inaccuracy

Tue May 24, 2016 4:06 pm

The DS18B20's are supposed to be accurate within 1/2 degree C so 1.5 is outside this tolerance.

I just hooked up a LinkUSB 1-wire adapter to my Pi and using digitemp I now get accurate temperatures which, to me, points the problem at the Pi and how it calculates temperature.

rpiho

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Tue May 24, 2016 4:34 pm

My recollection is that the DS18B20 calculates the temperature and transmits that value to the Pi.
Is there any chance of self-heating in your setup? I have not tried the kernel 1-wire modules so have no idea what circuit you may be using - or whatever else may be going on.

There have been many changes in owfs since owfs 2.9.p8-6 which I assume you are using. Might be worth looking at https://sourceforge.net/p/owfs/mailman/ ... e=threaded for similar issues

rpiho
Posts: 4
Joined: Mon May 23, 2016 9:56 pm

Re: 1-wire Temperature Inaccuracy

Tue May 24, 2016 8:47 pm

No self heating, the sensor is all away from the Pi.

No I'm not using owfs. The PI's modules give the temp, no external modules are required.

Like i said if a 1-wire adapter & Digitemp connected to the Pi give the correct temp then the problem is with the way the Pi's modules calculate the temp.

edo1
Posts: 151
Joined: Sun Jun 15, 2014 3:33 pm
Location: Russia

Re: 1-wire Temperature Inaccuracy

Tue May 24, 2016 9:40 pm

rpiho wrote:the problem is with the way the Pi's modules calculate the temp.
there are two lines of code, you could check them for yourself
http://lxr.free-electrons.com/source/dr ... erm.c#L186

edo1
Posts: 151
Joined: Sun Jun 15, 2014 3:33 pm
Location: Russia

Re:

Tue May 24, 2016 10:35 pm

fruit-uk wrote:Is there any chance of self-heating in your setup?
I observed some self-heating in parasite power mode (5/16°C after 40 seconds of repeatable temperature reads).
rpiho wrote:I have temp measurement running with a DS18B20 on GPIO. I gives a temp measurement but after checking it is about 1 to 1.5 degrees C high when checked with a Fluke temp meter and compared with an other 1-wire setup using a Mac, digitemp and a LinkUSB 1-wire adapter.
what temperature do you try to measure?
could you measure temperature of some massive metal item to eliminate self-heating?

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Wed May 25, 2016 4:56 am

Self-heating has nothing to do with how close to your Pi the DS1820 may be placed but , as edo1 infers, is to do with heating of the DS1820 internally.
As said earlier I know nothing of bit-banging DS1820 but if it uses w1 then that code derives from owfs AIUI though I have no idea which owfs version that might be taken from/based on.

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