Skip to main content

Class Scd30Base

Base class for SCD30 C02 sensor

Assembly: Scd30.dll
View Source
Declaration
public abstract class Scd30Base : ByteCommsSensorBase<(Concentration? Concentration, Temperature? Temperature, RelativeHumidity? Humidity)>, IObservable<IChangeResult<(Concentration? Concentration, Temperature? Temperature, RelativeHumidity? Humidity)>>, ISamplingSensor<(Concentration? Concentration, Temperature? Temperature, RelativeHumidity? Humidity)>, ISensor<(Concentration? Concentration, Temperature? Temperature, RelativeHumidity? Humidity)>, IDisposable, ITemperatureSensor, ISamplingSensor<Temperature>, ISensor<Temperature>, IHumiditySensor, ISamplingSensor<RelativeHumidity>, ISensor<RelativeHumidity>, ICO2ConcentrationSensor, ISamplingSensor<Concentration>, ISensor<Concentration>, ISensor, ISamplingSensor, II2cPeripheral

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

Derived:
Meadow.Foundation.Sensors.Environmental.Scd30

Implements:

Expand

System.IObservable<Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Concentration>,System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>>>>, Meadow.Peripherals.Sensors.ISamplingSensor<System.ValueTuple<System.Nullable<Meadow.Units.Concentration>,System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>>>, Meadow.Peripherals.Sensors.ISensor<System.ValueTuple<System.Nullable<Meadow.Units.Concentration>,System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>>>, System.IDisposable, Meadow.Peripherals.Sensors.ITemperatureSensor, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Temperature>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Temperature>, Meadow.Peripherals.Sensors.Atmospheric.IHumiditySensor, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.RelativeHumidity>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.RelativeHumidity>, Meadow.Peripherals.Sensors.Environmental.ICO2ConcentrationSensor, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Concentration>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Concentration>, Meadow.Peripherals.Sensors.ISensor, Meadow.Peripherals.Sensors.ISamplingSensor, Meadow.Hardware.II2cPeripheral

Properties

CO2Concentration

The current C02 concentration value

View Source
Declaration
public Concentration? CO2Concentration { get; }

Temperature

The current temperature

View Source
Declaration
public Temperature? Temperature { get; }

Humidity

The current humidity

View Source
Declaration
public RelativeHumidity? Humidity { get; }

DefaultI2cAddress

The default I2C address for the peripheral

View Source
Declaration
public byte DefaultI2cAddress { get; }

Methods

PerformSoftReset()

Soft reset the device

View Source
Declaration
public Task PerformSoftReset()
Returns

System.Threading.Tasks.Task

IsDataReady()

Is there sensor measurement data ready

View Source
Declaration
protected bool IsDataReady()
Returns

System.Boolean: True if ready### SetMeasurementInterval(ushort) Set the interval between measurements of the sensor itself. Sensor reads data between 2 or 1800 seconds.

View Source
Declaration
public void SetMeasurementInterval(ushort interval)
Parameters
TypeName
System.UInt16interval

GetMeasurementInterval()

Get the interval between measurements of the sensor itself. Sensor reads data between 2 or 1800 seconds.

View Source
Declaration
public ushort GetMeasurementInterval()
Returns

System.UInt16

SelfCalibrationEnabled()

Get the status of the automatic self calibration

View Source
Declaration
public bool SelfCalibrationEnabled()
Returns

System.Boolean: True if auto calibration is enabled### SetAutoCalibration(bool) Enables or disables the automatic self calibration

View Source
Declaration
protected bool SetAutoCalibration(bool enabled)
Returns

System.Boolean: True if auto read from register is the same as given

Parameters
TypeName
System.Booleanenabled

StartUpdating(TimeSpan?)

Starts measuring sensor data.

View Source
Declaration
public override void StartUpdating(TimeSpan? updateInterval = null)
Parameters
TypeNameDescription
System.Nullable<System.TimeSpan>updateIntervalThe sensor updates based on the measurement interval between 2 and 1800 seconds.

Its recommended to choose an update interval between that. You can change the measurement interval later with Meadow.Foundation.Sensors.Environmental.Scd30Base.SetMeasurementInterval(ushort). |

