Bug in temperature request DS1820


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2006
    Posts
    747

    Default Bug in temperature request DS1820

    Hello, I am using the one wire temperature probe sensor.
    It does work , I do get the right temperature, but only for the first output on the lcd it is showing 85.00 for both celcius and farenheit. It does show the right temperatures in the second loop and on. But why does ti show this information on the first loop. Eventually this will not be good as I will be taking the first value to proceed.

    Code:
    GetTemperature_Inside:
    
    owout DQ2,1,[$cc] : owout DQ2,0,[$44] : Pause 500 : owout DQ2,1,[$cc] : owout DQ2,0,[$be]
    owin DQ2, 0, [temperature2.LOwBYTE, temperature2.Highbyte, Skip 4, count_remain2, count_per_c2]
    
    
    temperature = ((( temperature2 >> 1) *100)- 25) + (((count_per_c2 - count_remain2) * 100) / count_per_c2)
    tempF = (((temperature /5) *9 ) +3200)
    
    lcdout $FE,1, "TempC: ", "+", dec (temperature / 100) , ".", dec2 temperature," ",$DF,"C"
    lcdout $FE,$C0, "TempF: ", "+", dec2 (tempF / 100) , ".", dec2 (tempF // 100)," ",$DF,"F"
    	pause 100
    	
    
    return

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Bug in temperature request DS1820

    85 is the default power-up temperature value.

    A conversion takes 750ms but you are only waiting 500, so each time you read it, it's getting the result from the previous conversion, not the current one.
    DT

  3. #3
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default Re: Bug in temperature request DS1820

    Thanks
    thats what I thought at first, i had a Pause 300, I guess I will put a longer on.
    oufff, I was hoping it would something easy. thanks again

    K

  4. #4
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: Bug in temperature request DS1820

    There is also a known bug in the DS1820, in that the power up reset does not work properly and it will report 85C on the first reading after power up. To work around the issue, reset the device by software command before taking the first reading.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default Re: Bug in temperature request DS1820

    Hi,

    a bigger bug of the DS1820 ( not 18 B or S 20 ) is the error on temp that can reach +/- 3° C ...

    the sample I run on my EasyPic 5 shows a ... + 2.50 °C error ...

    But never observed any initialization real error ... measurements always start @ the good value ... if program respects the conversion delay, of course.

    Alain
    Last edited by Acetronics2; - 26th February 2011 at 17:15.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Re: Bug in temperature request DS1820

    I’ve had good results with the DS1820 using a lookup table for C to F conversion. Checking results with a Thermo King dry well calibrator the DS1820 was on the on the money to the nearest full deg fahrenhite from 7*F to about 60*F, it was 1 deg high from about 60*F to about 80*F and on the money from about 80*F to 127*F. I checked two DS1820’s and both fail to function properly below 6*F. The lookup table was from 0*F to 127*F. If bit7 (.5C) is a one it forces a roundup to your higher Fahrenheit temp in your table read if you have two Fahrenheit degrees represented by the same Centigrade temperature. Both DS1820’s gave almost identical performance.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts