Remarks

Si70xx
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Atmospheric.Si70xx

The SI70xx is a humidity and temperature sensor controlled via I2C.

  • ± 3% RH (max)
  • 0–80% RH
  • High Accuracy Temperature Sensor ±0.4 °C
  • –10 to 85 °C
  • 0 to 100% RH operating range
  • Up to –40 to +125 °C operating range
  • Wide operating voltage (1.9 to 3.6 V)
  • Low Power Consumption
  • 150 µA active current
  • 60 nA standby current

Purchasing

The Si7021 is available on a breakout board from the the following suppliers:

Code Example

Si70xx? sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    sensor = new Si70xx(Device.CreateI2cBus());

    var consumer = Si70xx.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Observer: Temp changed by threshold; new temp: {result.New.Temperature?.Celsius:N2}C, old: {result.Old?.Temperature?.Celsius:N2}C");
        },
        filter: result =>
        {
            if (result.Old?.Temperature is { } oldTemp &&
                result.Old?.Humidity is { } oldHumidity &&
                result.New.Temperature is { } newTemp &&
                result.New.Humidity is { } newHumidity)
            {
                return ((newTemp - oldTemp).Abs().Celsius > 0.5 &&
                        (newHumidity - oldHumidity).Percent > 0.05);
            }
            return false;
        }
    );
    sensor.Subscribe(consumer);

    sensor.Updated += (sender, result) =>
    {
        Resolver.Log.Info($"  Temperature: {result.New.Temperature?.Celsius:F1}C");
        Resolver.Log.Info($"  Relative Humidity: {result.New.Humidity:F1}%");
    };

    return Task.CompletedTask;
}

public override async Task Run()
{
    if (sensor == null) { return; }

    var result = await sensor.Read();
    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Temperature: {result.Temperature?.Celsius:F1}C");
    Resolver.Log.Info($"  Relative Humidity: {result.Humidity:F1}%");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Si7021 to your Meadow board, connect the following:

Si7021 Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

It should look like the following diagram:

Characteristic Locus
Inheritance object ObservableBase<(Temperature? Temperature, RelativeHumidity? Humidity)> SamplingSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)> PollingSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)> ByteCommsSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)> > Si70xx
Implements IObservable<IChangeResult<(Temperature? Temperature, RelativeHumidity? Humidity)>> ISamplingSensor<(Temperature? Temperature, RelativeHumidity? Humidity)> ISensor<(Temperature? Temperature, RelativeHumidity? Humidity)> IDisposable ITemperatureSensor ISamplingSensor<Temperature> ISensor<Temperature> IHumiditySensor ISamplingSensor<RelativeHumidity> ISensor<RelativeHumidity> II2cPeripheral
Inherited Members ByteCommsSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.Init(int, int) ByteCommsSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.Dispose(bool) ByteCommsSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.Dispose() ByteCommsSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.BusComms ByteCommsSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.ReadBuffer ByteCommsSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.WriteBuffer PollingSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.StartUpdating(TimeSpan?) PollingSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.StopUpdating() SamplingSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.samplingLock SamplingSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.ReadSensor() SamplingSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.RaiseEventsAndNotify(IChangeResult<(Temperature? Temperature, RelativeHumidity? Humidity)>) SamplingSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.Read() SamplingSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.SamplingTokenSource SamplingSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.Conditions SamplingSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.IsSampling SamplingSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.UpdateInterval SamplingSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.Updated ObservableBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.NotifyObservers(IChangeResult<(Temperature? Temperature, RelativeHumidity? Humidity)>) ObservableBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.Subscribe(IObserver<IChangeResult<(Temperature? Temperature, RelativeHumidity? Humidity)>>) ObservableBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.CreateObserver(Action<IChangeResult<(Temperature? Temperature, RelativeHumidity? Humidity)>>, Predicate<IChangeResult<(Temperature? Temperature, RelativeHumidity? Humidity)>>) ObservableBase<(Temperature? Temperature, RelativeHumidity? Humidity)>.observers object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation.Sensors.Atmospheric
Assembly Si70xx.dll

Syntax

public class Si70xx : ByteCommsSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity)>, IObservable<IChangeResult<(Temperature? Temperature, RelativeHumidity? Humidity)>>, ISamplingSensor<(Temperature? Temperature, RelativeHumidity? Humidity)>, ISensor<(Temperature? Temperature, RelativeHumidity? Humidity)>, IDisposable, ITemperatureSensor, ISamplingSensor<Temperature>, ISensor<Temperature>, IHumiditySensor, ISamplingSensor<RelativeHumidity>, ISensor<RelativeHumidity>, II2cPeripheral

