Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:20 01 Aug 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 : 18B20 sensor vs others - who to believe.

     Page 1 of 2    
Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 10:32pm 08 Feb 2019
Copy link to clipboard 
Print this post

Howdy.

I just want to check I am not chasing my tail here.

18B20 sensors give a reading - such as 23.5'C, but the mercury thermometer beside it says 20'C. A digital thermometer beside them both agrees with the mercury thermometer.(says it is also 20'C)

I have tried about three different 18B20 sensors, and they all return the same result, so I don't think I just have a crook 18B20 sensor.

If I put an AM2302 humidity/temp sensor on another pin(with pullup etc), and read IT, I get a reading of 23.8'C, so it is MUCH closer to the 18B20 result then either the mercury one or the external digital thermometer - only 0.3'C difference, and I can live with that just fine, but I DO need 0.5'C or so accuracy. 3'C is way off when you want accurate measurements.

I'm just wondering which one is correct?

Is it safe to say that the 18B20 is a logical reference point for accurate temperature, and thus, I can pretty much ignore the results from the mercury and external digital units?

I would have thought the external digital thermometer would have been accurate though, but it appears to be about 3'C out, which is a lot for a digital unit I would have thought.....

However, the digital one is just a cheap NOT-LAB-CERTIFIED one I got from the local hardware store, so perhaps.....?
Smoke makes things work. When the smoke gets out, it stops!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 10:59pm 08 Feb 2019
Copy link to clipboard 
Print this post

A long time ago, when I needed a reasonably accurate thermometer, I went to the thermometer shop and looked a 10 thermometers, all placed close together. I chose one that read in the middle of the range.

You could raid the freezer and make an ice-bath. I remember doing that back at high school.

I don't remember much from then...

Jim

https://globaltemp.com.au/calibrating-your-thermometer-fact-sheet
The temperature of boiling water depends on atmospheric pressure. Something the link above fails to mention.
Edited by TassyJim 2019-02-10
VK7JH
MMedit
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 11:03pm 08 Feb 2019
Copy link to clipboard 
Print this post

Good morning Grogster

How confident are you in the mercury thermometer? I think you should start with a guarenteed glass device and rely on that because things like self heating, software funnies, you name it, can complicate things electrical.
I am still waiting for some BME280s to arrive and I'm sick of listening to Tom Petty.
Good luck.

Peter
 
JohnL
Senior Member

Joined: 10/01/2014
Location: Seychelles
Posts: 128
Posted: 11:36pm 08 Feb 2019
Copy link to clipboard 
Print this post

Grogster,

I posted something similar in one of your other topics, but deleted it after I thought that it is not my business to tell you how to learn. Tell me if its out of order and I will shut up.

You need to learn some fundamentals before gasping for "how long is a piece of string" answers.

How much research and reading have you done to understand how 18B20 sensors work?

Most of you guys are hobbyists with relatively little technical knowledge, but there is a point where you will have to learn rather than just keep on guessing and gasping for answers from other people.

https://datasheets.maximintegrated.com/en/ds/DS18B20.pdf

This is a technical data sheet for the sensor that will tell you everything you need to know. But if you don't understand and don't know how to read data sheets then I strongly suggest that you roll your sleeves up and start learning. Ohms law, basic DC and AC theory, at least basic digital electronics. Would strongly advise that you also learn basic 8 bit microcontroller fundamentals and eventually move to 32 bit.
All of this stuff is available online these days with video/youtube tutorials.

I became an engineer by having a passion for electronics and microcontrollers, but also had to do the hard yards and learn all the theory for a very good reason. With evolving technology, learning is an ongoing process.

Other questions you need to ask your self:

1. Is it a genuine product from reputable supplier? If yes then data sheet from the original manufacturer will tell you everything you need to know.

I hope that you are not offended by advice.

Cheers.Edited by JohnL 2019-02-10
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 11:51pm 08 Feb 2019
Copy link to clipboard 
Print this post

I wonder if the software conversion of the data from the sensors is wrong?

Can you get the raw values? (And post the value the non-sensors show.)

John (who is thinking Grogs can read a datasheet rather well...)

Edited by JohnS 2019-02-10
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 12:01am 09 Feb 2019
Copy link to clipboard 
Print this post



Peter
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 01:16am 09 Feb 2019
Copy link to clipboard 
Print this post

DS18B20 claims +-0.5 degrees
HTU21D claims +-0.3 degrees
BMP180 claims +-1.0 typical up to +-2.0 at 3.3V
AM2302/DHT22 claim +-0.5 typical up to +-1.0

I have 4 running in close proximity.
  Quote  
12:11:26
T(BMP180) : 20.7
T(DHT22) : 20.4
T(DS18B20): 20.5
T(HTU21D) : 20.3

I don't use parasitic power on the DS18B20

All sensors from eBay so quality unreliable.

Jim
VK7JH
MMedit
 
Paul_L
Guru

Joined: 03/03/2016
Location: United States
Posts: 769
Posted: 06:24am 09 Feb 2019
Copy link to clipboard 
Print this post

Get a bunch of ice, preferably shaved or crushed, if it's cubes shave it if you have a high power blender, get an insulated coffee cup, pre chill it with ice water, dump it out, pack it full of shaved ice with the pre chilled sensors imbedded, keep the sensors above the melt water accumulating in the bottom, (it's warmer than the ice), pour off the melt water as it accumulates, wait 15 minutes, read the sensors.

