微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 嵌入式设计讨论 > MCU和单片机设计讨论 > pt100测温

pt100测温

时间:10-02 整理:3721RD 点击:

应用ICL7135完成PT1000测温电路

1、PT100或者PT1000的驱动方法有 桥路拾取(不方便计算)  恒流源(常用) 万用表测电阻原理(本应用)

2、原理图

file:///C:/Users/lenovo/AppData/Local/Temp/msohtml1/02/clip_image002.jpg

3、核心代码:

#ifndef _CALCULATE_H_
#define _CALCULATE_H_


#define     A       3.9083e-3
#define     B       -5.775e-7
#define     C      -4.183e-12
#define     ERROR 0
#define     NOERROR 1
unsigned int T_Process(void);
unsigned int  R_Correct(void);//电阻修正两次 最后温度修正一次 共修正三次数据,精度控制在0.1℃之内
unsigned char R_T_Convert(void);

#endif

CALCULATE.C文件
unsigned char R_T_Convert(void)    //电阻计算温度,采用牛顿迭代法

{
unsigned char i;
double T_estimate;
R_AD_CORRECT=R_AD_CORRECT/10.0;
T_estimate = (R_AD_CORRECT / 1000 - 1) / A ;
    if(R_AD_CORRECT >= 800 && R_AD_CORRECT < 1000)//-200℃- 0℃
    {
      for(i = 0 ; i < 50 ; i ++)
  {
   T_calculate = T_estimate + (R_AD_CORRECT - 1000*(1 +A*T_estimate + B*T_estimate*T_estimate -1000*C*T_estimate*T_estimate*T_estimate +C*T_estimate*T_estimate*T_estimate*T_estimate)) / (1000 * (A + 2*B*T_estimate -3000*C*T_estimate*T_estimate + 4*C*T_estimate*T_estimate*T_estimate)) ;
   if(fabs(T_calculate - T_estimate) < 0.001)
    break ;
   else
    T_estimate = T_calculate ;
  }
  return(NOERROR);             //判断是否超出测量范围
}
else if(R_AD_CORRECT >= 1000 && R_AD_CORRECT <= 2000) //0℃- 850℃
{
  for(i = 0 ; i < 50 ; i ++)
  {
   T_calculate = T_estimate + (R_AD_CORRECT - 1000*(1 +A*T_estimate + B*T_estimate*T_estimate)) / (1000*(A + 2*B*T_estimate)) ;
   if(fabs(T_calculate - T_estimate) < 0.001)
    break ;
   else
    T_estimate = T_calculate ;
  }
  return(NOERROR);        //判断是否超出测量范围
}
else
{
  return(ERROR);
}

}

4、实验数据



发个程序  发个仿真呗

好啊啊啊啊啊啊啊啊

看不懂额....在看看那

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top