Constructors

Si70xx(II2cBus, byte)

Create a new SI7021 temperature and humidity sensor

Declaration
public Si70xx(II2cBus i2cBus, byte address = 64)

Parameters

Type Name Description
II2cBus i2cBus

I2CBus

byte address

I2C address (default to 0x40)

Remarks

Si70xx
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Atmospheric.Si70xx

The SI70xx is a humidity and temperature sensor controlled via I2C.

  • ± 3% RH (max)
  • 0–80% RH
  • High Accuracy Temperature Sensor ±0.4 °C
  • –10 to 85 °C
  • 0 to 100% RH operating range
  • Up to –40 to +125 °C operating range
  • Wide operating voltage (1.9 to 3.6 V)
  • Low Power Consumption
  • 150 µA active current
  • 60 nA standby current

Purchasing

The Si7021 is available on a breakout board from the the following suppliers:

Code Example

Si70xx? sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    sensor = new Si70xx(Device.CreateI2cBus());

    var consumer = Si70xx.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Observer: Temp changed by threshold; new temp: {result.New.Temperature?.Celsius:N2}C, old: {result.Old?.Temperature?.Celsius:N2}C");
        },
        filter: result =>
        {
            if (result.Old?.Temperature is { } oldTemp &&
                result.Old?.Humidity is { } oldHumidity &&
                result.New.Temperature is { } newTemp &&
                result.New.Humidity is { } newHumidity)
            {
                return ((newTemp - oldTemp).Abs().Celsius > 0.5 &&
                        (newHumidity - oldHumidity).Percent > 0.05);
            }
            return false;
        }
    );
    sensor.Subscribe(consumer);

    sensor.Updated += (sender, result) =>
    {
        Resolver.Log.Info($"  Temperature: {result.New.Temperature?.Celsius:F1}C");
        Resolver.Log.Info($"  Relative Humidity: {result.New.Humidity:F1}%");
    };

    return Task.CompletedTask;
}

public override async Task Run()
{
    if (sensor == null) { return; }

    var result = await sensor.Read();
    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Temperature: {result.Temperature?.Celsius:F1}C");
    Resolver.Log.Info($"  Relative Humidity: {result.Humidity:F1}%");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Si7021 to your Meadow board, connect the following:

Si7021 Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

It should look like the following diagram:

Properties

DefaultI2cAddress

The default I2C address for the peripheral

Declaration
public byte DefaultI2cAddress { get; }

Property Value

Type Description
byte

Remarks

Si70xx
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Atmospheric.Si70xx

The SI70xx is a humidity and temperature sensor controlled via I2C.

  • ± 3% RH (max)
  • 0–80% RH
  • High Accuracy Temperature Sensor ±0.4 °C
  • –10 to 85 °C
  • 0 to 100% RH operating range
  • Up to –40 to +125 °C operating range
  • Wide operating voltage (1.9 to 3.6 V)
  • Low Power Consumption
  • 150 µA active current
  • 60 nA standby current

Purchasing

The Si7021 is available on a breakout board from the the following suppliers:

Code Example

Si70xx? sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    sensor = new Si70xx(Device.CreateI2cBus());

    var consumer = Si70xx.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Observer: Temp changed by threshold; new temp: {result.New.Temperature?.Celsius:N2}C, old: {result.Old?.Temperature?.Celsius:N2}C");
        },
        filter: result =>
        {
            if (result.Old?.Temperature is { } oldTemp &&
                result.Old?.Humidity is { } oldHumidity &&
                result.New.Temperature is { } newTemp &&
                result.New.Humidity is { } newHumidity)
            {
                return ((newTemp - oldTemp).Abs().Celsius > 0.5 &&
                        (newHumidity - oldHumidity).Percent > 0.05);
            }
            return false;
        }
    );
    sensor.Subscribe(consumer);

    sensor.Updated += (sender, result) =>
    {
        Resolver.Log.Info($"  Temperature: {result.New.Temperature?.Celsius:F1}C");
        Resolver.Log.Info($"  Relative Humidity: {result.New.Humidity:F1}%");
    };

    return Task.CompletedTask;
}

