Class Scd30Base
Base class for SCD30 C02 sensor
Assembly: Scd30.dll
View Source
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
public Concentration? CO2Concentration { get; }
Temperature
The current temperature
View Source
public Temperature? Temperature { get; }
Humidity
The current humidity
View Source
public RelativeHumidity? Humidity { get; }
DefaultI2cAddress
The default I2C address for the peripheral
View Source
public byte DefaultI2cAddress { get; }
Methods
PerformSoftReset()
Soft reset the device
View Source
public Task PerformSoftReset()
Returns
System.Threading.Tasks.Task
IsDataReady()
Is there sensor measurement data ready
View Source
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
public void SetMeasurementInterval(ushort interval)
Parameters
Type | Name |
---|---|
System.UInt16 | interval |
GetMeasurementInterval()
Get the interval between measurements of the sensor itself. Sensor reads data between 2 or 1800 seconds.
View Source
public ushort GetMeasurementInterval()
Returns
System.UInt16
SelfCalibrationEnabled()
Get the status of the automatic self calibration
View Source
public bool SelfCalibrationEnabled()
Returns
System.Boolean
: True if auto calibration is enabled### SetAutoCalibration(bool)
Enables or disables the automatic self calibration
View Source
protected bool SetAutoCalibration(bool enabled)
Returns
System.Boolean
: True if auto read from register is the same as given
Parameters
Type | Name |
---|---|
System.Boolean | enabled |
StartUpdating(TimeSpan?)
Starts measuring sensor data.
View Source
public override void StartUpdating(TimeSpan? updateInterval = null)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.TimeSpan> | updateInterval | The 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
public void StartUpdating(ushort ambientPressure, TimeSpan updateInterval)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | ambientPressure | Optional parameter to set the ambient pressure in mBar. |
System.TimeSpan | updateInterval | The 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
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
public void SetAltitudeOffset(ushort altitude)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | altitude | Altitude in meters above sea level. |
GetAltitudeOffset()
Gets the Altitude used for ambient pressure calibration.
View Source
public ushort GetAltitudeOffset()
Returns
System.UInt16
SetTemperatureOffset(ushort)
Sets the temperature to set in hundredths of degrees, used for temperature compensation.
View Source
public void SetTemperatureOffset(ushort offset)
Parameters
Type | Name |
---|---|
System.UInt16 | offset |
GetTemperatureOffset()
Get the temperature to set in hundredths of degrees, used for temperature compensation.
View Source
public ushort GetTemperatureOffset()
Returns
System.UInt16
ForceCalibration(ushort)
Forces the sensor to recalibrate it's CO2 sensor.
View Source
public void ForceCalibration(ushort reference)
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | reference | The 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
public ushort GetForceCalibrationValue()
Returns
System.UInt16
StopUpdating()
Stop updating the sensor
View Source
public override void StopUpdating()
ReadSensor()
Get Scd30 sensor values.
View Source
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
protected void RaiseChangedAndNotify(IChangeResult<(Concentration? Concentration, Temperature? Temperature, RelativeHumidity? Humidity)> changeResult)
Parameters
Type | Name | Description |
---|---|---|
Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Concentration>,System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>>> | changeResult | The 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