|
OptoMMP3
|
Linearization of thermistors using Steinhart-Hart. More...
Public Member Functions | |
| SteinhartHart (Double dCoefA, Double dCoefB, Double dCoefC, Double dCoefSecond) | |
| Constructor More... | |
| Boolean | Compute (Double dResistanceOhms, out Double dTemperature) |
| Compute linearized temperature. More... | |
Linearization of thermistors using Steinhart-Hart.
Uses the following equation.
Temperature (Kelvin) = 1.0 / (A + B * ln(Ohms) + f32Second * (ln(Ohms)^2) + C * (ln(Ohms)^3))
(C#)
//
// Demonstration for an Omega 2252 Ohm (@ 25C) TH-22 probe.
// a = 1.470e-3
// b = 2.3780e-4
// c = 1.0389e-7
// second = 0.0
// Temperature result is in Kelvin.
//
Opto22.Linearization.SteinhartHart steinharthart = new SteinhartHart(1.470e-3, 2.3780e-4, 1.0389e-7, 0.0);
Double dTemperature;
Boolean bResult = steinharthart.Compute(2252, out dTemperature);
if (bResult == true)
{
Console.WriteLine("Linearization should be close to 298.15 Kelvin (25C); Result {0}", dTemperature.ToString("F1"));
}
else
{
Console.WriteLine("bResult is false");
}
| Opto22.Linearization.SteinhartHart.SteinhartHart | ( | Double | dCoefA, |
| Double | dCoefB, | ||
| Double | dCoefC, | ||
| Double | dCoefSecond | ||
| ) |
Constructor
| dCoefA | Coefficient A. |
| dCoefB | Coefficient B. |
| dCoefC | Coefficient C. If unknown or not provided, use 0.0. |
| dCoefSecond | Second order coefficient. If unknown or not provided, use 0.0. |
| Boolean Opto22.Linearization.SteinhartHart.Compute | ( | Double | dResistanceOhms, |
| out Double | dTemperature | ||
| ) |
Compute linearized temperature.
| dResistanceOhms | Measure thermistor probe resistance. |
| dTemperature | Calculated temperature when method returns true. When method returns false, this parameter is set to zero. This method usually returns degrees Kelvin. |