public override async Task Run()
{
    if (sensor == null) { return; }

    var result = await sensor.Read();
    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Temperature: {result.Temperature?.Celsius:F1}C");
    Resolver.Log.Info($"  Relative Humidity: {result.Humidity:F1}%");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Si7021 to your Meadow board, connect the following:

Si7021 Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

It should look like the following diagram:

FirmwareRevision

Firmware revision of the sensor

Declaration
public byte FirmwareRevision { get; }

Property Value

Type Description
byte

Remarks

Si70xx
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Atmospheric.Si70xx

The SI70xx is a humidity and temperature sensor controlled via I2C.

  • ± 3% RH (max)
  • 0–80% RH
  • High Accuracy Temperature Sensor ±0.4 °C
  • –10 to 85 °C
  • 0 to 100% RH operating range
  • Up to –40 to +125 °C operating range
  • Wide operating voltage (1.9 to 3.6 V)
  • Low Power Consumption
  • 150 µA active current
  • 60 nA standby current

Purchasing

The Si7021 is available on a breakout board from the the following suppliers:

Code Example

Si70xx? sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    sensor = new Si70xx(Device.CreateI2cBus());

    var consumer = Si70xx.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Observer: Temp changed by threshold; new temp: {result.New.Temperature?.Celsius:N2}C, old: {result.Old?.Temperature?.Celsius:N2}C");
        },
        filter: result =>
        {
            if (result.Old?.Temperature is { } oldTemp &&
                result.Old?.Humidity is { } oldHumidity &&
                result.New.Temperature is { } newTemp &&
                result.New.Humidity is { } newHumidity)
            {
                return ((newTemp - oldTemp).Abs().Celsius > 0.5 &&
                        (newHumidity - oldHumidity).Percent > 0.05);
            }
            return false;
        }
    );
    sensor.Subscribe(consumer);

    sensor.Updated += (sender, result) =>
    {
        Resolver.Log.Info($"  Temperature: {result.New.Temperature?.Celsius:F1}C");
        Resolver.Log.Info($"  Relative Humidity: {result.New.Humidity:F1}%");
    };

    return Task.CompletedTask;
}

public override async Task Run()
{
    if (sensor == null) { return; }

    var result = await sensor.Read();
    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Temperature: {result.Temperature?.Celsius:F1}C");
    Resolver.Log.Info($"  Relative Humidity: {result.Humidity:F1}%");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Si7021 to your Meadow board, connect the following:

Si7021 Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

It should look like the following diagram:

Humidity

The humidity, in percent relative humidity, from the last reading

Declaration
public RelativeHumidity? Humidity { get; }

Property Value

Type Description
RelativeHumidity?

Remarks

Si70xx
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Atmospheric.Si70xx

The SI70xx is a humidity and temperature sensor controlled via I2C.

  • ± 3% RH (max)
  • 0–80% RH
  • High Accuracy Temperature Sensor ±0.4 °C
  • –10 to 85 °C
  • 0 to 100% RH operating range
  • Up to –40 to +125 °C operating range
  • Wide operating voltage (1.9 to 3.6 V)
  • Low Power Consumption
  • 150 µA active current
  • 60 nA standby current

Purchasing

The Si7021 is available on a breakout board from the the following suppliers:

Code Example

Si70xx? sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    sensor = new Si70xx(Device.CreateI2cBus());

    var consumer = Si70xx.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Observer: Temp changed by threshold; new temp: {result.New.Temperature?.Celsius:N2}C, old: {result.Old?.Temperature?.Celsius:N2}C");
        },
        filter: result =>
        {
            if (result.Old?.Temperature is { } oldTemp &&
                result.Old?.Humidity is { } oldHumidity &&
                result.New.Temperature is { } newTemp &&
                result.New.Humidity is { } newHumidity)
            {
                return ((newTemp - oldTemp).Abs().Celsius > 0.5 &&
                        (newHumidity - oldHumidity).Percent > 0.05);
            }
            return false;
        }
    );
    sensor.Subscribe(consumer);

    sensor.Updated += (sender, result) =>
    {
        Resolver.Log.Info($"  Temperature: {result.New.Temperature?.Celsius:F1}C");
        Resolver.Log.Info($"  Relative Humidity: {result.New.Humidity:F1}%");
    };

    return Task.CompletedTask;
}

