DS18B20 thermostat


Results 1 to 9 of 9

Threaded View

  1. #6


    Did you find this post helpful? Yes | No

    Default Re: DS18B20 thermostat

    Are you comparing the temp sensor output data to the value "78" or "780"? If I understand the data format of the temp sensor read code, the data is (temperature * 10) so that you have a resolution of 0.1 deg. Which means 78.0 degrees is 780 decimal returned by the temp sensor read code.

    Also in your compare code you are right shifting the temp sensor reading by 4 which is like dividing by 16. This changes the decimal value 780 to 48 which is not what I think you wanted to do. You need to actually divide the temp sensor data by 10 decimal, and then compare. Or multiply the test value by 10 and then compare.

    I think what is confusing you is the DEC function. The DEC take a value and returns the specified decimal digit. Kind of like this: [value / (10 ^ n) ] // 10.
    Last edited by falingtrea; - 18th April 2013 at 19:12. Reason: added additional info
    Tim Barr

Similar Threads

  1. 4 Channel Thermostat using PID loops
    By malc-c in forum Code Examples
    Replies: 36
    Last Post: - 18th March 2013, 10:17
  2. Thermostat for refrigerator
    By fratello in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th August 2012, 22:58
  3. Thermostat
    By koossa in forum Off Topic
    Replies: 15
    Last Post: - 16th November 2010, 10:06
  4. Pulse proportional thermostat
    By malc-c in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th December 2009, 02:00
  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 : 0

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