Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:27 18 Sep 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Maxim/Dallas DS18B20 accuracy

Author Message
rogersan
Regular Member

Joined: 10/04/2015
Location: Australia
Posts: 79
Posted: 12:29pm 31 Aug 2015
Copy link to clipboard 
Print this post

I have been comparing the temperature readings of the DS18B20 withe the BMP180, the DHT22 and the SHT21. The BMP180, DHT22 and SHT21 track each other within 0.1 degrees while the three DS18B20's that I have tried are reading 0.7 to 1 degree higher.

Has anyone found similar accuracy problems with the DS18B20?
 
srnet
Senior Member

Joined: 08/08/2014
Location: United Kingdom
Posts: 164
Posted: 11:27pm 31 Aug 2015
Copy link to clipboard 
Print this post

How close to the actual temperature were they ?
$50SAT is Silent but probably still working.
For information on LoRa visit http://www.loratracker.uk/

 
rogersan
Regular Member

Joined: 10/04/2015
Location: Australia
Posts: 79
Posted: 11:47pm 31 Aug 2015
Copy link to clipboard 
Print this post

It is a bit hard to know the real temperature, unless you have an expensive calibrated Mercury thermometer or expensive electronic thermometer.

As the SHT21 is accurate to 0.4 degrees, and the BMP180 and DHT22 closely agree with it within 0.2 degrees, then I have assumed this is an accurate reading. Even an LM35 analogue temperature sensor I tried agrees closely with the SHT21.

In comparison the DS18B20's, I tried, read between 0.7 to 1.2 degrees high.
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 02:16am 01 Sep 2015
Copy link to clipboard 
Print this post

You can test it against an ice-point reference. Wrap the sensors in plastic (cling wrap) to keep them watertight and immerse them in a stirred water/ice mixture. The water and ice should be pure (i.e. de-mineralised) and you should read 0.0oC - assuming you're at sea level. If you're at a substantially higher altitude you'll need to correct for the lower pressure - Google that info.

Greg
 
rogersan
Regular Member

Joined: 10/04/2015
Location: Australia
Posts: 79
Posted: 11:58pm 01 Sep 2015
Copy link to clipboard 
Print this post

I tried putting the temperature sensors, wrapped in glad wrap, into an ice and water mixture. It was difficult to get good thermal coupling. The SHT21 got down to 0.2 degrees, the BMP180 to 1.2 degrees, and the DHT22 to 2.6 degrees (large sensor).

This method of testing did not work due to the poor thermal coupling. Perhaps a precision Mercury thermometer graduated in tents of a degree is a better way to check the sensors.
 
srnet
Senior Member

Joined: 08/08/2014
Location: United Kingdom
Posts: 164
Posted: 12:04am 02 Sep 2015
Copy link to clipboard 
Print this post

There might be initial differences in the thermal coupling, but assuming the devices are off so there is no device induced thermal heating, the devices should be at the same temperature after a short while.

And putting them in fridge for a while would be a good way of getting them close to 0c to start with, so they dont have to cool down all the way from room temperature.

Edited by srnet 2015-09-03
$50SAT is Silent but probably still working.
For information on LoRa visit http://www.loratracker.uk/

 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 01:14am 02 Sep 2015
Copy link to clipboard 
Print this post

  srnet said   There might be initial differences in the thermal coupling, but assuming the devices are off so there is no device induced thermal heating, the devices should be at the same temperature after a short while.

This is an important point which should be checked - the data sheet should give some info on this.

The other thing to watch is 'immersion depth'. Essentially that just means that the physical connections to the sensor, i.e. the wires and/or any shielding will conduct heat to the sensors so they need to be immersed enough such that this is minimised. Typical 'immersion depths' for reference thermometers are around the 100mm mark but it can be checked by immersing at say, 50mm, then 100mm, then 150mm, waiting till it stabilises at each depth and then always do your test work at least at the minimum immersion where going deeper no longer changes it.

It's surprising how much it changes if the ice/water mixture is not stirred or other precautions made to keep the mixture at 0.0oC. Years ago when I was doing alloy and compound cooling curves with thermocouples for phase diagrams, we used a vacuum flask with an insulating lid (cork with a hole in it) to hold the water/ice mixture. The cold junction was pre-dipped in wax to electrically insulate it and give reasonable thermal transfer. The emf of the thermocouple was measured by manually balancing a Wheatstone bridge to ensure no current was flowing which might affect the result.

You can't rush this - as @srnet says, it takes a while to stabilise the temperature.

Greg



 
isochronic
Guru

Joined: 21/01/2012
Location: Australia
Posts: 689
Posted: 07:15pm 03 Sep 2015
Copy link to clipboard 
Print this post

I agree, the device and ice/water mix has to be stirred vigorously.
Some devices have a slight current draw and are thus self-heated which can be dismaying. It is only a few milliwatts but it is enough to alter the temperature by a degree or so in some cases. BTW microchip have a new specific thermocouple handler chip just released, nice and cheap but the breakout kit costs much more !!
 
rogersan
Regular Member

Joined: 10/04/2015
Location: Australia
Posts: 79
Posted: 08:15pm 03 Sep 2015
Copy link to clipboard 
Print this post

I tried again with a stirred ice and water mixture. The glad wrap leaked (caused the humidity reading of the DHT22 to go to 1% until it dried out), so I used a zip lock plastic bag.