public override async Task Run()
{
    if (sensor == null) { return; }

    var result = await sensor.Read();
    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Temperature: {result.Temperature?.Celsius:F1}C");
    Resolver.Log.Info($"  Relative Humidity: {result.Humidity:F1}%");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Si7021 to your Meadow board, connect the following:

Si7021 Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

It should look like the following diagram:

SensorType

Device type as extracted from the serial number

Declaration
public Si70xx.DeviceType SensorType { get; }

Property Value

Type Description
Si70xx.DeviceType

Remarks

Si70xx
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Atmospheric.Si70xx

The SI70xx is a humidity and temperature sensor controlled via I2C.

  • ± 3% RH (max)
  • 0–80% RH
  • High Accuracy Temperature Sensor ±0.4 °C
  • –10 to 85 °C
  • 0 to 100% RH operating range
  • Up to –40 to +125 °C operating range
  • Wide operating voltage (1.9 to 3.6 V)
  • Low Power Consumption
  • 150 µA active current
  • 60 nA standby current

Purchasing

The Si7021 is available on a breakout board from the the following suppliers:

Code Example

Si70xx? sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    sensor = new Si70xx(Device.CreateI2cBus());

    var consumer = Si70xx.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Observer: Temp changed by threshold; new temp: {result.New.Temperature?.Celsius:N2}C, old: {result.Old?.Temperature?.Celsius:N2}C");
        },
        filter: result =>
        {
            if (result.Old?.Temperature is { } oldTemp &&
                result.Old?.Humidity is { } oldHumidity &&
                result.New.Temperature is { } newTemp &&
                result.New.Humidity is { } newHumidity)
            {
                return ((newTemp - oldTemp).Abs().Celsius > 0.5 &&
                        (newHumidity - oldHumidity).Percent > 0.05);
            }
            return false;
        }
    );
    sensor.Subscribe(consumer);

    sensor.Updated += (sender, result) =>
    {
        Resolver.Log.Info($"  Temperature: {result.New.Temperature?.Celsius:F1}C");
        Resolver.Log.Info($"  Relative Humidity: {result.New.Humidity:F1}%");
    };

    return Task.CompletedTask;
}

public override async Task Run()
{
    if (sensor == null) { return; }

    var result = await sensor.Read();
    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Temperature: {result.Temperature?.Celsius:F1}C");
    Resolver.Log.Info($"  Relative Humidity: {result.Humidity:F1}%");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Si7021 to your Meadow board, connect the following:

Si7021 Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

It should look like the following diagram:

SerialNumber

Serial number of the device

Declaration
public ulong SerialNumber { get; }

Property Value

Type Description
ulong

Remarks

Si70xx
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Atmospheric.Si70xx

The SI70xx is a humidity and temperature sensor controlled via I2C.

  • ± 3% RH (max)
  • 0–80% RH
  • High Accuracy Temperature Sensor ±0.4 °C
  • –10 to 85 °C
  • 0 to 100% RH operating range
  • Up to –40 to +125 °C operating range
  • Wide operating voltage (1.9 to 3.6 V)
  • Low Power Consumption
  • 150 µA active current
  • 60 nA standby current

Purchasing

The Si7021 is available on a breakout board from the the following suppliers:

Code Example

Si70xx? sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    sensor = new Si70xx(Device.CreateI2cBus());

    var consumer = Si70xx.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Observer: Temp changed by threshold; new temp: {result.New.Temperature?.Celsius:N2}C, old: {result.Old?.Temperature?.Celsius:N2}C");
        },
        filter: result =>
        {
            if (result.Old?.Temperature is { } oldTemp &&
                result.Old?.Humidity is { } oldHumidity &&
                result.New.Temperature is { } newTemp &&
                result.New.Humidity is { } newHumidity)
            {
                return ((newTemp - oldTemp).Abs().Celsius > 0.5 &&
                        (newHumidity - oldHumidity).Percent > 0.05);
            }
            return false;
        }
    );
    sensor.Subscribe(consumer);

    sensor.Updated += (sender, result) =>
    {
        Resolver.Log.Info($"  Temperature: {result.New.Temperature?.Celsius:F1}C");
        Resolver.Log.Info($"  Relative Humidity: {result.New.Humidity:F1}%");
    };

    return Task.CompletedTask;
}

