OptoMMP3
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Opto22.Linearization.SteinhartHart Class Reference

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...
 

Detailed Description

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");
}

Constructor & Destructor Documentation

Opto22.Linearization.SteinhartHart.SteinhartHart ( Double  dCoefA,
Double  dCoefB,
Double  dCoefC,
Double  dCoefSecond 
)

Constructor

Parameters
dCoefACoefficient A.
dCoefBCoefficient B.
dCoefCCoefficient C. If unknown or not provided, use 0.0.
dCoefSecondSecond order coefficient. If unknown or not provided, use 0.0.

Member Function Documentation

Boolean Opto22.Linearization.SteinhartHart.Compute ( Double  dResistanceOhms,
out Double  dTemperature 
)

Compute linearized temperature.

Parameters
dResistanceOhmsMeasure thermistor probe resistance.
dTemperatureCalculated temperature when method returns true. When method returns false, this parameter is set to zero. This method usually returns degrees Kelvin.
Returns
True when successful, false when resistance is less than or equal to zero.

The documentation for this class was generated from the following file: