iwiber
Posts: 9
Joined: Thu May 02, 2019 1:43 pm

My temp sensor ds18b20 doesn't seems accurate

Mon May 13, 2019 12:11 pm

Hi guys,

My ds18b20 is off (lower) by 3 to 5 °F randomly and I'm not sure what to test anymore. I put together a new one, same results. I followed this plan, with the exact same resistance.

Image

I assume it's off because, I test with a pool thermometer, and I also use an Aqua Euro Max Chill 1/2 HP Chiller, which indicates the temp. As I'm writing this:

Pool Thermometer: 58°F
Chiller: 55°F
ds18b20: 53°F

The pool Thermometer I'm using is cheap ($4), but the chiller it's another story ($1000+). Also, it's the first time the difference is over 1° betweem the pool thermometer and the chiller.

What do you guys think?

B.Goode
Posts: 7718
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: My temp sensor ds18b20 doesn't seems accurate

Mon May 13, 2019 12:24 pm

My ds18b20 is off (lower) by 3 to 5 °F randomly

Ref: https://www.maximintegrated.com/en/prod ... 18B20.html
The DS18B20 digital thermometer provides 9-bit to 12-bit Celsius temperature measurements

So one 'obvious' question (to my inquiring mind) is: how are you converting the temperature? (Could there be a repeatable or random error in that calculation?)

Are all the readings taken simultaneously at the same point, free from convection, currents, eddys...

User avatar
bensimmo
Posts: 3956
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: My temp sensor ds18b20 doesn't seems accurate

Mon May 13, 2019 12:32 pm

It's much easier to debug in C as the device measures in C.
Are you reading 11.5 and 12.0C or do you get the values in between.
Or lot read to half a degreeC by default

...
So the difference between 53F and 55C is just 1C, these have a 0.5C accuracy iirc, so if the reading is between two, that may be you full degree C out
Couple that with a conversion and the rounding.

Which seem pretty good to me.
Last edited by bensimmo on Mon May 13, 2019 12:36 pm, edited 1 time in total.

pcmanbob
Posts: 5910
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: My temp sensor ds18b20 doesn't seems accurate

Mon May 13, 2019 12:33 pm

Well no temperature sensor is 100% accurate unless its been calibrated against a known good / calibrated thermometer.

The DS18B20 has an accuracy of ±0.5°C Accuracy from -10°C to +85°C, but its still possible yours might be outside the error range depending were you got them from there of lots of rejects for sale on the web.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
bensimmo
Posts: 3956
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: My temp sensor ds18b20 doesn't seems accurate

Mon May 13, 2019 12:43 pm

pcmanbob wrote:
Mon May 13, 2019 12:33 pm
Well no temperature sensor is 100% accurate unless its been calibrated against a known good / calibrated thermometer.

The DS18B20 has an accuracy of ±0.5°C Accuracy from -10°C to +85°C, but its still possible yours might be outside the error range depending were you got them from there of lots of rejects for sale on the web.
Official proper DS18B20 are calibrated at source, they still have the ±0.5°C Accuracy you mention.

The cooler will have an accuracy as well, perhaps a response time too.

Andyroo
Posts: 2864
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: My temp sensor ds18b20 doesn't seems accurate

Mon May 13, 2019 12:57 pm

I would ask how you know the other thermometers are correct? Just because they show the same temperature does not mean they are right.

Having worked for many many years with temperature controlled warehouse logging and reporting kit (some costing £k to set up), you have to go to an external calibration tool (with its calibration history) to set your kit up.

Given that most folk cannot tell a change of one or two degrees centigrade, I would not worry :lol: humidity is a greater factor in how ‘warm’ or how ‘cold’ people think it is than most folk understand.

Then again, this is being posted by a guy who has a clock in the room with no numbers on it so you may want to take a pinch of salt with the above :roll:

If you really need them to show the same temperature then you could always build a fudge factor into your program even if it’s a dictionary (assuming python) look up for each temperature:

