Class Thermistor
Driver for thermistor temperature sensors
Assembly: Thermistor.dll
View Source
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
protected IAnalogInputPort AnalogInputPort { get; }
Type
The type of thermistor (NTC or PTC)
View Source
public ThermistorType Type { get; }
Placement
The placement of the thermistor in the circuit (high-side or low-side)
View Source
public ThermistorPlacement Placement { get; }
ReferenceVoltage
The reference voltage used in the circuit
View Source
public Voltage ReferenceVoltage { get; }
ReferenceResistor
The reference resistor value used in the voltage divider
View Source
public Resistance ReferenceResistor { get; }
BetaValue
Beta value for NTC thermistors (B parameter equation)
View Source
public double BetaValue { get; set; }
ReferenceResistance
Resistance at reference temperature (typically 25�C)
View Source
public Resistance ReferenceResistance { get; set; }
ReferenceTemperature
Reference temperature for the thermistor calibration
View Source
public Temperature ReferenceTemperature { get; set; }
CalibrationOffset
Calibration offset to adjust temperature readings
View Source
public Temperature CalibrationOffset { get; set; }
Temperature
The last read temperature value
View Source
public Temperature? Temperature { get; }
Methods
ReadSensor()
Reads the current temperature from the thermistor
View Source
protected override Task<Temperature> ReadSensor()
Returns
System.Threading.Tasks.Task<Meadow.Units.Temperature>: The current temperature
GetTemperature()
Gets the current temperature
View Source
public Temperature GetTemperature()
Returns
Meadow.Units.Temperature: The current temperature
CalibrateAsync(Temperature)
Sets a calibration offset to adjust temperature readings
View Source
public Task CalibrateAsync(Temperature actualTemperature)
Returns
System.Threading.Tasks.Task
Parameters
| Type | Name | Description |
|---|---|---|
Meadow.Units.Temperature | actualTemperature | The known actual temperature for calibration |
SetCalibrationOffset(Temperature)
Convenience method for setting the calibration offset directly
View Source
public void SetCalibrationOffset(Temperature offset)
Parameters
| Type | Name | Description |
|---|---|---|
Meadow.Units.Temperature | offset | The temperature offset to apply |
Implements
System.IObservable<Meadow.IChangeResult<Meadow.Units.Temperature>>Meadow.Peripherals.Sensors.ISamplingTemperatureSensorMeadow.Peripherals.Sensors.ITemperatureSensorMeadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Temperature>Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Temperature>Meadow.Peripherals.Sensors.ISensorMeadow.Peripherals.Sensors.ISamplingSensor