Mass calibrating 4,000 DS18B20 sensors

I have noticed that the waterproof sensors take a long time to settle.
Much longer than i would expect.

When immersed in cold water, how long did you let them settle?

I'm not sure the difference between hard code and soft code. I would have thought the goal was to create an array 4000 x 3 containing

ID_____offsetfactor______gain factor

Once you have that you can do whatever you need.

By creating a serial output of the sensor ID
You can print it on paper, cut it out and with clear heatshrink label it forever.

Perhaps I misunderstand the goal of the above suggestion. The sensor ID's are
0 to FFFF FFFF FFFF FFFF. I would not like to try and read those numbers...ever.

When we performed thermal testing of a sensor, we monitored the output waiting for it to be stable within some number based on the device. Something like 1 deg C / hour or maybe 0.1 deg c / 10 minutes ....etc
In this case I wonder if the ice bath and / or the boiling water bath can be made that stable.

My point was to bundle - with a simplistic user experience, no electronic degree required - into the code the calibration process each time you add a new sensor to the Arduino package (assuming one arduino drives more than one sensor).

if you can define a process that will get you within your precision/accurancy range that is performed on the point of installation, you'll benefit from distribution of labour.

This will be required anyway when a sensor fails for whatever reason. (5% failure rate per year will give you more than 1 sensor t change every other day) as the code will need to be adjusted dynamically.

I also assume there is a way to automatically report what the sensors capture to some sort of central point. If one of the sensors from the same Arduino (supposedly not to far geographically) is reporting something that stands out (like far from standard deviation of the other sensors) then you might know something is wrong and trigger a maintenance operation (change or re-calibrate).

Real world temperature accuracy better than 0.5 C is pushing most technologies .

How do you know you have 0 and 100C ? ( did you pressure correct boiling point of pure water ?) . You need expensive temperature references and a stired insulated water bath to calibrate properly .
The main error with ds18b20 is caused by the curve in its response , most of the error is. A used by that , so a two point calibration won’t “fix” it and may make mid span reading more inaccurate ( see data sheet) Have a look at what your project needs and what accuracy you actually need .

Most of the cheap sensors are fake or rejects that don’t make the performance spec.

I was always curious on how the fake or clones were given the 64bit ID numbers. I wonder if in 4000 devices the ID's will all be unique.

25th hour production and reset of the serialiser if done in the factory.... You'd be amazed at what can happen ! so indeed there is a slight chance if you buy a real unit and a Side-produced one to end up with the same serial... rare though.

what often happens too though, is that there is a process to reject parts that do not meet the minimum quality expected by whoever ordered the parts. Some smart people know where the trash can is...

Given the information @hammy added, I was thinking...

Might it be better to test them all at a temperature near the expected data temperature?

And do you really need absolute accuracy, or do you only need them to be "calibrated" as a group? I'm guessing what you might be better off being able to "normalize" your data relative to the other sensors.

Trust me I've been involved in "accurate" temperature measurement numerous times in my career. You can easily drive yourself crazy chasing the holy grail of "absolute accuracy" especially with clone/fake sensors. I would be more inclined to verify they were stable and you knew how they related to each other. I'm going to take a guess here and guess your project was more about change and related temperature than absolute temperature.

JR, that's right. It seems that harmonizing them would be good enough.
If I had to really (calibrate) harmonize these probes, even (and especially fakes or clones) I'd do it like this (but it's a big job, requiring a lot of precision; I wouldn't sell the probe for 3 times more, but 15 or 20 times :wink: )

Calibration on the narrowest possible range (the soil to be measured varies between 0°C and 30°C ? so calibration point at 5°C and 25°C, calculation of the slope and the offset for each probe; the ds18x20 probe has some eeprom bytes that will receive the data that will allow the future correction calculation on this range (y=ax+b); of course, outside these values, the probe might be even more wrong (or you do not correct outside these limits)
To (calibrate) harmonize, water bath and set of 50 or 100 deeply immersed probes, stabilization time in hours, we recalibrate the probes on the average of the 50. .100 probes read (or reference thermometer accurate to 1/10 °C), measurement function of the 2 calibration points, calculation of correction, writing in eeprom, and there you go! big job. But the measurement of the probes, even clones, will be more coherent over the whole set.

(Fake max232 are something else to look out for )

Sounds good. One thing I would suggest, discard any sensors that are way out of the norm. I don't know but I would guess their stability might be suspect as well.

I use thin rings of colored heatshrink
To identify probes.

You could use blue for anything half degree high than 0
Red for half deg less than o
yellow for anything inbetween

Then use a second band at 100
Same color pattern

4000 original DS18B20 can be bought for about US$2.50+tax/freight, depending on where you live.
That might be a much better solution then trying to tame 4000 fake sensors.

I guess it is if you have an extra $8000. However I'll guess if you really went to order 4000 pcs you could negotiate a lower price.

I think this task is kind of strange anyway. I guess we'll see.

BUdget need also to include the Arduinos - probably hundreds of them, custom PCB etc. So there is a sizeable cost there

But The true costs of any project with this number or acquisition points will be in the manpower required for preparing, deploying and maintaining Whole project probably

It depends on the project: is it one project with 4000 probes, or are they multiple different installations with 50 probes each? it's not the same thing ! it's possible with the second approach, the margin on the first installations sold allows to buy the material in bigger quantities for the following installations; I did it for these quantities. hashbrake doesn't give any indication if it's a 4000 probes project, or several 50..100 probes customers. hashbrake, can we have more details about this project? (we won't say anything, let's keep it to ourselves :wink: )

Of course if it is for selling a « small scale » solution multiple times then it’s a different equation. I had assumed it’s a large scale test as OP stated

The result of my experiment was good and I would like to scale it by a factor of 200 - so 4,000 sensors.

Buy 20 of the authentic sensors
Get a roll of 3 conductor wire
Stainless cans

Whip up a batch of probes
Test them

If they are all close in reading
Then the labor to make is the expense.

If not then the the time calibrating is required either way.

As for testing.
You have a very specific need.
5 point testing is called for

10 degree lower than your expected low
At your expected low
Mid point
At your expected high
10 deg higher than the expected high.

Look at the ADC curve of the ESP32 .
Plot you findings on that curve
Shake your head , say WTF.....
Re-evaluate your actual use and adjust your test procedures accordingly.

The heat shrink bands will allow you to quickly create groups of identical devices

Thank you all for your amazing replies, it has been fun and educational to read through your answers. Taking everything into consideration - accuracy needed, complexity of calibration procedure, cost of sensors/PCB/etc... - I have decided the following:

  • I convinced my project manager to reduce down to 100 AUTHENTIC sensors as this would improve the reliability and life span of the sensors (yes that's a big decrease but we've figured out ways to make it work).
  • Improve their waterproofness with epoxy and heat shrink tube.
  • For the calibrating procedure it will be:
  1. Get all the addresses of the sensors and store them in an [100] array
  2. Wire all of them on an Arduino (or as much as it will detect) and dunk them in ice/boiling water - the exact temperature of the water will be measured using one of those $$$ reference thermometers
  3. Once the temperature readouts stabilise, store them in a separate [100] array (and maybe take the average for each sensor if there are small variations)

In the end, I will be left with three arrays (address, temp. readouts at ice water, and temp. readouts at boiling water) which can easily be passed through a calibrating function. I could possible create 2D array - to be decided.

Thank you all for your input!
Have a nice day and see you around XD

Whatever epoxy you use make sure its not a rock solid epoxy but has a little give in it when cured. Solid epoxies will start to leak at any interface over time. Also verify it adheres to your wires.

1 Like