nanoFramework.Iot.Device.Si7021 1.3.952

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package nanoFramework.Iot.Device.Si7021 --version 1.3.952
                    
NuGet\Install-Package nanoFramework.Iot.Device.Si7021 -Version 1.3.952
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="nanoFramework.Iot.Device.Si7021" Version="1.3.952" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="nanoFramework.Iot.Device.Si7021" Version="1.3.952" />
                    
Directory.Packages.props
<PackageReference Include="nanoFramework.Iot.Device.Si7021" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add nanoFramework.Iot.Device.Si7021 --version 1.3.952
                    
#r "nuget: nanoFramework.Iot.Device.Si7021, 1.3.952"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package nanoFramework.Iot.Device.Si7021@1.3.952
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=nanoFramework.Iot.Device.Si7021&version=1.3.952
                    
Install as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.Si7021&version=1.3.952
                    
Install as a Cake Tool

Si7021 - Temperature & Humidity Sensor

The Si7021 device provides temperature and humidity sensor readings with an I2C interface.

Documentation

Board

Sensor image Si7021 sensor

Usage

Important: make sure you properly setup the I2C pins especially for ESP32 before creating the I2cDevice, make sure you install the nanoFramework.Hardware.ESP32 nuget:

//////////////////////////////////////////////////////////////////////
// when connecting to an ESP32 device, need to configure the I2C GPIOs
// used for the bus
Configuration.SetPinFunction(21, DeviceFunction.I2C1_DATA);
Configuration.SetPinFunction(22, DeviceFunction.I2C1_CLOCK);

For other devices like STM32, please make sure you're using the preset pins for the I2C bus you want to use.

Hardware Required

  • Si7021
  • Male/Female Jumper Wires

Circuit

  • SCL - SCL
  • SDA - SDA
  • VCC - 5V
  • GND - GND

Code

I2cConnectionSettings settings = new I2cConnectionSettings(1, Si7021.DefaultI2cAddress);
I2cDevice device = I2cDevice.Create(settings);

using (Si7021 sensor = new Si7021(device, Resolution.Resolution1))
{
    while (true)
    {
        var tempValue = sensor.Temperature;
        var humValue = sensor.Humidity;

        Debug.WriteLine($"Temperature: {tempValue.Celsius:N2}\u00B0C");
        Debug.WriteLine($"Relative humidity: {humValue:N2}%");

        // WeatherHelper supports more calculations, such as saturated vapor pressure, actual vapor pressure and absolute humidity.
        Debug.WriteLine($"Heat index: {WeatherHelper.CalculateHeatIndex(tempValue, humValue).Celsius:N2}\u00B0C");
        Debug.WriteLine($"Dew point: {WeatherHelper.CalculateDewPoint(tempValue, humValue).Celsius:N2}\u00B0C");
        Debug.WriteLine();

        Thread.Sleep(1000);
    }
}

Result

Sample result

Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0-preview.45 0 4/29/2026
2.0.0-preview.32 40 4/20/2026
2.0.0-preview.16 58 3/10/2026
1.3.952 103 3/4/2026
1.3.907 273 10/2/2025
1.3.889 249 7/28/2025
1.3.869 364 4/2/2025
1.3.864 326 4/2/2025
1.3.852 335 3/11/2025
1.3.846 353 3/10/2025
1.3.822 289 2/26/2025
1.3.775 302 2/4/2025
1.3.772 274 2/4/2025
1.3.755 326 1/31/2025
1.3.743 264 1/20/2025
1.3.737 264 1/13/2025
1.3.718 258 12/30/2024
1.3.704 294 12/18/2024
1.3.696 261 12/16/2024
1.3.673 310 10/23/2024
Loading failed