nanoFramework.Iot.Device.Sen5x 1.0.223

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package nanoFramework.Iot.Device.Sen5x --version 1.0.223
NuGet\Install-Package nanoFramework.Iot.Device.Sen5x -Version 1.0.223
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.Sen5x" Version="1.0.223" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add nanoFramework.Iot.Device.Sen5x --version 1.0.223
#r "nuget: nanoFramework.Iot.Device.Sen5x, 1.0.223"
#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.
// Install nanoFramework.Iot.Device.Sen5x as a Cake Addin
#addin nuget:?package=nanoFramework.Iot.Device.Sen5x&version=1.0.223

// Install nanoFramework.Iot.Device.Sen5x as a Cake Tool
#tool nuget:?package=nanoFramework.Iot.Device.Sen5x&version=1.0.223

Sensirion SEN5x series module

This is a library to interact with the Sensirion SEN5x Environmental Node.

Description from its product page:

The SEN5x environmental node is a straightforward, all-in-one sensor solution platform for the accurate measurement of various environmental parameters, such as particulate matter, volatile organic compounds (VOCs), oxidizing gases, such as nitrogen oxide compounds (NOx), as well as humidity & temperature. Thanks to proprietary algorithms, the module enables straightforward integration into various applications. This allows device manufacturers to save valuable project time and personnel resources and focus on their core competencies. End customers receive reliable air quality measurement data based on the SEN5x and benefit from improved air quality to increase health and comfort.

Sen5x-image.png

Documentation

For the implementation of this library the official datasheet. Any other documentation can be found on its product page.

There are three variants at the time of this writing:

  • SEN50-SDN-T, which outputs: Particulate Matter
  • SEN54-SDN-T, which outputs: Particulate Matter, Relative Humidity, Temperature, VOC Index
  • SEN55-SDN-T, which outputs: Particulate Matter, Relative Humidity, Temperature, VOC Index, NOx Index

Note that only the SEN54-SDN-T variant has been tested at this time. Even though the NOx-specific methods have been made available, they have not been tested.

Usage

The example project is built for ESP32 and therefor it uses the nanoFramework.Hardware.Esp32 package to configure the correct pins for the I2C interface:

Configuration.SetPinFunction(21, DeviceFunction.I2C1_DATA);
Configuration.SetPinFunction(22, DeviceFunction.I2C1_CLOCK);

Create the I2cConnectionSettings using correct I2C bus, address and speed. You can use the constants on the Sen5xSensor class for the defaults. Create the I2cDevice and pass that to the Sen5xSensor to create the instance to work with:

var settings = new I2cConnectionSettings(1, Sen5xSensor.DefaultI2cAddress, Sen5xSensor.DefaultI2cBusSpeed);
var i2c = new I2cDevice(settings);
var sensor = new Sen5xSensor(i2c);

Use sensor for all interactions with the SEN5x sensor. The following starts the measurements, reads and prints measurements as they become ready:

sensor.StartMeasurement();
while (true)
{
    if (sensor.ReadDataReadyFlag())
    {
        var measurement = sensor.ReadMeasurement();
        Debug.WriteLine(measurement.ToString());
    }
    Thread.Sleep(1000);
}

Make sure to refer to the datasheet when using the more advanced features.

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
1.0.223 74 4/15/2024
1.0.201 78 3/22/2024
1.0.181 90 2/28/2024
1.0.149 147 1/5/2024
1.0.145 116 12/20/2023
1.0.123 148 11/10/2023
1.0.103 97 11/8/2023
1.0.90 117 10/6/2023
1.0.83 119 9/27/2023
1.0.71 128 9/6/2023
1.0.65 139 8/16/2023
1.0.56 143 8/2/2023
1.0.50 124 7/28/2023
1.0.44 134 7/19/2023
1.0.41 125 7/14/2023
1.0.32 159 6/21/2023
1.0.28 156 6/14/2023
1.0.24 171 6/7/2023
1.0.22 189 6/2/2023
1.0.16 150 5/26/2023
1.0.1 164 5/13/2023