Converts the output from a Texas Instruments LMT70 temperature sensor (in mV) to degrees C

convert_lmt70.cpp

Committer:
adamsona
Date:
2015-10-22
Revision:
0:2cbfc517b1c4

File content as of revision 0:2cbfc517b1c4:

#include "convert_lmt70.h"

/*  Converts voltage output from Texas Instruments LMT70 temp sensor into degrees C
  using the 3rd-order lookup table that's a best fit for the full range of -55C - 150C
  found at http://www.ti.com/lit/ds/symlink/lmt70.pdf
*/
float convert_lmt70 (float mV) {
    float a, b, c, d;
    a = -1.064200E-09;
    b = -5.759725E-06;
    c = -1.789883E-01;
    d = 2.048570E+02;

    return a*mV*mV*mV + b* mV*mV + c*mV + d;
}