一.热敏电阻温度,阻值换算公式:
R = R(25℃)•exp[B•(1/T - 1/298.15)]
Tbeta = 1/(1/(273.15+25)+1/Beta*log(Rth/R25))-273.15;
T1 =ln(Rt/R)/B+1/T2;
二.C程序:
/*
*@ Vin ADC采集转换后的电压值
*/
uint16_t Board_Get_NTC_Temp(float Vin)
{
float Rt=0;
float Rp=10000;
float T2=273.15+25;
float Bx=3435;
float Ka=273.15;
float temp=0;
Rt = Board_Get_NTC_R(Vin);
temp = Rt/Rp;
temp = log(temp); //ln(Rt/Rp)
temp/=Bx; //ln(Rt/Rp)/B
temp+=(1/T2);
temp = 1/(temp);
temp-=Ka;
return temp;
}