Question regarding mean error on a DS18B20

Discussion in 'General Electronics Chat' started by jerseyguy1996, Mar 29, 2008.

  1. jerseyguy1996

    Thread Starter Active Member

    Feb 2, 2008
    206
    9
    The DS18B20 datasheet shows an expected error of +-.5 degrees C. Does this mean that one unit could take 2 readings back to back and they could differ by 1 degree C or is it saying that 2 different units taking simultaneous readings could differ by 1 degree C? I am researching this for an application that requires a stable temperature more than it requires an accurate temperature so it doesn't matter if the unit is off by +.4 degrees C for example, but it would matter if it is off by +.4 degrees C on this reading and then on the next reading it is off by -.3 degrees C.
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    No, it's the worst-case situation when the device is set to 9 bit accuracy. It's usually a good idea to read the spec sheet for any device you contemplate using. Setting the control register to a 12 bit conversion gives an accuracy of +/- .0625 deg. C.

    If the converted temperature is right on the edge of the A to D converter's resolution, it is just possible for each reading to vary by one lsb. One deals with this by selecting a conversion accuracy that makes the one lsb error insignificant.
     
  3. jerseyguy1996

    Thread Starter Active Member

    Feb 2, 2008
    206
    9
    I see. I was under the impression that the +/- .5 degrees C has more to do with the physical limitations of the materials used in the temperature sensor. According to the datasheet:

    Measures temperatures from –55°C to
    +125°C (–67°F to +257°F)
    ±0.5°C accuracy from –10°C to +85°C

    It seems to me that if the accuracy was as tight as the resolution it would show +/- .0625 degree C accuracy.
     
  4. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    I think those are two different things. The absolute accuracy of the device is +/- .5 deg C in the range from -10 to + 85 C. The output error is +/- .5 deg C, or one lsb, at a conversion size of 9 bits.

    Check the sensor against a good lab thermometer. With a 12 bit conversion, any error should be pretty constant. Measure at three points to check linearity, and you can program in a correction factor to make the end value agree with the lab thermometer.
     
  5. nanovate

    Distinguished Member

    May 7, 2007
    665
    1
    As Beenthere mentioned, accuracy and resolution are not the same. Looking at the datasheet in the section that has the electrical charactaristics you can see where they get that +/- 0.5 degC number -- Fig 17 "Typical Performance Curve"

    Another spec to look at since you require stability is the drift rating which is located a page or so up in the "DC Electrical Characteristics" table.

    You should also either measure or contact Maxim about the power supply rejection of the device.
     
  6. jerseyguy1996

    Thread Starter Active Member

    Feb 2, 2008
    206
    9
    Thanks for the responses. I am very new to all of this electronic stuff but I am finding it fascinating. I am working my way through the e-book. I just completed a multimeter kit (elenco M-2666K) and I am ready to start working through some of the examples. I would like to build an extremely robust temperature controller for my saltwater fish tank and I would like to be able to control the temperature within some very tight tolerances. I was thinking to myself that if the absolute accuracy of one device was +/- .5 degrees then couldn't we get the standard error down even farther by having the microcontroller sample 4 of the DS18B20 devices and then take an average of them?
     
  7. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    You may want to see what the individual did to solve the submersibility issue with their 1-wire device. Here is a link to one solution.

    hgmjr
     
  8. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    One solution is to get a thermistor and source it from a reference diode through a .01% resistor. Convert the voltage with a 16 bit converter. All you need to do is to hold the value at one point - the actual temperature is not important, just that whatever it is does not change. Assuming you can get the rest of the hardware together, the controller should let you hold the tank temp to a small fraction of a degree C. A 16 bit conversion goes to one part in 32,768.

    A 22 bit audio A to D converter will let you run two thermistors even tighter than the above suggestion. The sensitivity is one part in 8 million.
     
Loading...