Skip to main content

Class Sgp40

Provides access to the Sensirion SGP40 VOC sensor

Assembly: Sgp40.dll​
View Source​
Declaration
public class Sgp40 : ByteCommsSensorBase<int>, IObservable<IChangeResult<int>>, ISamplingSensor<int>, ISensor<int>, ISensor, ISamplingSensor, IDisposable, II2cPeripheral

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

Implements:
System.IObservable<Meadow.IChangeResult<System.Int32>>, Meadow.Peripherals.Sensors.ISamplingSensor<System.Int32>, Meadow.Peripherals.Sensors.ISensor<System.Int32>, Meadow.Peripherals.Sensors.ISensor, Meadow.Peripherals.Sensors.ISamplingSensor, System.IDisposable, Meadow.Hardware.II2cPeripheral

Properties​

VocIndex​

The VOC Index, from the last reading

View Source​
Declaration
public int VocIndex { get; }

SerialNumber​

Serial number of the device

View Source​
Declaration
public ulong SerialNumber { get; }

DefaultI2cAddress​

The default I2C address for the peripheral

View Source​
Declaration
public byte DefaultI2cAddress { get; }

Methods​

Initialize()​

Initialize the sensor

View Source​
Declaration
protected void Initialize()

RunSelfTest()​

This command triggers the built-in self-test checking for integrity of both hotplate and MOX material

View Source​
Declaration
public bool RunSelfTest()
Returns​

System.Boolean: true on successful test, otherwise false### ReadSensor() Reads data from the sensor

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

System.Threading.Tasks.Task<System.Int32>: The latest sensor reading### TurnHeaterOff() This command turns the hotplate off and stops the measurement. Subsequently, the sensor enters idle mode.

View Source​
Declaration
public void TurnHeaterOff()

SetCompensationData(RelativeHumidity, Temperature)​

Set the compensation data

View Source​
Declaration
public void SetCompensationData(RelativeHumidity humidity, Temperature temperature)
Parameters​
TypeNameDescription
Meadow.Units.RelativeHumidityhumidityHumidity compensation
Meadow.Units.TemperaturetemperatureTemperature compensation

ClearCompensationData()​

Clear the compensation data

View Source​
Declaration
public void ClearCompensationData()

Implements​

  • System.IObservable<Meadow.IChangeResult<System.Int32>>
  • Meadow.Peripherals.Sensors.ISamplingSensor<System.Int32>
  • Meadow.Peripherals.Sensors.ISensor<System.Int32>
  • Meadow.Peripherals.Sensors.ISensor
  • Meadow.Peripherals.Sensors.ISamplingSensor
  • System.IDisposable
  • Meadow.Hardware.II2cPeripheral