element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sensors
  • Technologies
  • More
Sensors
Sensor Forum Temperature sensor accuracy
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Sensors to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 38 replies
  • Subscribers 314 subscribers
  • Views 4044 views
  • Users 0 members are here
  • temperature
  • temperature sensor
Related

Temperature sensor accuracy

ntewinkel
ntewinkel 9 months ago

Hi all,

I have two temperature sensors near each other, outside. In the winter I was using one to keep track of the nectar temperature in a hummingbird feeder, but I just left it hanging there for the summer.

Here is the typical result:

image

The top line is a dht11 or could be 12. It includes pressure and humidity. The bottom line is a ds18b20 in a metal tube.

Both are digital, but one is nearly always about 1 or 2 degrees higher than the other. Generally it’s fine to give me a close enough idea of what’s going on, but I think I should be more accurate when looking at the freezing point.

Do I need to calibrate them? How would I go about doing that? Ie, what can I trust as a proper baseline? I don’t have access to any really guaranteed kind of thermometer, I think. Thinking 

Thanks in advance for any wisdom you can send my way!

-Nico

  • Sign in to reply
  • Cancel

Top Replies

  • dougw
    dougw 9 months ago +5 verified
    If they are waterproof you can stick them in a slush of ice and water to get a zero degrees reference. If they aren't waterproof you can put them in a plastic bag in the ice/water mix. If they can take…
  • beacon_dave
    beacon_dave 9 months ago +5 verified
    Comparing data sheets it looks like the accuracy of the DHT11 is ±2°C whereas the DS18B20 is ±0.5°C It will be interesting to see what your testing shows.
  • wolfgangfriedrich
    wolfgangfriedrich 9 months ago in reply to dougw +4 verified
    During the ice-water test, you have to be careful not to touch the ice-cubes. They are still colder than zero degC. I learnt this during a thermocouple roadtest.
  • dougw
    +1 dougw 9 months ago

    If they are waterproof you can stick them in a slush of ice and water to get a zero degrees reference. If they aren't waterproof you can put them in a plastic bag in the ice/water mix.

    If they can take 100 degrees, you can put them in a plastic bag in boiling water for a second reference point.

    This will tell you which sensor is more accurate and allows 2-point (linear curve fit) calibration.

    • Cancel
    • Vote Up +5 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • ntewinkel
    0 ntewinkel 9 months ago in reply to dougw

    Thanks Doug!

    I think the ds18b20 is water proof, I’ll give that a shot.

    I didn’t realize these things needed the ole physics class tricks to get them set up!

    And then do I just add or subtract from the readings they give?

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • dougw
    0 dougw 9 months ago in reply to ntewinkel

    If a subtraction fixes both zero and 100 than that is all that is needed. If it doesn't fix both readings, you need to add or subtract a number and multiply by a scaling factor so that the result matches both at 0 and at 100. If you publish your readings we can explain how to calibrate them. 

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • beacon_dave
    +1 beacon_dave 9 months ago

    Comparing data sheets it looks like the accuracy of the DHT11 is ±2°C

    image

    whereas the DS18B20 is ±0.5°C

    image

    It will be interesting to see what your testing shows.

    • Cancel
    • Vote Up +5 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • wolfgangfriedrich
    +1 wolfgangfriedrich 9 months ago in reply to dougw

    During the ice-water test, you have to be careful not to touch the ice-cubes. They are still colder than zero degC. I learnt this during a thermocouple roadtest. 

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • ntewinkel
    0 ntewinkel 9 months ago in reply to beacon_dave

    I’m pretty sure mine are from “questionable sources”, so I wonder if they might be defects that didn’t fall within the correct parameters Thinking 

    Given what you’ve just pointed out though, it seems that a close enough 80-20 solution is to adjust the dht values to match the ds18b20 numbers.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    +1 shabaz 9 months ago

    Hi Nico,

    If required, these types of boards are quite neat to act as a sort of semi-reference. The accuracy is claimed to be +- 0.1 degrees C within a certain range. I have an older model that claims +- 0.3 degrees C I think.

    They can be accessed via Bluetooth on mobile, and can show historical data as well. Link: https://www.newark.com/sensirion/sht4x-smartgadget/ref-design-board-temp-humidity/dp/74AJ2003 

    image

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • ntewinkel
    0 ntewinkel 9 months ago in reply to shabaz

    Thanks for pointing that out, that's really accurate!
    That would solve the problem of which sensor to trust as a baseline.

    A man with a watch knows what time it is. A man with two watches is never sure Laughing

    I've added it to my wishlist Slight smile

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ntewinkel
    0 ntewinkel 9 months ago in reply to wolfgangfriedrich

    Good point, thanks for the heads-up on that. I would have been tempted to do exactly the wrong thing!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • battlecoder
    0 battlecoder 9 months ago

    I've also observed ~ 2° differences when comparing temperature sensors,  and in most cases that's their actual stated accuracy.

    As others have told you, you can measure known temperatures and see what the sensors read at those points, and you can do a simple fit regression over them.
    For two points is a lot simpler.
    Let's say, for example, that you measure the ice melting point (which should be 0°C) and the thermometer says it's 2°C. Then you measure the water boiling point (that should be 100°C) and the sensor reads 99°C That means that near 0 degrees the sensor is measuring 2 degrees higher, and near 100 is 1°C too low.


    You want to create a linear function that takes the sensor reading and converts it into a "closer to reality" reading, this is: F(what_the_sensor_says) = what_it_should_be
    So F(-2) = 0 and F(99)  = 100.

    Since we assume the relationship is linear, the function would have the form F(x) = m*x + b

    We can compute the slope (m) with our two points, as [F(x2) - F(x1)] / (x2 - x1), In my example that would be  (100 - 0) / (99 - [-2]) = 100 / 101 = 0.9901

    Our function is looking like this now:

    F(x) = 0.9901*x + b


    We only need to compute b. Replacing any of the two values we know, should allow us to get it. Let's use our reading at 100C:

    100 = 0.9901*(99) + b
    100 = 98.0199 + b
    b = 100 - 98.0199

    b = 1.9801


    So the final function would be F(x) = 0.9901*x + 1.9801 and you should be able to plug your sensor reading in place of x, and get an adjusted reading. This is of course, for my made-up example. You need to make your own measurements and follow this procedure. It doesn't need to be at 100 and 0, but those are good because you can compare against an actual physical phenomenon.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube