DS18B20 Question


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: DS18B20 Question

    What I mean by that is simply this:

    When the temperature increases from any temperature, (GOES UP) , Say from 72 degrees to 73 degrees,
    OR when the temperature decreases from any temperature (GOES DOWN), Say from, 74 degrees to 73 degrees . . .

    On the FIRST READ of the DS18B20 AFTER that event : INCREASE (Go up in temperature) or DECREASE (Go down in temperature) , the temperature READ FROM THE DS18B20 does not change. It will change correctly on subsequent reads.

    I read the data sheet.

    I am using the program developed by Bruce Reynolds. It uses:

    waitloop: OWIn DQ, 4, [count_remain] ' Check for still busy converting
    IF count_remain = 0 Then waitloop

    Why is the conversion time OK for everything EXCEPT for the FIRST READ after a temperature INCREASE or DECREASE ?

    Ken

  2. #2
    Join Date
    Apr 2011
    Location
    Welches, Oregon
    Posts
    198


    Did you find this post helpful? Yes | No

    Default Re: DS18B20 Question

    When the temperature is changing from, say 72 degrees to 73 degrees or from 74 to 73 degrees I would expect it would take some time for the epoxy casing to heat/cool through to where the sensor is actually sensing. The datasheet indicates a conversion time of .1 - .75 seconds; are you allowing adequate time for the temperature change to propagate? Even as the sensor continues in the "correct" direction, there must be some lag between the actual temperature and the sensing element.

    If it is truly a hardware issue - and it requires a read/ write or some other electronic trigger to affect the suspect reading - then the problem should persist over several seconds or minutes. If you read say... once a minute... does the problem remain? What if you change the temperature rapidly - perhaps using "freeze spray" - to speed the temperature change of the body of the sensor, does this effect your results?
    Last edited by Amoque; - 19th December 2014 at 22:48.

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: DS18B20 Question

    If this part was capable of tracking temp that fast they would use them as MAF sensors in cars instead of investing hundreds of dollars, pounds,euros whatever in those "hot wire" devices. That little T092 case has mass, and it takes a bit to change it's temp.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: DS18B20 Question

    Sorry - I should have added that I am using 9 bit resolution . Things work fine using 12 bit.

    I use 9 bit since the conversion time is 93.75 ms, compared to 750 ms for 12 bit. At least, that is according to the data sheet that I have for the DS18B20. I do not want the program waiting 750 ms to convert.

    I guess it will be best just to close this thread. I will come up with some kind of work-around.

    Ken

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: DS18B20 Question

    Problem Solved - -
    The problem was in my code - - As I mentioned, I have the DS18B20 configured for 9 bit resolution.

    In my code, I sent the command $CC, $44 to do the Temperature conversion, AND THEN sent the 9 Bit configuration command.

    By placing the Configuration command BEFORE the temperature conversion command, it works just fine.

    Ken

Similar Threads

  1. ds18b20 code
    By leemarrow in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 3rd March 2016, 15:14
  2. Quick DS18B20 question
    By gti_uk in forum General
    Replies: 4
    Last Post: - 21st June 2009, 17:24
  3. Ds18b20
    By ahmed_salah in forum mel PIC BASIC Pro
    Replies: 24
    Last Post: - 14th June 2009, 15:21
  4. Ds18b20..
    By karenhornby in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th June 2008, 16:29
  5. using the DS18B20
    By lerameur in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 22nd December 2006, 13:09

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