Article TMCM-1180 Temperature Reading

 

Q: How do I convert the raw ADC temperature reading obtained by GIO 3, 1 command from TMCM-1180 to a temperature value in Celsius?

A: The following piece of code can convert the raw ADC value to a temperature reading in Celsius:

unsigned int ConvertToTemperature(unsigned int ADCVal)

{

float R_NTC;

float b;

float Temperature;

R_NTC=(3.3-(float) ADCVal/1023.0*3.3)/((float) ADCVal/1023.0*3.3/2.0);

b=3455.0;

Temperature=b*298.16/(b+(log(R_NTC/10.0)*298.16))-273.16;

return (unsigned int) Temperature;

}

 

 

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.