nanoFramework.Iot.Device.Scd30 1.0.651

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package nanoFramework.Iot.Device.Scd30 --version 1.0.651
                    
NuGet\Install-Package nanoFramework.Iot.Device.Scd30 -Version 1.0.651
                    
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.Scd30" Version="1.0.651" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="nanoFramework.Iot.Device.Scd30" Version="1.0.651" />
                    
Directory.Packages.props
<PackageReference Include="nanoFramework.Iot.Device.Scd30" />
                    
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.Scd30 --version 1.0.651
                    
#r "nuget: nanoFramework.Iot.Device.Scd30, 1.0.651"
                    
#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.Scd30@1.0.651
                    
#: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.Scd30&version=1.0.651
                    
Install as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.Scd30&version=1.0.651
                    
Install as a Cake Tool

Sensirion SCD30 Particulate Matter Sensor

This is a library to interact with the Sensirion SCD30 Sensor Module for CO2, humidity and temperature. Currently, only the Modbus interface is implemented. The SCD30 also supports I2C, but requires clock stretching, which is currently not supported in the .NET Nanoframework ESP32 implementation.

Scd30-image.png

Documentation

Usage for the Modbus interface

Important: make sure you properly setup the UART pins for ESP32 before creating the SerialPort. For this, make sure you install the nanoFramework.Hardware.Esp32 NuGet and use the Configuration class to configure the pins:

Configuration.SetPinFunction(5, DeviceFunction.COM3_TX);
Configuration.SetPinFunction(27, DeviceFunction.COM3_RX);

Initialize the SerialPort and pass it to the Scd30Sensor. You'll stay in control of the SerialPort for any exotic situations (i.e. InvertSignalLevels or multiplexing scenarios). The constructor of the Scd30Sensor will configure the SerialPort to the expected BaudRate and other settings:

var scd30 = new Scd30Sensor(new SerialPort("COM3"));

Use the scd30 to interact with the sensor, e.g.:

var firmware = scd30.ReadFirmwareVersion();
Debug.WriteLine($"SCD30 detected: Firmware version={firmware}");

Collect a measurement reliably:

scd30.SetMeasurementInterval(TimeSpan.FromSeconds(2));
scd30.StartContinuousMeasurement();
Thread.Sleep(5000);
if (scd30.GetDataReadyStatus())
{
    var measurement = scd30.ReadMeasurement();
    Debug.WriteLine($"Measurement: {measurement}");
}

The above would output the following:

SCD30 detected: Firmware version=3.66
Measurement: Co2Concentration=400.8741 ppm, Temperature=27.10421752 °C, RelativeHumidity=32.75756835 %RH

Check out the sample for more information.

I don't get any measurements and GetDataReadyStatus never returns true!

When this happens, make sure you provide enough current/voltage to your sensor. In my particular case I was providing power from the 3v3 of my Pycom WiPy to both the vin and sel pins on the SCD30. However, the measurements never worked.

Instead, connecting the 5v to the vin and the 3v3 to sel made the SCD30 work as expected. The sel must be pulled high to enable the Modbus interface.

DO NOT CONNECT 5V TO sel, it is only tolerant up to 4v so you must use a voltage divider if you do not have 3v3 available

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.885 176 10/2/2025
1.0.867 159 7/28/2025
1.0.858 249 4/24/2025
1.0.847 226 4/2/2025
1.0.842 230 4/2/2025
1.0.830 253 3/11/2025
1.0.824 248 3/10/2025
1.0.816 174 3/3/2025
1.0.800 189 2/26/2025
1.0.768 175 2/5/2025
1.0.753 187 2/4/2025
1.0.750 184 2/4/2025
1.0.733 176 1/31/2025
1.0.721 172 1/20/2025
1.0.715 167 1/13/2025
1.0.707 160 1/8/2025
1.0.696 170 12/30/2024
1.0.682 177 12/18/2024
1.0.674 179 12/16/2024
1.0.651 175 10/23/2024
1.0.640 176 10/11/2024
1.0.634 184 10/3/2024
1.0.617 234 9/6/2024
1.0.609 180 8/28/2024
1.0.591 199 8/9/2024
1.0.579 207 7/26/2024
1.0.568 176 7/17/2024
1.0.551 204 6/19/2024
1.0.548 191 6/14/2024
1.0.526 188 5/15/2024
1.0.514 206 4/15/2024
1.0.492 229 3/22/2024
1.0.472 198 2/28/2024
1.0.440 276 1/5/2024
1.0.436 216 12/20/2023
1.0.414 244 11/10/2023
1.0.394 202 11/8/2023
1.0.381 209 10/6/2023
1.0.374 222 9/27/2023
1.0.362 207 9/6/2023
1.0.356 232 8/16/2023
1.0.347 243 8/2/2023
1.0.341 241 7/28/2023
1.0.335 229 7/19/2023
1.0.332 237 7/14/2023
1.0.323 255 6/21/2023
1.0.319 261 6/14/2023
1.0.315 235 6/7/2023
1.0.313 229 6/2/2023
1.0.307 229 5/26/2023
1.0.291 239 5/12/2023
1.0.280 233 5/10/2023
1.0.275 233 5/3/2023
1.0.251 340 3/17/2023
1.0.245 351 3/10/2023
1.0.241 324 3/8/2023
1.0.237 314 2/27/2023
1.0.234 318 2/24/2023
1.0.231 353 2/22/2023
1.0.200 390 1/9/2023
1.0.190 401 1/5/2023
1.0.186 405 1/3/2023
1.0.181 390 12/28/2022
1.0.137 451 11/14/2022
1.0.131 484 11/5/2022
1.0.119 488 10/25/2022
1.0.106 495 10/22/2022
1.0.95 552 10/10/2022
1.0.92 508 10/8/2022
1.0.67 520 9/16/2022
1.0.65 585 9/15/2022
1.0.41 514 9/3/2022
1.0.25 514 8/15/2022
1.0.18 527 8/6/2022
1.0.16 501 8/5/2022
1.0.13 509 8/4/2022
1.0.6 499 8/1/2022
1.0.1 536 7/29/2022