Skip to main content

Class MiniPID2

Represents an IonScience MiniPID2 analog photoionisation (PID) Volatile Organic Compounds (VOC) sensor

Assembly: MiniPID2.dll
View Source
public class MiniPID2 : SamplingSensorBase<Concentration>, IObservable<IChangeResult<Concentration>>, IVOCConcentrationSensor, ISamplingSensor<Concentration>, ISensor<Concentration>, ISensor, ISamplingSensor, IDisposable

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

Implements:
System.IObservable<Meadow.IChangeResult<Meadow.Units.Concentration>>, Meadow.Peripherals.Sensors.Environmental.IVOCConcentrationSensor, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Concentration>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Concentration>, Meadow.Peripherals.Sensors.ISensor, Meadow.Peripherals.Sensors.ISamplingSensor, System.IDisposable

Properties

VOCConcentration

The current VOC concentration value

View Source
public Concentration? VOCConcentration { get; protected set; }

MiniPID2DeviceType

The MiniPID2 device type

View Source
public MiniPID2.MiniPID2Type MiniPID2DeviceType { get; protected set; }

AnalogInputPort

View Source
protected IAnalogInputPort AnalogInputPort { get; }

IsDisposed

Is the object disposed

View Source
public bool IsDisposed { get; }

Methods

SetOffsetForSensor(Voltage, MiniPID2Type)

Set the sensor voltage offset Useful for compensating for air conditions

View Source
public void SetOffsetForSensor(Voltage offset, MiniPID2.MiniPID2Type sensorType)
Parameters
TypeNameDescription
Meadow.Units.VoltageoffsetOffset voltage
Meadow.Foundation.Sensors.Environmental.MiniPID2.MiniPID2TypesensorTypeThe sensor to change

GetOffsetForSensor(MiniPID2Type)

Get the voltage offset for a sensor

View Source
public Voltage GetOffsetForSensor(MiniPID2.MiniPID2Type sensorType)
Returns

Meadow.Units.Voltage: The offset as voltage

Parameters
TypeNameDescription
Meadow.Foundation.Sensors.Environmental.MiniPID2.MiniPID2TypesensorTypeThe sensor

ReadSensor()

Convenience method to get the current concentration. For frequent reads, use StartSampling() and StopSampling() in conjunction with the SampleBuffer.

View Source
protected override Task<Concentration> ReadSensor()
Returns

System.Threading.Tasks.Task<Meadow.Units.Concentration>: The concentration averages of the given sample count### StartUpdating(TimeSpan?) Starts updating the sensor on the updateInterval frequency specified

View Source
public override void StartUpdating(TimeSpan? updateInterval = null)
Parameters
TypeName
System.Nullable<System.TimeSpan>updateInterval

StopUpdating()

Stops sampling the concentration

View Source
public override void StopUpdating()

VoltageToConcentration(Voltage)

Converts voltage to Concentration

View Source
protected Concentration VoltageToConcentration(Voltage voltage)
Returns

Meadow.Units.Concentration: Concentration

Parameters
TypeName
Meadow.Units.Voltagevoltage

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

View Source
public void Dispose()

Dispose(bool)

Dispose of the object

View Source
protected virtual void Dispose(bool disposing)
Parameters
TypeNameDescription
System.BooleandisposingIs disposing

Implements

  • System.IObservable<Meadow.IChangeResult<Meadow.Units.Concentration>>
  • Meadow.Peripherals.Sensors.Environmental.IVOCConcentrationSensor
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Concentration>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Concentration>
  • Meadow.Peripherals.Sensors.ISensor
  • Meadow.Peripherals.Sensors.ISamplingSensor
  • System.IDisposable