Get some distilled water, forget about altitude correction - your house is about 40 feet above sea level, bring it to a boil, dip the sensors in for at least 3 minutes and read them.

You now have a two point calibration.

The band gap sensors depend on the ratio of the area of two sensors both of which are silicon pn junctions. Their linearity is absolute and predictable, depending on fundamental physics and can be calculated with the inclusion of Boltzman's constant.

The thermistor in the AM2302 is subject to linearity variance due to impurities in the resistive element. It is less trustworthy than the fundamental physics of the band gap.

The precision of the capillary tube in the glass thermometer is a complete unknown.

I have no idea about the thing you bought in the hardware store.

After the two point calibration trust the band gap sensors!

Paul in NY
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 07:07am 09 Feb 2019
Copy link to clipboard 
Print this post

Lots of replies - thanks chums.

@ PeterB - No idea on the accuracy of the mercury thermometer at all. That is part of the problem. What I need is an accurate reference point.

@ JohnL - Yep, I have the datasheet, and have read through it, but although it says it has a 0.5'C accuracy, the results I get from IT are not within where the other ones say the temperature is, so it got me wondering if the 18B20's are actually as accurate as the datasheet says they are, when other thermometers show quite significantly different temperatures. Yep, I do know how to read a data sheet, and did my Electronics theory exam years ago with Ohm's law, Lenz's law and all those other laws. I must admit that some of it has probably slipped a bit, but on-line calculators exist for all those formulas these days.

Not offended by advise.
You can't learn, if you can't listen.

However, the datasheet saying that it has this accuracy, but that not jiving with other thermometers placed in the same place just makes me wonder how trustworthy the results REALLY are.

I cannot remember where I got those 18B20's from, but they are quite possibly clones from eBay, so I will make sure I get some genuine ones from element14 in my next order. Perhaps that is actually the problem - who can say.

@ TassyJim - No, I am not using parasitic power on my 18B20's. I had an issue with that once before, and since then have decided to power them with 'Real' power rather then parasitic power.

What makes me wonder, is that the mercury thermometer(an unknown) and the AM2302 humidity/temperature sensor(an unknown) BOTH show about the same temperature, but the 18B20 shows a different temperature by a few degrees, so which one is right?

I think at this point, I need to test some GENUINE 18B20's, so I will order some to make sure I have the genuine one and not a clone.

@ Paul_L - Good advice, thanks. I will try that in the next few days.
Smoke makes things work. When the smoke gets out, it stops!
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 07:23am 09 Feb 2019
Copy link to clipboard 
Print this post

  Quote   your house is about 40 feet above sea level


I'm wondering about that, just saw a news item that stated IKEA sell a map of the world with New Zealand missing. Though it may have sunk.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 07:26am 09 Feb 2019
Copy link to clipboard 
Print this post

