Quantcast
Channel: Data converters
Viewing all articles
Browse latest Browse all 37551

Forum Post: RE: tmp006 calculation

$
0
0

Hi Ian,

Below is code pasted from another thread.

 

Hi Ian,

Below is code to calculate temperature.

// Calulate temperature from the TMP006 datasheet
  long double calculateTemp(int Tdie, int Vobj){
  long double Vobj2 = (double)Vobj*.00000015625;
  long double Tdie2 = (double)Tdie*.03125 + 273.15;
  long double S0 = 2.867*pow(10,-14);             // Tommy's S0
  //long double S0 = 6.033*pow(10,-14);
  long double a1 = 1.70*pow(10,-3);
  long double a2 = -2.0*pow(10,-5);
  long double b0 = -2.57*pow(10,-5);
  long double b1 = -9.48*pow(10,-8);
  long double b2 = 2.26*pow(10,-10);
  long double c2 = 0;
  long double Tref = 298.15;
  long double S = S0*(1+a1*(Tdie2 - Tref)+a2*pow((Tdie2 - Tref),2));
  long double Vos = b0 + b1*(Tdie2 - Tref) + b2*pow((Tdie2 - Tref),2);
  long double fObj = (Vobj2 - Vos) + c2*pow((Vobj2 - Vos),2);
  long double Tobj = pow(pow(Tdie2,4) + (fObj/S),.25);
  return (Tobj - 273.15);
}

Best regards,

 Luo


Viewing all articles
Browse latest Browse all 37551

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>