I still could not get good thermal coupling, the DHT22 lowest reading was 2.8 degrees, the SHT21 1.2 degrees, and the BMP180 0.7 degrees. So unfortunately it is not possible to use the ice and water mixture to check the accuracy of the sensors.
 
srnet
Senior Member

Joined: 08/08/2014
Location: United Kingdom
Posts: 164
Posted: 09:11pm 03 Sep 2015
Copy link to clipboard 
Print this post

Perhaps the real question is;

Which ones are more likley to exceed their rated accuracy ?

With the temperatures you gave, they could all be withing spec. Edited by srnet 2015-09-05
$50SAT is Silent but probably still working.
For information on LoRa visit http://www.loratracker.uk/

 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 10:37pm 03 Sep 2015
Copy link to clipboard 
Print this post

  chronic said   I agree, the device and ice/water mix has to be stirred vigorously.
Some devices have a slight current draw and are thus self-heated which can be dismaying. It is only a few milliwatts but it is enough to alter the temperature by a degree or so in some cases. BTW microchip have a new specific thermocouple handler chip just released, nice and cheap but the breakout kit costs much more !!

Would that be the MCP9600?

I have a few on order to make a little module.
Still searching for a good thermocouple connector.
One of the things i want to try out is to use a analog multiplexer to be able to measure more then one temperature.

Microblocks. Build with logic.
 
rogersan
Regular Member

Joined: 10/04/2015
Location: Australia
Posts: 79
Posted: 11:28pm 03 Sep 2015
Copy link to clipboard 
Print this post

I have ordered a Platinum Resistance Thermometer (PRT) which has a resistance of approx 100 ohm at 0 degrees. The resistance coefficient is 0.385 ohm/degree so it should be possible, after checking the resistance at 0 degrees in an ice/water bath, to measure temperature via a resistance measurement.

Hopefully the temperature measurement using the PRT will be quite accurate, and can be ued to check the BMP180, DHT22, and SHT21.
 
isochronic
Guru

Joined: 21/01/2012
Location: Australia
Posts: 689
Posted: 03:39am 04 Sep 2015
Copy link to clipboard 
Print this post

  Quote  Would that be the MCP9600?

Yes, I don't know anything more than reading the PR though.

I have also seen ordinary tungsten-filament light bulbs used to measure
temperature, useful but a bit drifty and fragile !
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 03:52am 04 Sep 2015
Copy link to clipboard 
Print this post

  rogersan said   I have ordered a Platinum Resistance Thermometer (PRT) which has a resistance of approx 100 ohm at 0 degrees. The resistance coefficient is 0.385 ohm/degree so it should be possible, after checking the resistance at 0 degrees in an ice/water bath, to measure temperature via a resistance measurement.

PRT's are easy to use and quite accurate. Their calibration and getting accurate resistance readings is the tricky part. Using the water/ice bath is definitely the best place to start.

Use a thermos flask or even a foam beer cooler with a cover (and two holes for the probe and stirrer). Fill it with ice (made from de-ionised water) and then add some de-ionised water. Stir it a bit to make sure the ice is loose in the mixture, then insert the probe and keep stirring till it stabilises then take your reading.

Depending on the range you want to cover you'll need to use another higher reference point as well because small non-linearities in the resistance probe will affect results. Boiling water (de-ionized) will give you the 100oC point (at sea level, 760mm Hg). If you want another reference point around this range, the napthalene melting point (80.26oC) is often used - as long as you know it's pure (a pharmacy should have some).

The way to use this is to melt it in a pot of some sort, take away the heating, insert the probe and put on a lid, wrap it all (including the base and top) in a good thermal insulator (e.g. small blanket) and carefully without disturbing it, let it all cool very slowly through the freezing point as you plot temperature (ohms) Vs time. The plot should slowly drop, then plateau (arrest) for a while, then drop again as it cools to ambient. The plateau (arrest temp) is the melting/freezing point. If you're not happy with your first run just re-melt it and go again!

If the arrest point isn't nice and horizontal it might be that your napthalene isn't pure or you may have disturbed it during the cooling.

A side benefit of course is that after all this you can be sure there'll be no moths or silverfish in the house.

Greg

 
rogersan
Regular Member

Joined: 10/04/2015
Location: Australia
Posts: 79
Posted: 12:52am 10 Sep 2015
Copy link to clipboard 
Print this post

I purchased an RS Components Thinfilm PT 1000 CCCN 90259000 Platinium Resistance Thermometer. I connected it between ground and an analogue input pin, and with a 1000 ohm resistor to the 3.3 volt supply.

Using the voltage measured, Vt= Rptr x 3.3 / (Rptr+1000) wher Rprt is the resistance ot the platinium resistance thermometer, or Rprt=1000 x Vt / (3.3-Vt).

If Ro is the resistance of the PRT at 0 degrees C then Rptr - Ro = Ro x .00385 x T degrees, and so
T degrees = (Rprt - Ro) / (Ro x .00385).

I use a distilled water and ice mixture to get Ro, then doubled checked to make sure the temperature calculated was 0 degrees with the PRT in an ice and water bath.

I then found that the PRT measured temperature tracked the BMP180, DHT22, and SHT21 within a few 10ths of a degree.
 
paceman
Guru

Joined: 07/10/2011
Location: Australia
Posts: 1329
Posted: 02:56am 10 Sep 2015
Copy link to clipboard 
Print this post

Well that's a pretty good result Roger. Looks like the DS18B20 is the sensor that's off a bit.

Greg
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025