I have been racking my brain for the past two weeks with the following!
I have a PIC12F675 reading an AD595 thermocouple IC. The AD595 provides 10mV/C. In order to read the temp below 0 I have added a voltage divider to the ground pin of the AD595. I have also power the AD595 via a -5V to +5V power supply. I read the output of the AD595 on GPIO.0 and the Virtual Ground voltage via GPIO.1.
To read the temperature above 0C I basically subtract GPIO.1 from GPIO.0. I cannot get the math correct for any thing below 0C or 32F.
Here is some of the code:
'celsius
'farenheit
'adval = GPIO.0
'adval1 = GPIO.1
if adval > adval1 then
celsius = adval - adval1
farenheit = (celsius * 18) / 10
farenheit = farenheit + 32
else
adval_C = adval1 - adval
adval_F_18 = (adval_C * 18)/10
adval_F_32 = (adval_F_18 + 32)
check = 0
endif
Bookmarks