nanoFramework.Iot.Device.Sen5x 1.0.288

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package nanoFramework.Iot.Device.Sen5x --version 1.0.288                
NuGet\Install-Package nanoFramework.Iot.Device.Sen5x -Version 1.0.288                
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.288" />                
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.288                
#r "nuget: nanoFramework.Iot.Device.Sen5x, 1.0.288"                
#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.288

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

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.360 76 10/23/2024
1.0.343 75 10/3/2024
1.0.326 100 9/6/2024
1.0.318 81 8/28/2024
1.0.300 105 8/9/2024
1.0.288 92 7/26/2024
1.0.277 80 7/17/2024
1.0.260 92 6/19/2024
1.0.257 92 6/14/2024
1.0.223 121 4/15/2024
1.0.201 111 3/22/2024
1.0.181 115 2/28/2024
1.0.149 183 1/5/2024
1.0.145 145 12/20/2023
1.0.123 174 11/10/2023
1.0.103 120 11/8/2023
1.0.90 149 10/6/2023
1.0.83 141 9/27/2023
1.0.71 152 9/6/2023
1.0.65 162 8/16/2023
1.0.56 171 8/2/2023
1.0.50 150 7/28/2023
1.0.44 166 7/19/2023
1.0.41 152 7/14/2023
1.0.32 192 6/21/2023
1.0.28 180 6/14/2023
1.0.24 195 6/7/2023
1.0.22 217 6/2/2023
1.0.16 178 5/26/2023
1.0.1 185 5/13/2023