Hello
I have a confusion on the displaying of temperature value less than - 20.4 deg C.
Before i begin, here is my hardware/software setup
PIC18F4423 @ 20MHz ceramic
using 12bit ADC
Vref++ == VDD == 5V
thermistor: MCP9701A
compiler C18
Now my problem is explained as follows...
Im using the following code in my program to get the correct temperature readings. They are always offset adjusted as follows...
Code:
if(buffer_temp < offsetAdjst) //below 0 deg C
{
minus = 1; //activate -ve sign
buffer_temp = offsetAdjst - buffer_temp; //doing offset adjustment
}
else //at or above 0 deg C
buffer_temp = buffer_temp - offsetAdjst; //doing offset adjustment
Now the offsetAdjst == 328 which is equal to 400mV which is equal to 0 deg C ... (factory calibrated).
I used this formula to get 328...
ADC = [ (400mV) x (12bit ADC full scale) ] / 5V
= 328
So now suppose if the buffer_temp becomes equal to 1 then it means (buffer_temp < offsetAdjst)....so based on
the above code...i do the following subtraction as....
buffer_temp = offsetAdjst - buffer_temp
= 328 - 1
= 327
so now buffer_temp == 327 .... this means that the temperature == - 20.4 deg C
i used this formula to get deg C....
V == [ (327) x (5V) ] / (12bit ADC full scale)
AND to get deg C we divide above result with 19.5mV as that is on the thermistor datasheet for 1 deg C
So ... V / 19.5mV == - 20.4 deg C ......... the -ve sign is attached by self in my code above.
Now the data sheet says that the thermistor has a wide reading range....-40 to +125.....and the above calculations
will not let me drop below -20.4....even if buffer_temp becomes 0 .....so its the offset value that needs adjusting i suppose....but if changed then that would have a bad effect on the other temperature readings and the temperature scale would not be accurately displaying the temperature on the LCD
...so just how do i get below -20 further all the way up to -40???
any ideas please.....any suggestions please.....help
thank you
Haseeb