Calibrate Temp Sensor

I am building a controller for a salt water reef aquarium that will turn on and off heaters, lights, fans, etc. based on the temperature of the water. I'm using DS18B20 sensors and I have three of them. In bench testing all three of them vary by up to 1 degree. In addition they all show higher than my standard thermometer on the wall although I can't really vouch for it.

My question is: How do people "calibrate" the sensors? I can vary the output in code to agree with the wall thermometer. In practical use the temp should only vary by 3 or 4 degrees. Is there a practical "known accurate" thermometer to be used for calibration?

harrysfrags:
I am building a controller for a salt water reef aquarium that will turn on and off heaters, lights, fans, etc. based on the temperature of the water. I'm using DS18B20 sensors and I have three of them. In bench testing all three of them vary by up to 1 degree. In addition they all show higher than my standard thermometer on the wall although I can't really vouch for it.

My question is: How do people "calibrate" the sensors? I can vary the output in code to agree with the wall thermometer. In practical use the temp should only vary by 3 or 4 degrees. Is there a practical "known accurate" thermometer to be used for calibration?

One method is to use 'known' temperature sources to validate/calibrate temp sensors. Boiling water (100C or 212F) and crushed ice baths (0c and 32f) are pretty easy standards to calibrate with, if your sensor is rated to the two temp values.

Other then that it's a "Man with one watch always knows the time, man with two watches never quite sure" situation. :smiley:

Lefty

Yeah use something known - water is common to use for calibration but I might suggest that you simply make them all roughly the same as if you need them more accurate than a degree or two you probably have the wrong sensors for your application.

Mowcius

retrolefty:
Boiling water (100C or 212F)

That would be at sea level only. As your altitude increases, the boiling temperature is lower.

That would be at sea level only. As your altitude increases, the boiling temperature is lower.

And that's only for pure water - what's your point?

My question is: How do people "calibrate" the sensors?

Having just looked over the datasheet for this sensor, I don't think the sensor has any internal method of calibrating the device. That would mean you would have to do that independently in your sketch by either adding or subtracting a calibration factor to the reading, and that assumes any sensor error is linear over your required operating range.

I guess a useful first step is to just run through a temperature range with the sensor using some other temperature sensor as a 'reference' and see what you have. Having worked in industry that dealt with calibrating process sensors I can say with pretty good confidence that words like calibration and accuracy need a lot of operational definitions applied before a successful plan can be applied.

Lefty

The spec sheet (http://datasheets.maxim-ic.com/en/ds/DS18B20.pdf) says accuracy is 0.5DegC.

It is a thermistor. From my past experience using $20-$40 thermistors, the interchangeability is 1DegC while accuracy is 0.5DegC or 1DegC. The spec sheet is not quoting interchangeability :wink:
You can't get better than around 1DegC. If you really want accuracy, you need a thermocouple.

Interchangeability: when two "identical" sensors are subject to the same temperature, their average difference in temperature reported.
Accuracy, when the same sensor is subject to the same temperature, the standard deviation of its fluctuating value.

So one sensor could keep reporting around 22DegC while another one keeps reporting around 23DegC. They are interchangeable around 1DegC.

I just checked here:

Seems like 5,000ft is the norm of lots of places in Colorado.

According to this:

Boiling point is 95DegC instead of 100 at that altitude. I think this is consistence with my memory. Most flat regions don't have to worry too much.

If you really want accuracy, you need a thermocouple.

At our refinery thermocouples were considered the cheaper solution for the vast majority of temperature measure points in our plants. However if the process required more accuracy we would use RTD sensors. Resistance thermometer - Wikipedia

RTDs vs ThermocouplesThe two most common ways of measuring industrial temperatures are with resistance temperature detectors (RTDs) and thermocouples. Choice between them is usually determined by four factors.

What are the temperature requirements? If process temperatures are between -200 to 500 °C (-328 to 932 °F), an industrial RTD is the preferred option. Thermocouples have a range of -180 to 2,320 °C (-292 to 4,208 °F),[8] so for temperatures above 500 °C (932 °F) they are the only contact temperature measurement device.
What are the time-response requirements? If the process requires a very fast response to temperature changes—fractions of a second as opposed to seconds (e.g. 2.5 to 10 s)—then a thermocouple is the best choice. Time response is measured by immersing the sensor in water moving at 1 m/s (3 ft/s) with a 63.2% step change.
What are the size requirements? A standard RTD sheath is 3.175 to 6.35 mm (0.1250 to 0.250 in) in diameter; sheath diameters for thermocouples can be less than 1.6 mm (0.063 in).
What are the accuracy and stability requirements? If a tolerance of 2 °C is acceptable and the highest level of repeatability is not required, a thermocouple will serve. RTDs are capable of higher accuracy and can maintain stability for many years, while thermocouples can drift within the first few hours of use.

mowcius:

That would be at sea level only. As your altitude increases, the boiling temperature is lower.

And that's only for pure water - what's your point?

"only for pure water" would be in the context of it boiling at 100c (at sea level).

Any water will have a different boiling point at altitude than at sea level, so this would need to be a known constant at the time and location of calibration, otherwise calibration would not be possible.

My point is, that it would be incorrect to try to calibrate a sensor to 100c using boiling water at 1000m altitude - kind of like the phrase "the blind leading the blind".

My point is, that it would be incorrect to try to calibrate a sensor to 100c using boiling water at 1000m altitude - kind of like the phrase "the blind leading the blind".

That was kind of a rhetorical question - Although true, it would make minimal difference in the application. You may get a degree or so difference for the kind of temps in this application (if you're boiling water at ~5000ft) but as the sensors aren't that accurate it's a moot point.

Pardon while I blow the dust off of this old thread on calibration, but after working my way through normalizations, then Ice & Steam points, I think I have finally arrived at a reasonable method to calibrate DS18B20 temperature sensors:

https://edwardmallon.wordpress.com/2016/03/05/ds18b20-calibration

We've been using a Thermopen, which will set you back about $200, but so far it's the cheapest reference quality solution I've found. Modify the wells in the aluminum block and you could adapt this method to any temperature sensor you wish.

EKMallon:
We've been using a Thermopen, which will set you back about $200, but so far it's the cheapest reference quality solution I've found.

Why not just buy a $10 thermistor with a ±0.05°C accuracy and (with a calibrated ohmmeter) use that for a reference?

I'm embarrassed to say I did not think of it (?)...mostly because I have not had a chance to play with high end thermistors yet. But it's a brilliant suggestion and I am going to add it to the blog post to help others.

Partly it's that I wanted the NIST traceable calibration certificate that came with the Reference Thermapen. Since our work is generally headed towards publication, we wanted that security blanket.

You don't need to sweat the petty things. A few degrees difference will not kill your livestock. What is more important is consistency, which the controller will do by keeping the tank temp consistent within a temperature range.

If you have not gone too far in your project, check out my reef aquarium controller project here.

ok, I just realized this is a resurrected thread.