public override async Task Run()
{
    if (sensor == null) { return; }

    var result = await sensor.Read();
    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Temperature: {result.Temperature?.Celsius:F1}C");
    Resolver.Log.Info($"  Relative Humidity: {result.Humidity:F1}%");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Si7021 to your Meadow board, connect the following:

Si7021 Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

It should look like the following diagram:

Temperature

The temperature from the last reading

Declaration
public Temperature? Temperature { get; }

Property Value

Type Description
Temperature?

Remarks

Si70xx
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Atmospheric.Si70xx

The SI70xx is a humidity and temperature sensor controlled via I2C.

  • ± 3% RH (max)
  • 0–80% RH
  • High Accuracy Temperature Sensor ±0.4 °C
  • –10 to 85 °C
  • 0 to 100% RH operating range
  • Up to –40 to +125 °C operating range
  • Wide operating voltage (1.9 to 3.6 V)
  • Low Power Consumption
  • 150 µA active current
  • 60 nA standby current

Purchasing

The Si7021 is available on a breakout board from the the following suppliers:

Code Example

Si70xx? sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    sensor = new Si70xx(Device.CreateI2cBus());

    var consumer = Si70xx.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Observer: Temp changed by threshold; new temp: {result.New.Temperature?.Celsius:N2}C, old: {result.Old?.Temperature?.Celsius:N2}C");
        },
        filter: result =>
        {
            if (result.Old?.Temperature is { } oldTemp &&
                result.Old?.Humidity is { } oldHumidity &&
                result.New.Temperature is { } newTemp &&
                result.New.Humidity is { } newHumidity)
            {
                return ((newTemp - oldTemp).Abs().Celsius > 0.5 &&
                        (newHumidity - oldHumidity).Percent > 0.05);
            }
            return false;
        }
    );
    sensor.Subscribe(consumer);

    sensor.Updated += (sender, result) =>
    {
        Resolver.Log.Info($"  Temperature: {result.New.Temperature?.Celsius:F1}C");
        Resolver.Log.Info($"  Relative Humidity: {result.New.Humidity:F1}%");
    };

    return Task.CompletedTask;
}

public override async Task Run()
{
    if (sensor == null) { return; }

    var result = await sensor.Read();
    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Temperature: {result.Temperature?.Celsius:F1}C");
    Resolver.Log.Info($"  Relative Humidity: {result.Humidity:F1}%");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Si7021 to your Meadow board, connect the following:

Si7021 Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

It should look like the following diagram:

Methods

Heater(bool)

Turn the heater on or off

Declaration
public void Heater(bool onOrOff)

Parameters

Type Name Description
bool onOrOff

Heater status, true = turn heater on, false = turn heater off.

Remarks

Si70xx
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Atmospheric.Si70xx

The SI70xx is a humidity and temperature sensor controlled via I2C.

  • ± 3% RH (max)
  • 0–80% RH
  • High Accuracy Temperature Sensor ±0.4 °C
  • –10 to 85 °C
  • 0 to 100% RH operating range
  • Up to –40 to +125 °C operating range
  • Wide operating voltage (1.9 to 3.6 V)
  • Low Power Consumption
  • 150 µA active current
  • 60 nA standby current

Purchasing

The Si7021 is available on a breakout board from the the following suppliers:

Code Example

Si70xx? sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    sensor = new Si70xx(Device.CreateI2cBus());

    var consumer = Si70xx.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Observer: Temp changed by threshold; new temp: {result.New.Temperature?.Celsius:N2}C, old: {result.Old?.Temperature?.Celsius:N2}C");
        },
        filter: result =>
        {
            if (result.Old?.Temperature is { } oldTemp &&
                result.Old?.Humidity is { } oldHumidity &&
                result.New.Temperature is { } newTemp &&
                result.New.Humidity is { } newHumidity)
            {
                return ((newTemp - oldTemp).Abs().Celsius > 0.5 &&
                        (newHumidity - oldHumidity).Percent > 0.05);
            }
            return false;
        }
    );
    sensor.Subscribe(consumer);

    sensor.Updated += (sender, result) =>
    {
        Resolver.Log.Info($"  Temperature: {result.New.Temperature?.Celsius:F1}C");
        Resolver.Log.Info($"  Relative Humidity: {result.New.Humidity:F1}%");
    };

    return Task.CompletedTask;
}

