PDA

View Full Version : TMP05 Temp Sensor



RichG
- 11th January 2009, 17:02
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

Dave
- 12th January 2009, 12:07
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

RichG
- 13th January 2009, 00:35
I will check it out, hopefully I will get to play withit some this weekend!

RichG
- 8th February 2009, 03:33
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??