nanoFramework.Iot.Device.Sps30
1.1.639
Prefix Reserved
See the version list below for details.
dotnet add package nanoFramework.Iot.Device.Sps30 --version 1.1.639
NuGet\Install-Package nanoFramework.Iot.Device.Sps30 -Version 1.1.639
<PackageReference Include="nanoFramework.Iot.Device.Sps30" Version="1.1.639" />
<PackageVersion Include="nanoFramework.Iot.Device.Sps30" Version="1.1.639" />
<PackageReference Include="nanoFramework.Iot.Device.Sps30" />
paket add nanoFramework.Iot.Device.Sps30 --version 1.1.639
#r "nuget: nanoFramework.Iot.Device.Sps30, 1.1.639"
#:package nanoFramework.Iot.Device.Sps30@1.1.639
#addin nuget:?package=nanoFramework.Iot.Device.Sps30&version=1.1.639
#tool nuget:?package=nanoFramework.Iot.Device.Sps30&version=1.1.639
Sensirion SPS30 Particulate Matter Sensor
This is a library to interact with the Sensirion SPS30 Particulate Matter Sensor. Currently, only the UART interface using the SHDLC protocol is implemented. The SPS30 also supports I2C.
Documentation
- The datasheet for this sensor can be found here
Usage for the UART 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(4, DeviceFunction.COM2_TX);
Configuration.SetPinFunction(15, DeviceFunction.COM2_RX);
Initialize the SerialPort, wrap it in the ShdlcProtocol, then pass to the Sps30Sensor:
var serial = new SerialPort("COM2", 115200, Parity.None, 8, StopBits.One);
var shdlc = new ShdlcProtocol(serial, timeoutInMillis: 10000);
var sps30 = new Sps30Sensor(shdlc);
Use the sps30 to interact with the sensor, e.g.:
var version = sps30.ReadVersion();
Debug.WriteLine($"SPS30 detected: {version}");
Collect a measurement reliably:
try { sps30.StopMeasurement(); } catch { } // In case already measuring from a previous run
sps30.StartMeasurement(MeasurementOutputFormat.Float);
Thread.Sleep(5000); // SPS30 requires some time before it can sample data
var measurement = sps30.ReadMeasuredValues();
Debug.WriteLine($"Measurement: {measurement}");
The above would output the following:
SPS30 detected: ID=00080000, serial=4E1AD1BB796C64C5, version=Firmware V2.1, Hardware V7, SHDLC V2.0, status=RawRegister: 0, FanSpeedOutOfRange: False, LaserFailure: False, FanFailureBlockedOrBroken: False, cleaninginterval=604800
Measurement: MassConcentration [µg/m³] PM1.0=2.00064229965, PM2.5=5.78215932, PM4.0=8.74958038, PM10.0=9.3430643, NumberConcentration [#/cm³] PM0.5=5.54537582, PM1.0=12.034433364, PM2.5=15.72880268, PM4.0=16.44550895, PM10.0=16.58645629, TypicalParticleSize[nm]=675.40591955
Check out the sample for more information.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net is compatible. |
-
- nanoFramework.CoreLibrary (>= 1.15.5)
- nanoFramework.Runtime.Events (>= 1.11.18)
- nanoFramework.Runtime.Native (>= 1.6.12)
- nanoFramework.System.Buffers.Binary.BinaryPrimitives (>= 1.2.628)
- nanoFramework.System.Diagnostics.Stopwatch (>= 1.2.628)
- nanoFramework.System.IO.Ports (>= 1.1.86)
- nanoFramework.System.IO.Streams (>= 1.1.59)
- nanoFramework.System.Text (>= 1.2.54)
- UnitsNet.nanoFramework.Length (>= 5.58.0)
- UnitsNet.nanoFramework.MassConcentration (>= 5.58.0)
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.1.907 | 175 | 10/2/2025 |
| 1.1.889 | 154 | 7/28/2025 |
| 1.1.880 | 235 | 4/24/2025 |
| 1.1.869 | 242 | 4/2/2025 |
| 1.1.864 | 232 | 4/2/2025 |
| 1.1.852 | 227 | 3/11/2025 |
| 1.1.846 | 237 | 3/10/2025 |
| 1.1.838 | 170 | 3/3/2025 |
| 1.1.822 | 181 | 2/26/2025 |
| 1.1.790 | 180 | 2/5/2025 |
| 1.1.775 | 189 | 2/4/2025 |
| 1.1.772 | 190 | 2/4/2025 |
| 1.1.755 | 173 | 1/31/2025 |
| 1.1.743 | 162 | 1/20/2025 |
| 1.1.737 | 159 | 1/13/2025 |
| 1.1.729 | 162 | 1/8/2025 |
| 1.1.718 | 168 | 12/30/2024 |
| 1.1.704 | 174 | 12/18/2024 |
| 1.1.696 | 170 | 12/16/2024 |
| 1.1.673 | 183 | 10/23/2024 |
| 1.1.662 | 179 | 10/11/2024 |
| 1.1.656 | 175 | 10/3/2024 |
| 1.1.639 | 196 | 9/6/2024 |
| 1.1.631 | 176 | 8/28/2024 |
| 1.1.613 | 211 | 8/9/2024 |
| 1.1.601 | 162 | 7/26/2024 |
| 1.1.590 | 178 | 7/17/2024 |
| 1.1.573 | 205 | 6/19/2024 |
| 1.1.570 | 188 | 6/14/2024 |
| 1.1.548 | 188 | 5/15/2024 |
| 1.1.536 | 194 | 4/15/2024 |
| 1.1.514 | 206 | 3/22/2024 |
| 1.1.494 | 183 | 2/28/2024 |
| 1.1.462 | 291 | 1/5/2024 |
| 1.1.458 | 212 | 12/20/2023 |
| 1.1.436 | 206 | 11/10/2023 |
| 1.1.416 | 171 | 11/8/2023 |
| 1.1.403 | 183 | 10/6/2023 |
| 1.1.396 | 183 | 9/27/2023 |
| 1.1.384 | 198 | 9/6/2023 |
| 1.1.378 | 213 | 8/16/2023 |
| 1.1.369 | 214 | 8/2/2023 |
| 1.1.363 | 212 | 7/28/2023 |
| 1.1.357 | 239 | 7/19/2023 |
| 1.1.354 | 229 | 7/14/2023 |
| 1.1.345 | 222 | 6/21/2023 |
| 1.1.341 | 218 | 6/14/2023 |
| 1.1.337 | 225 | 6/7/2023 |
| 1.1.335 | 223 | 6/2/2023 |
| 1.1.329 | 232 | 5/26/2023 |
| 1.1.313 | 239 | 5/12/2023 |
| 1.1.302 | 228 | 5/10/2023 |
| 1.1.297 | 234 | 5/3/2023 |
| 1.1.273 | 289 | 3/17/2023 |
| 1.1.267 | 334 | 3/10/2023 |
| 1.1.263 | 313 | 3/8/2023 |
| 1.1.259 | 345 | 2/27/2023 |
| 1.1.256 | 341 | 2/24/2023 |
| 1.1.253 | 329 | 2/22/2023 |
| 1.1.222 | 402 | 1/9/2023 |
| 1.1.212 | 381 | 1/5/2023 |
| 1.1.208 | 382 | 1/3/2023 |
| 1.1.203 | 398 | 12/28/2022 |
| 1.1.159 | 461 | 11/14/2022 |
| 1.1.158 | 450 | 11/13/2022 |
| 1.1.153 | 465 | 11/5/2022 |
| 1.1.141 | 481 | 10/25/2022 |
| 1.1.128 | 467 | 10/22/2022 |
| 1.1.117 | 508 | 10/10/2022 |
| 1.1.114 | 503 | 10/8/2022 |
| 1.1.89 | 528 | 9/16/2022 |
| 1.1.87 | 576 | 9/15/2022 |
| 1.1.63 | 491 | 9/3/2022 |
| 1.1.47 | 528 | 8/15/2022 |
| 1.1.40 | 527 | 8/6/2022 |
| 1.1.38 | 517 | 8/5/2022 |
| 1.1.35 | 511 | 8/4/2022 |
| 1.1.28 | 504 | 8/1/2022 |
| 1.1.13 | 521 | 7/24/2022 |
| 1.1.10 | 511 | 7/23/2022 |
| 1.0.29.3202 | 532 | 7/7/2022 |
| 1.0.20.52556 | 511 | 6/30/2022 |
| 1.0.8.35854 | 537 | 6/26/2022 |
| 1.0.3.8772 | 511 | 6/24/2022 |
| 1.0.1.57221 | 525 | 6/23/2022 |
| 0.0.0 | 538 | 6/16/2022 |