Are you still above sea level?

Peter
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 07:26am 09 Feb 2019
Copy link to clipboard 
Print this post

Well, DigiKey list New Zealand as part of Australia - so whaddya think of that?!




Smoke makes things work. When the smoke gets out, it stops!
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 07:29am 09 Feb 2019
Copy link to clipboard 
Print this post

I meant is palcal above sea level?
They have been a bit greedy with the rain of late...........typical
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 07:59am 09 Feb 2019
Copy link to clipboard 
Print this post

  Grogster said   Well, DigiKey list New Zealand as part of Australia - so whaddya think of that?!

Maybe they're listing by continent?

John
 
GoodToGo!

Senior Member

Joined: 23/04/2017
Location: Australia
Posts: 188
Posted: 08:05am 09 Feb 2019
Copy link to clipboard 
Print this post

Naaa, New Zealand is just another suburb of Sydney......

Cheers,

GTG!
...... Don't worry mate, it'll be GoodToGo!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9610
Posted: 08:19am 09 Feb 2019
Copy link to clipboard 
Print this post

@ everyone outside of Australia and New Zealand reading these last few posts - we like to poke fun at each other, and there is no malice in it, it's all in good fun. So don't worry.
Smoke makes things work. When the smoke gets out, it stops!
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 09:02am 09 Feb 2019
Copy link to clipboard 
Print this post

G'Day Paul_L

If you can get a bucket of water from the local creek, bung it in the fridge until it goes lumpy and say "yep 0"
Then put the same water on the stove, boil the crap out of it and say "yep 100"
Then take those two points and plot them on the bit of paper your lunch came in, find 20 0r 30 and claim that that is more accurate than my 300mm reasonably expensive glass thermometer I will eat my hat.


Peter
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 09:04pm 09 Feb 2019
Copy link to clipboard 
Print this post

@ PeterB
Sun out for first time in two weeks yesterday, the total I got here 60KM. north of Townsville was 1,544mm.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
Paul_L
Guru

Joined: 03/03/2016
Location: United States
Posts: 769
Posted: 09:24pm 09 Feb 2019
Copy link to clipboard 
Print this post

  PeterB said   G'Day Paul_L

If you can get a bucket of water from the local creek, bung it in the fridge until it goes lumpy and say "yep 0"
Then put the same water on the stove, boil the crap out of it and say "yep 100"
Then take those two points and plot them on the bit of paper your lunch came in, find 20 0r 30 and claim that that is more accurate than my 300mm reasonably expensive glass thermometer I will eat my hat.


Peter

The boiling point will change considerably depending on the amount of salts and other minerals in solution with the water. The local creek will provide water sourced mostly from rain -- if you filter out the organic compounds it picks up from decaying leaves and the like it will be pretty close to distilled water. Well water will be more likely to have absorbed minerals.

The freezing point of creek water will change very little with the inclusion of organics. Well water can have its freezing point depressed when salts go into solution.

The solution to all this is to go to the nearest auto parts store where they usually sell jugs of "distilled" water to replace water that has evaporated out of lead acid batteries. Nowadays that stuff is usually produced by osmotic filtration but it's good enough. You could also collect some rain water, but then I guess you guys down under have forgotten what rain is.

Of all the various physical standards the freezing point of water is the one that is most easily established precisely. The chief difficulty in establishing the boiling point is pressure altitude ... but Grogs doesn't live up the side of a mountain.

Paul in NY
 
Paul_L
Guru

Joined: 03/03/2016
Location: United States
Posts: 769
Posted: 09:29pm 09 Feb 2019
Copy link to clipboard 
Print this post

  palcal said  
  Quote   your house is about 40 feet above sea level


I'm wondering about that, just saw a news item that stated IKEA sell a map of the world with New Zealand missing. Though it may have sunk.

Just start up Google Earth, type in Mosgiel, NZ, and it displays Grogster's town with the altitude of the cursor. It's close enough so that you can see the altitude of each end of my driveway which is 100 feet long.

Paul in NY.
 
     Page 1 of 2    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025