TMP05 Temp Sensor


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2008
    Posts
    4

    Default TMP05 Temp Sensor

    Has anyone worked with this sensor (TMP05)? I am wanting to use it with a 16f877a and was hoping to see if anyone had any luck with it??
    Thanks

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    RichG, Attached is a program for the TPM03 which I beleive is similar.

    '
    T1PWR VAR PORTD.6 'INSIDE TEMPERATURE POWER
    TEMPIN VAR PORTD.3 'INSIDE TEMPERATURE
    SLOPE CON 720 'TEMP SLOPE FOR DEGREES F.
    OFFSET1 CON 443 'INSIDE TEMP OFFSET FOR DEGREES F.
    TIME1 VAR WORD
    TIME2 VAR WORD
    INTEMP VAR BYTE
    MULT VAR WORD

    ************************************************** ******************
    GETEMP: 'FIRST DO THE INSIDE TEMPERATURE
    T1PWR = 1 'ENABLE POWER TO TMP03
    PAUSE 50
    PULSIN TEMPIN,1,TIME1
    PULSIN TEMPIN,0,TIME2
    T1PWR = 0 'DISABLE POWER TO TMP03
    MULT = TIME1 * SLOPE 'MULTIPLY TO DUMMY VARIABLE
    INTEMP = DIV32 TIME2 'PERFORM 31 BIT X 15 BIT DIVIDE
    INTEMP = OFFSET1 - INTEMP
    ' ************************************************** ******************

    Dave Purola,
    N8NTA

  3. #3
    Join Date
    Jun 2008
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Thanks

    I will check it out, hopefully I will get to play withit some this weekend!

  4. #4
    Join Date
    Jun 2008
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Follow up

    Well, got the tmp 05 temperature sensing chip working pretty easily. Actually, quiker and easier than the 18s20. Thanks for the help.

    I am running into a problem getting the resolution I need. I am using the following code:

    TEMP VAR WORD
    TEMPIN VAR PORTC.1 'TEMPERATURE OUTPUT
    SLOPE CON 751 'TEMP SLOPE FOR DEGREES C.
    OFFSET1 CON 421 'TEMP OFFSET FOR DEGREES C.
    TIME1 VAR WORD
    TIME2 VAR WORD
    INTEMP VAR WORD
    MULT VAR WORD


    PULSIN TEMPIN,1,TIME1 'measure hi duration
    PULSIN TEMPIN,0,TIME2 'measure low duration



    LCDOUT $FE,1,#TIME1," ",#TIME2 ' display the values of hi and low pulse
    PAUSE 2000



    MULT = TIME1 * SLOPE 'MULTIPLY TO DUMMY VARIABLE
    INTEMP = DIV32 TIME2 'PERFORM 31 BIT X 15 BIT DIVIDE

    LCDOUT $FE,1,#INTEMP 'display result
    PAUSE 2000


    TEMP = OFFSET1 - INTEMP


    LCDOUT $FE,1,#TEMP 'DISPLAY RESULTING TEMP IN C
    PAUSE 3000


    I am getting good results-
    Time1=4039
    TIME2=7644
    INTEMP=396
    TEMP=25

    Problem is I lose the resolution with INTEMP losing everything right of the decimal. I would like to end up with a result out to 2 decimal places for TEMP. Any ideas??

Similar Threads

  1. Need a cheap touch sensor idea.. here it is
    By mister_e in forum Code Examples
    Replies: 20
    Last Post: - 16th April 2016, 23:42
  2. Graphic LCD with PICbasic pro
    By amindzo in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 25th November 2012, 12:45
  3. Using WDT as a Temp Sensor?
    By modifyit in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 20th June 2006, 18:55
  4. Temp sensor problem
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 14th June 2006, 15:49
  5. 1 wire Temp sensor
    By PortlandJohn in forum General
    Replies: 2
    Last Post: - 25th November 2005, 17:21

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