Skip to main content

Class Thermistor

Driver for thermistor temperature sensors

Assembly: Thermistor.dll​
View Source​
Declaration
public class Thermistor : PollingSensorBase<Temperature>, IObservable<IChangeResult<Temperature>>, ISamplingTemperatureSensor, ITemperatureSensor, ISamplingSensor<Temperature>, ISensor<Temperature>, ISensor, ISamplingSensor

Inheritance: System.Object -> Meadow.Foundation.ObservableBase<UNIT> -> Meadow.Foundation.SamplingSensorBase<UNIT> -> Meadow.Foundation.PollingSensorBase<UNIT>

Implements:
System.IObservable<Meadow.IChangeResult<Meadow.Units.Temperature>>, Meadow.Peripherals.Sensors.ISamplingTemperatureSensor, Meadow.Peripherals.Sensors.ITemperatureSensor, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Temperature>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Temperature>, Meadow.Peripherals.Sensors.ISensor, Meadow.Peripherals.Sensors.ISamplingSensor

Properties​

AnalogInputPort​

The analog input port for the thermistor

View Source​
Declaration
protected IAnalogInputPort AnalogInputPort { get; }

Type​

The type of thermistor (NTC or PTC)

View Source​
Declaration
public ThermistorType Type { get; }

Placement​

The placement of the thermistor in the circuit (high-side or low-side)

View Source​
Declaration
public ThermistorPlacement Placement { get; }

ReferenceVoltage​

The reference voltage used in the circuit

View Source​
Declaration
public Voltage ReferenceVoltage { get; }

ReferenceResistor​

The reference resistor value used in the voltage divider

View Source​
Declaration
public Resistance ReferenceResistor { get; }

BetaValue​

Beta value for NTC thermistors (B parameter equation)

View Source​
Declaration
public double BetaValue { get; set; }

ReferenceResistance​

Resistance at reference temperature (typically 25�C)

View Source​
Declaration
public Resistance ReferenceResistance { get; set; }

ReferenceTemperature​

Reference temperature for the thermistor calibration

View Source​
Declaration
public Temperature ReferenceTemperature { get; set; }

CalibrationOffset​

Calibration offset to adjust temperature readings

View Source​
Declaration
public Temperature CalibrationOffset { get; set; }

Temperature​

The last read temperature value

View Source​
Declaration
public Temperature? Temperature { get; }

Methods​

ReadSensor()​

Reads the current temperature from the thermistor

View Source​
Declaration
protected override Task<Temperature> ReadSensor()
Returns​

System.Threading.Tasks.Task<Meadow.Units.Temperature>: The current temperature

GetTemperature()​

Gets the current temperature

View Source​
Declaration
public Temperature GetTemperature()
Returns​

Meadow.Units.Temperature: The current temperature

CalibrateAsync(Temperature)​

Sets a calibration offset to adjust temperature readings

View Source​
Declaration
public Task CalibrateAsync(Temperature actualTemperature)
Returns​

System.Threading.Tasks.Task

Parameters​
TypeNameDescription
Meadow.Units.TemperatureactualTemperatureThe known actual temperature for calibration

SetCalibrationOffset(Temperature)​

Convenience method for setting the calibration offset directly

View Source​
Declaration
public void SetCalibrationOffset(Temperature offset)
Parameters​
TypeNameDescription
Meadow.Units.TemperatureoffsetThe temperature offset to apply

Implements​

  • System.IObservable<Meadow.IChangeResult<Meadow.Units.Temperature>>
  • Meadow.Peripherals.Sensors.ISamplingTemperatureSensor
  • Meadow.Peripherals.Sensors.ITemperatureSensor
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Temperature>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Temperature>
  • Meadow.Peripherals.Sensors.ISensor
  • Meadow.Peripherals.Sensors.ISamplingSensor