StartUpdating(ushort, TimeSpan)

Starts measuring sensor data.

View Source
Declaration
public void StartUpdating(ushort ambientPressure, TimeSpan updateInterval)
Parameters
TypeNameDescription
System.UInt16ambientPressureOptional parameter to set the ambient pressure in mBar.
System.TimeSpanupdateIntervalThe sensor updates based on the measurement interval between 2 and 1800 seconds.

Its recommended to choose an update interval between that. You can change the measurement interval later with Meadow.Foundation.Sensors.Environmental.Scd30Base.SetMeasurementInterval(ushort). |

GetAmbientPressureOffset()

Gets the ambient pressure setting used when measuring started.

View Source
Declaration
public ushort GetAmbientPressureOffset()
Returns

System.UInt16

SetAltitudeOffset(ushort)

Sets the Altitude used for ambient pressure calibration. This value is stored on the sensor, even after reboot.

View Source
Declaration
public void SetAltitudeOffset(ushort altitude)
Parameters
TypeNameDescription
System.UInt16altitudeAltitude in meters above sea level.

GetAltitudeOffset()

Gets the Altitude used for ambient pressure calibration.

View Source
Declaration
public ushort GetAltitudeOffset()
Returns

System.UInt16

SetTemperatureOffset(ushort)

Sets the temperature to set in hundredths of degrees, used for temperature compensation.

View Source
Declaration
public void SetTemperatureOffset(ushort offset)
Parameters
TypeName
System.UInt16offset

GetTemperatureOffset()

Get the temperature to set in hundredths of degrees, used for temperature compensation.

View Source
Declaration
public ushort GetTemperatureOffset()
Returns

System.UInt16

ForceCalibration(ushort)

Forces the sensor to recalibrate it's CO2 sensor.

View Source
Declaration
public void ForceCalibration(ushort reference)
Parameters
TypeNameDescription
System.UInt16referenceThe calibration value between 400 and 2000 ppm.
This value is saved in the sensor, even after reboot.

GetForceCalibrationValue()

Get the value used for forced recalibration.

View Source
Declaration
public ushort GetForceCalibrationValue()
Returns

System.UInt16

StopUpdating()

Stop updating the sensor

View Source
Declaration
public override void StopUpdating()

ReadSensor()

Get Scd30 sensor values.

View Source
Declaration
protected override Task<(Concentration? Concentration, Temperature? Temperature, RelativeHumidity? Humidity)> ReadSensor()
Returns

System.Threading.Tasks.Task<System.ValueTuple<System.Nullable<Meadow.Units.Concentration>,System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>>>

RaiseChangedAndNotify(IChangeResult<(Concentration? Concentration, Temperature? Temperature, RelativeHumidity? Humidity)>)

Raise change events for subscribers

View Source
Declaration
protected void RaiseChangedAndNotify(IChangeResult<(Concentration? Concentration, Temperature? Temperature, RelativeHumidity? Humidity)> changeResult)
Parameters
TypeNameDescription
Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Concentration>,System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>>>changeResultThe change result with the current sensor data

Implements

  • System.IObservable<Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Concentration>,System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>>>>
  • Meadow.Peripherals.Sensors.ISamplingSensor<System.ValueTuple<System.Nullable<Meadow.Units.Concentration>,System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>>>
  • Meadow.Peripherals.Sensors.ISensor<System.ValueTuple<System.Nullable<Meadow.Units.Concentration>,System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>>>
  • System.IDisposable
  • Meadow.Peripherals.Sensors.ITemperatureSensor
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Temperature>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Temperature>
  • Meadow.Peripherals.Sensors.Atmospheric.IHumiditySensor
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.RelativeHumidity>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.RelativeHumidity>
  • Meadow.Peripherals.Sensors.Environmental.ICO2ConcentrationSensor
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Concentration>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Concentration>
  • Meadow.Peripherals.Sensors.ISensor
  • Meadow.Peripherals.Sensors.ISamplingSensor
  • Meadow.Hardware.II2cPeripheral