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
void setup() {
Serial.begin(9600);
}
void loop() {
float thermopileValue = analogRead(THERMOPILE);
float thermistorValue = analogRead(THERMISTOR);
// 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
// calculate the thermopile temp
float v2 = (thermopileValue / 1024) * 5 + comp - verr - shiftv; // thermopile voltage
float objtemp = pow((v2+k*pow(ambtemp,4-delta))/k, 1/(4-delta)); // object temp
这是我找的资料,其中有一个参数看不懂,你能给我解释一下吗?
const float k = 0.004313;
const float delta = 2.468;
这两个常量是如何确定的?我看了这个传感器的资料都没有提到类似的数据。
能帮我解答一下吗?
|