Hi all I wish to read the above sensor. I was looking at the Steinhart Equation but that wanted resistances at various temperatures.
Is there an a way to use this table?
My current circuit is 5v into the sensor and the out going to a0 with a 1k resistor to ground.
Thanks,
Chris
Please post a link to the sensor.
The table shows that the sensor response is nonlinear, in a rather ugly way. You would be much better off with a DS18B20, or even a thermistor.
1 Like
The sensor is a Haltech 1/8npt air temp sensor. I can't use another as for the application it is the only thing I have found that will fit. HT-010206 Air Temp Sensor - Haltech
Thanks I'll have a look at that library.
If you don't care about errors of +/- 10 degrees, the straight line fit works.
Other options include fitting a function to the curve, or interpolating between table data points.
Surprisingly, a cubic equation fits the data pretty well.
From the graph, the equation to calculate the temperature from the sensor voltage V is
float temp = 151.9 - 82.7*V + 23.7*V*V - 2.9*V*V*V;
2 Likes
Hello jremington
How do you generate the equation and diagram?
Have a nice day and enjoy coding in C++.
Дайте миру шанс!
I also confront similar question as you.....
Kaleidagraph. Very easy to use (much easier than Excel or any comparable spreadsheet) and does everything I want. https://www.synergy.com/
Merci and greetings to Down Under.
Thank you very much for this👍
Just to confirm I got this working to within a couple of degrees c at 0, 20 and at 80.
I believe this is a standard 'GM' sensor so this may be useful to others.
I have the sensor tied to a 10k resistor and ground on 1 side and 5v on the other.
This is my code.
float tempCalc(int tempReading){
float tr = tempReading;
volts = (1023 - tr) /1023 * 5;
float tempC = (m0 + (m1 *volts) + (m2*volts*volts) + (m3*volts*volts*volts));
return tempC;
}
with M0-3 being the values in jremingtons graph. I convert the temping reading to float because otherwise it ends up as 0 in the divide.
Any comments/improvements let me know.
system
Closed
November 23, 2022, 8:08pm
15
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.