public override async Task Run()
{
    if (sensor == null) { return; }

    var result = await sensor.Read();
    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Temperature: {result.Temperature?.Celsius:F1}C");
    Resolver.Log.Info($"  Relative Humidity: {result.Humidity:F1}%");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Si7021 to your Meadow board, connect the following:

Si7021 Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

It should look like the following diagram:

Initialize()

Initialize the sensor

Declaration
protected void Initialize()

Remarks

Si70xx
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Atmospheric.Si70xx

The SI70xx is a humidity and temperature sensor controlled via I2C.

  • ± 3% RH (max)
  • 0–80% RH
  • High Accuracy Temperature Sensor ±0.4 °C
  • –10 to 85 °C
  • 0 to 100% RH operating range
  • Up to –40 to +125 °C operating range
  • Wide operating voltage (1.9 to 3.6 V)
  • Low Power Consumption
  • 150 µA active current
  • 60 nA standby current

Purchasing

The Si7021 is available on a breakout board from the the following suppliers:

Code Example

Si70xx? sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    sensor = new Si70xx(Device.CreateI2cBus());

    var consumer = Si70xx.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Observer: Temp changed by threshold; new temp: {result.New.Temperature?.Celsius:N2}C, old: {result.Old?.Temperature?.Celsius:N2}C");
        },
        filter: result =>
        {
            if (result.Old?.Temperature is { } oldTemp &&
                result.Old?.Humidity is { } oldHumidity &&
                result.New.Temperature is { } newTemp &&
                result.New.Humidity is { } newHumidity)
            {
                return ((newTemp - oldTemp).Abs().Celsius > 0.5 &&
                        (newHumidity - oldHumidity).Percent > 0.05);
            }
            return false;
        }
    );
    sensor.Subscribe(consumer);

    sensor.Updated += (sender, result) =>
    {
        Resolver.Log.Info($"  Temperature: {result.New.Temperature?.Celsius:F1}C");
        Resolver.Log.Info($"  Relative Humidity: {result.New.Humidity:F1}%");
    };

    return Task.CompletedTask;
}

public override async Task Run()
{
    if (sensor == null) { return; }

    var result = await sensor.Read();
    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Temperature: {result.Temperature?.Celsius:F1}C");
    Resolver.Log.Info($"  Relative Humidity: {result.Humidity:F1}%");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Si7021 to your Meadow board, connect the following:

Si7021 Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

It should look like the following diagram:

RaiseEventsAndNotify(IChangeResult<(Temperature? Temperature, RelativeHumidity? Humidity)>)

Inheritance-safe way to raise events and notify observers.

Declaration
protected override void RaiseEventsAndNotify(IChangeResult<(Temperature? Temperature, RelativeHumidity? Humidity)> changeResult)

Parameters

Type Name Description
IChangeResult<(Temperature? Temperature, RelativeHumidity? Humidity)> changeResult

Overrides

Remarks

Si70xx
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Atmospheric.Si70xx

The SI70xx is a humidity and temperature sensor controlled via I2C.

  • ± 3% RH (max)
  • 0–80% RH
  • High Accuracy Temperature Sensor ±0.4 °C
  • –10 to 85 °C
  • 0 to 100% RH operating range
  • Up to –40 to +125 °C operating range
  • Wide operating voltage (1.9 to 3.6 V)
  • Low Power Consumption
  • 150 µA active current
  • 60 nA standby current

Purchasing

The Si7021 is available on a breakout board from the the following suppliers:

Code Example

Si70xx? sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    sensor = new Si70xx(Device.CreateI2cBus());

    var consumer = Si70xx.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Observer: Temp changed by threshold; new temp: {result.New.Temperature?.Celsius:N2}C, old: {result.Old?.Temperature?.Celsius:N2}C");
        },
        filter: result =>
        {
            if (result.Old?.Temperature is { } oldTemp &&
                result.Old?.Humidity is { } oldHumidity &&
                result.New.Temperature is { } newTemp &&
                result.New.Humidity is { } newHumidity)
            {
                return ((newTemp - oldTemp).Abs().Celsius > 0.5 &&
                        (newHumidity - oldHumidity).Percent > 0.05);
            }
            return false;
        }
    );
    sensor.Subscribe(consumer);

    sensor.Updated += (sender, result) =>
    {
        Resolver.Log.Info($"  Temperature: {result.New.Temperature?.Celsius:F1}C");
        Resolver.Log.Info($"  Relative Humidity: {result.New.Humidity:F1}%");
    };

    return Task.CompletedTask;
}