[14: 1, 15: -2] etc where the key is the temp from the device and the data is the adjustment (code not checked :lol: )
Need Pi spray - these things are breeding in my house...

iwiber
Posts: 9
Joined: Thu May 02, 2019 1:43 pm

Re: My temp sensor ds18b20 doesn't seems accurate

Mon May 13, 2019 1:06 pm

Hi guys,

In C:

DS18B20 = 11.6
Pool T. = 14.4

For the chiller I can't say, should be between 12.8-13.2

Andyroo
Posts: 2864
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: My temp sensor ds18b20 doesn't seems accurate

Mon May 13, 2019 1:12 pm

Sorry but you have three uncalibrated devices, any one could be correct OR all three could be wrong.

I’ll bet my money on the last :roll:
Need Pi spray - these things are breeding in my house...

iwiber
Posts: 9
Joined: Thu May 02, 2019 1:43 pm

Re: My temp sensor ds18b20 doesn't seems accurate

Mon May 13, 2019 1:22 pm

Any good ways to verify the real temp with quite good accuracy? I mean, besides a $50000 unit lol

Andyroo
Posts: 2864
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: My temp sensor ds18b20 doesn't seems accurate

Mon May 13, 2019 1:50 pm

Four ways I can think of (though the guys at http://www.wxforum.net/ may have more):

Ice and boiling water assuming you do not live high in the mountains but even then you get differences due to the accuracy of the device sensor and risk killing the device.

If you know a store keeper who has fridges / freezers that are checked by the local health inspectors or council you could ask them to borrow a bit of space :lol:

Look for an official weather station locally and see if they have manual readings or if you can get a live feed from them.

The last way is to raid eBay / Amazon etc and buy a pile of cheap sensors and pick the ones that are close to each other :lol:

Just to really wind you up :lol: you also need to think about direct / indirect sun light, wet vs dry readings and even wind chill factor :roll: As soon as something goes digital the requirement for accuracy seeps into our brains - rather than ‘it is about 10 deg’ we need to see ‘it is 10.123456 deg’ :lol:

I’m more a https://en.m.wikipedia.org/wiki/Weather_rock type of guy - accuracy is fine for work when customers demand it or public health is involved but the cost outweighs the string and stone solution.
Need Pi spray - these things are breeding in my house...

User avatar
omegaman477
Posts: 140
Joined: Tue Feb 28, 2017 1:13 pm
Location: Sydney, Australia

Re: My temp sensor ds18b20 doesn't seems accurate

Mon May 13, 2019 5:43 pm

iwiber wrote:
Mon May 13, 2019 1:22 pm
Any good ways to verify the real temp with quite good accuracy? I mean, besides a $50000 unit lol
Boiling water and ice in distilled water, compensate for your altitude, there are online calculators.

But I would bet your only reading the top 9 bits and calculating against that, rather than the full 12. Or you have the two 'bytes' assembled in the wrong order.
..the only thing worse than a stupid question is a question not asked.

iwiber
Posts: 9
Joined: Thu May 02, 2019 1:43 pm

Re: My temp sensor ds18b20 doesn't seems accurate

Mon May 13, 2019 5:48 pm

omegaman477 wrote:
Mon May 13, 2019 5:43 pm
iwiber wrote:
Mon May 13, 2019 1:22 pm
Any good ways to verify the real temp with quite good accuracy? I mean, besides a $50000 unit lol
Boiling water and ice in distilled water, compensate for your altitude, there are online calculators.

But I would bet your only reading the top 9 bits and calculating against that, rather than the full 12. Or you have the two 'bytes' assembled in the wrong order.
Hello,

Not sure if you're referring to this, but I take the t= / 1000

c0 00 55 05 7f a5 a5 66 94 : crc=94 YES
c0 00 55 05 7f a5 a5 66 94 t=12000

Andyroo
Posts: 2864
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: My temp sensor ds18b20 doesn't seems accurate

Mon May 13, 2019 6:31 pm

The t= does give you the temperature directly - no changes needed and it’s one of the reasons I like those chips.

The conversion to that odd measurement scale is straightforward and should not loose any real accuracy but do not forget if two accurate sensors are used you still may see a 1 deg C difference as one could be -0.5 and the other +0.5 so assuming it’s 0C you would read 31.1F and 32.9F - both are correct as they are in spec but the 31-33 range looks a lot to the mind...

This is assuming you have a real chip and not a ‘quick and dirty’ copy that may be a few deg C out or have a larger inaccuracy.
Need Pi spray - these things are breeding in my house...

JohnsUPS
Posts: 91
Joined: Fri Jul 06, 2018 2:13 am
Location: USA

Re: My temp sensor ds18b20 doesn't seems accurate

Wed May 15, 2019 1:18 am

I have had this happen to me also.

Where were the sensors purchased?

I have about 30 of these sensors. 10 each were purchased from three different vendors. Two of the vendors were of Chinese origin, and the other was Mouser.

After the first order of 10, I realized they were not calibrated because they were not tracking each other to within the published specs - they should have at least tracked within about 1 deg C of each other. So, I ordered another 10 from a different Chinese vendor - same result - differing readings. Finally decided to spend a buck more per sensor and ordered some from Mouser (Digi-Key would also source directly from Dallas/Maxim). All of these sensors tracked each other perfectly - I recall it was much better than half a degree C. Not having any other temperature references handy (that were as accurate) for absolute comparison, I trusted that the Maxim sensors were in calibration partially because they all tracked each other so well.

The Chinese temperature sensors were all out of calibration (compared to the Maxim parts), and one was off by about 3 degrees C. I had six of the "bad" sensors in parallel, mounted next to each other in a row, so they all saw the same ambient temperature and source voltage, but the readings varied. Readings were consistent up or down depending on the room temperature, but all offset from one sensor to the next. The good sensors were deployed with a project I had going on at the time. To possibly get some use from the counterfeit sensors, I calculated offsets. I averaged the readings from four known good sensors (the "calibration standard") compared to one "bad" one. All wired in parallel and very close in physical proximity in order to calculate offsets for the bad sensors.

I would recommend that when it comes to these sensors, source from a reputable vendor and save some heartburn.

iwiber
Posts: 9
Joined: Thu May 02, 2019 1:43 pm

Re: My temp sensor ds18b20 doesn't seems accurate

Wed May 15, 2019 9:24 am

JohnsUPS wrote:
Wed May 15, 2019 1:18 am
I have had this happen to me also.

Where were the sensors purchased?

I have about 30 of these sensors. 10 each were purchased from three different vendors. Two of the vendors were of Chinese origin, and the other was Mouser.

After the first order of 10, I realized they were not calibrated because they were not tracking each other to within the published specs - they should have at least tracked within about 1 deg C of each other. So, I ordered another 10 from a different Chinese vendor - same result - differing readings. Finally decided to spend a buck more per sensor and ordered some from Mouser (Digi-Key would also source directly from Dallas/Maxim). All of these sensors tracked each other perfectly - I recall it was much better than half a degree C. Not having any other temperature references handy (that were as accurate) for absolute comparison, I trusted that the Maxim sensors were in calibration partially because they all tracked each other so well.

The Chinese temperature sensors were all out of calibration (compared to the Maxim parts), and one was off by about 3 degrees C. I had six of the "bad" sensors in parallel, mounted next to each other in a row, so they all saw the same ambient temperature and source voltage, but the readings varied. Readings were consistent up or down depending on the room temperature, but all offset from one sensor to the next. The good sensors were deployed with a project I had going on at the time. To possibly get some use from the counterfeit sensors, I calculated offsets. I averaged the readings from four known good sensors (the "calibration standard") compared to one "bad" one. All wired in parallel and very close in physical proximity in order to calculate offsets for the bad sensors.

I would recommend that when it comes to these sensors, source from a reputable vendor and save some heartburn.

I guess it's that then. I bought from Amazon but just saw the manufacturer is called Esooho

Return to “Automation, sensing and robotics”