const float k = 0.004313;
const float delta = 2.468;
const float reftemp = 25; // reference temperature is 25C
const float shiftv = 0.6; // amount to shift thermopile voltage for negative V values in range
const float verr = 0.6; // voltage error introduced to thermopile by circuit
// work out thermistor temp from reading
float v1 = (thermistorValue / 1024) * 5; // source voltage is 5v so reading is fraction of that
float r = -(v1*1000)/(v1-5); // to get the resistance
float ambtemp = a + b * sqrt(1+c*r) + d*pow(r,5) + e*pow(r,7); // ambient temp
float comp = k * (pow(ambtemp,4-delta)-pow(reftemp,4-delta)); // equivalent thermopile V for amb temp