public override async Task Run()
{
    if (sensor == null) { return; }

    var result = await sensor.Read();
    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Temperature: {result.Temperature?.Celsius:F1}C");
    Resolver.Log.Info($"  Relative Humidity: {result.Humidity:F1}%");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Si7021 to your Meadow board, connect the following:

Si7021 Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

It should look like the following diagram:

ReadSensor()

Reads data from the sensor

Declaration
protected override Task<(Temperature? Temperature, RelativeHumidity? Humidity)> ReadSensor()

Returns

Type Description
Task<(Temperature? Temperature, RelativeHumidity? Humidity)>

The latest sensor reading

Overrides

Meadow.Foundation.SamplingSensorBase<(Meadow.Units.Temperature? Temperature, Meadow.Units.RelativeHumidity? Humidity)>.ReadSensor()

Remarks

Si70xx
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Atmospheric.Si70xx

The SI70xx is a humidity and temperature sensor controlled via I2C.

  • ± 3% RH (max)
  • 0–80% RH
  • High Accuracy Temperature Sensor ±0.4 °C
  • –10 to 85 °C
  • 0 to 100% RH operating range
  • Up to –40 to +125 °C operating range
  • Wide operating voltage (1.9 to 3.6 V)
  • Low Power Consumption
  • 150 µA active current
  • 60 nA standby current

Purchasing

The Si7021 is available on a breakout board from the the following suppliers:

Code Example

Si70xx? sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    sensor = new Si70xx(Device.CreateI2cBus());

    var consumer = Si70xx.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Observer: Temp changed by threshold; new temp: {result.New.Temperature?.Celsius:N2}C, old: {result.Old?.Temperature?.Celsius:N2}C");
        },
        filter: result =>
        {
            if (result.Old?.Temperature is { } oldTemp &&
                result.Old?.Humidity is { } oldHumidity &&
                result.New.Temperature is { } newTemp &&
                result.New.Humidity is { } newHumidity)
            {
                return ((newTemp - oldTemp).Abs().Celsius > 0.5 &&
                        (newHumidity - oldHumidity).Percent > 0.05);
            }
            return false;
        }
    );
    sensor.Subscribe(consumer);

    sensor.Updated += (sender, result) =>
    {
        Resolver.Log.Info($"  Temperature: {result.New.Temperature?.Celsius:F1}C");
        Resolver.Log.Info($"  Relative Humidity: {result.New.Humidity:F1}%");
    };

    return Task.CompletedTask;
}

public override async Task Run()
{
    if (sensor == null) { return; }

    var result = await sensor.Read();
    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Temperature: {result.Temperature?.Celsius:F1}C");
    Resolver.Log.Info($"  Relative Humidity: {result.Humidity:F1}%");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Si7021 to your Meadow board, connect the following:

Si7021 Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

It should look like the following diagram:

Reset()

Reset the sensor

Declaration
protected void Reset()

Remarks

Si70xx
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Atmospheric.Si70xx

The SI70xx is a humidity and temperature sensor controlled via I2C.

  • ± 3% RH (max)
  • 0–80% RH
  • High Accuracy Temperature Sensor ±0.4 °C
  • –10 to 85 °C
  • 0 to 100% RH operating range
  • Up to –40 to +125 °C operating range
  • Wide operating voltage (1.9 to 3.6 V)
  • Low Power Consumption
  • 150 µA active current
  • 60 nA standby current

Purchasing

The Si7021 is available on a breakout board from the the following suppliers:

Code Example

Si70xx? sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    sensor = new Si70xx(Device.CreateI2cBus());

    var consumer = Si70xx.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Observer: Temp changed by threshold; new temp: {result.New.Temperature?.Celsius:N2}C, old: {result.Old?.Temperature?.Celsius:N2}C");
        },
        filter: result =>
        {
            if (result.Old?.Temperature is { } oldTemp &&
                result.Old?.Humidity is { } oldHumidity &&
                result.New.Temperature is { } newTemp &&
                result.New.Humidity is { } newHumidity)
            {
                return ((newTemp - oldTemp).Abs().Celsius > 0.5 &&
                        (newHumidity - oldHumidity).Percent > 0.05);
            }
            return false;
        }
    );
    sensor.Subscribe(consumer);

    sensor.Updated += (sender, result) =>
    {
        Resolver.Log.Info($"  Temperature: {result.New.Temperature?.Celsius:F1}C");
        Resolver.Log.Info($"  Relative Humidity: {result.New.Humidity:F1}%");
    };

    return Task.CompletedTask;
}

public override async Task Run()
{
    if (sensor == null) { return; }

    var result = await sensor.Read();
    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Temperature: {result.Temperature?.Celsius:F1}C");
    Resolver.Log.Info($"  Relative Humidity: {result.Humidity:F1}%");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Si7021 to your Meadow board, connect the following:

Si7021 Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

It should look like the following diagram:

Events

HumidityUpdated

Raised when the humidity value changes

Declaration
public event EventHandler<IChangeResult<RelativeHumidity>> HumidityUpdated

Event Type

Type Description
EventHandler<IChangeResult<RelativeHumidity>>

Remarks

Si70xx
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Atmospheric.Si70xx

The SI70xx is a humidity and temperature sensor controlled via I2C.

  • ± 3% RH (max)
  • 0–80% RH
  • High Accuracy Temperature Sensor ±0.4 °C
  • –10 to 85 °C
  • 0 to 100% RH operating range
  • Up to –40 to +125 °C operating range
  • Wide operating voltage (1.9 to 3.6 V)
  • Low Power Consumption
  • 150 µA active current
  • 60 nA standby current

Purchasing

The Si7021 is available on a breakout board from the the following suppliers:

Code Example

Si70xx? sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    sensor = new Si70xx(Device.CreateI2cBus());

    var consumer = Si70xx.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Observer: Temp changed by threshold; new temp: {result.New.Temperature?.Celsius:N2}C, old: {result.Old?.Temperature?.Celsius:N2}C");
        },
        filter: result =>
        {
            if (result.Old?.Temperature is { } oldTemp &&
                result.Old?.Humidity is { } oldHumidity &&
                result.New.Temperature is { } newTemp &&
                result.New.Humidity is { } newHumidity)
            {
                return ((newTemp - oldTemp).Abs().Celsius > 0.5 &&
                        (newHumidity - oldHumidity).Percent > 0.05);
            }
            return false;
        }
    );
    sensor.Subscribe(consumer);

    sensor.Updated += (sender, result) =>
    {
        Resolver.Log.Info($"  Temperature: {result.New.Temperature?.Celsius:F1}C");
        Resolver.Log.Info($"  Relative Humidity: {result.New.Humidity:F1}%");
    };

    return Task.CompletedTask;
}

public override async Task Run()
{
    if (sensor == null) { return; }

    var result = await sensor.Read();
    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Temperature: {result.Temperature?.Celsius:F1}C");
    Resolver.Log.Info($"  Relative Humidity: {result.Humidity:F1}%");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Si7021 to your Meadow board, connect the following:

Si7021 Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

It should look like the following diagram:

TemperatureUpdated

Raised when the temperature value changes

Declaration
public event EventHandler<IChangeResult<Temperature>> TemperatureUpdated

Event Type

Type Description
EventHandler<IChangeResult<Temperature>>

Remarks

Si70xx
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Sensors.Atmospheric.Si70xx

The SI70xx is a humidity and temperature sensor controlled via I2C.

  • ± 3% RH (max)
  • 0–80% RH
  • High Accuracy Temperature Sensor ±0.4 °C
  • –10 to 85 °C
  • 0 to 100% RH operating range
  • Up to –40 to +125 °C operating range
  • Wide operating voltage (1.9 to 3.6 V)
  • Low Power Consumption
  • 150 µA active current
  • 60 nA standby current

Purchasing

The Si7021 is available on a breakout board from the the following suppliers:

Code Example

Si70xx? sensor;

public override Task Initialize()
{
    Resolver.Log.Info("Initializing...");

    sensor = new Si70xx(Device.CreateI2cBus());

    var consumer = Si70xx.CreateObserver(
        handler: result =>
        {
            Resolver.Log.Info($"Observer: Temp changed by threshold; new temp: {result.New.Temperature?.Celsius:N2}C, old: {result.Old?.Temperature?.Celsius:N2}C");
        },
        filter: result =>
        {
            if (result.Old?.Temperature is { } oldTemp &&
                result.Old?.Humidity is { } oldHumidity &&
                result.New.Temperature is { } newTemp &&
                result.New.Humidity is { } newHumidity)
            {
                return ((newTemp - oldTemp).Abs().Celsius > 0.5 &&
                        (newHumidity - oldHumidity).Percent > 0.05);
            }
            return false;
        }
    );
    sensor.Subscribe(consumer);

    sensor.Updated += (sender, result) =>
    {
        Resolver.Log.Info($"  Temperature: {result.New.Temperature?.Celsius:F1}C");
        Resolver.Log.Info($"  Relative Humidity: {result.New.Humidity:F1}%");
    };

    return Task.CompletedTask;
}

public override async Task Run()
{
    if (sensor == null) { return; }

    var result = await sensor.Read();
    Resolver.Log.Info("Initial Readings:");
    Resolver.Log.Info($"  Temperature: {result.Temperature?.Celsius:F1}C");
    Resolver.Log.Info($"  Relative Humidity: {result.Humidity:F1}%");

    sensor.StartUpdating(TimeSpan.FromSeconds(1));
}

Sample project(s) available on GitHub

Wiring Example

To wire a Si7021 to your Meadow board, connect the following:

Si7021 Meadow Pin
GND GND
SCL D08 (SCL)
SDA D07 (SDA)
VCC 3V3

It should look like the following diagram: