SensirionSPS30
Description
The SensirionSPS30 object provides an interface for the Sensirion SPS30 particle sensor and allows reading measured masss concentrations, number concentrations and the typical particle size. Additionally operations such as cleaning the fan can configured to be performed automatically or triggered manually.
- › Inherits:
Overview
Properties
Methods
Signals
Enumerations
Properties
autoCleaningInterval
This property holds the interval [ms] of the periodic fan-cleaning. When the module is in measurement mode an automatic fan-cleaning procedure will be triggered periodically following a defined cleaning interval. This will accelerate the fan to maximum speed for 10 seconds in order to blow out the dust accumulated inside the fan. While cleaning measurement values are not updated. Set to 0 to disable. Default interval is 604800000 milliseconds (1 week). If the sensor is switched off, the time counter is reset to 0. Make sure to trigger a cleaning cycle at least every week if the sensor is switched off and on periodically (e.g., once per day).
- › Type:
SignedInteger
- › Default:
604800000- › Signal:
autoCleaningIntervalChanged()
- › Attributes:
Writable
enabled
This property holds whether the sensor is enabled. After power up, the module is in Idle-Mode. Before any measurement values can be read, the sensor needs to be enabled. If enabling was successful the fan starts running.
- › Type:
Boolean
- › Default:
true- › Signal:
enabledChanged()
- › Attributes:
Writable
massPM10
This property holds the mass concentration PM10 in μg/m³.
- › Type:
Float
- › Default:
0- › Signal:
massPM10Changed()
- › Attributes:
Readonly
massPM1_0
This property holds the mass concentration PM1.0 in μg/m³.
- › Type:
Float
- › Default:
0- › Signal:
massPM1_0Changed()
- › Attributes:
Readonly
massPM2_5
This property holds the mass concentration PM2.5 in μg/m³.
- › Type:
Float
- › Default:
0- › Signal:
massPM2_5Changed()
- › Attributes:
Readonly
massPM4_0
This property holds the mass concentration PM4.0 in μg/m³.
- › Type:
Float
- › Default:
0- › Signal:
massPM4_0Changed()
- › Attributes:
Readonly
numberPM0_5
This property holds the number concentration PM0.5 in #/cm³.
- › Type:
Float
- › Default:
0- › Signal:
numberPM0_5Changed()
- › Attributes:
Readonly
numberPM10
This property holds the number concentration PM10 in #/cm³.
- › Type:
Float
- › Default:
0- › Signal:
numberPM10Changed()
- › Attributes:
Readonly
numberPM1_0
This property holds the number concentration PM1.0 in #/cm³.
- › Type:
Float
- › Default:
0- › Signal:
numberPM1_0Changed()
- › Attributes:
Readonly
numberPM2_5
This property holds the number concentration PM2.5 in #/cm³.
- › Type:
Float
- › Default:
0- › Signal:
numberPM2_5Changed()
- › Attributes:
Readonly
numberPM4_0
This property holds the number concentration PM4.0 in #/cm³.
- › Type:
Float
- › Default:
0- › Signal:
numberPM4_0Changed()
- › Attributes:
Readonly
timestamp
This property holds a timestamp in milliseconds corresponding to the time when the latest measurements have been received.
This property was introduced in InCore 2.6.
- › Type:
SignedBigInteger
- › Signal:
timestampChanged()
- › Attributes:
Writable
typicalSize
This property holds the typical particle size in μm.
- › Type:
Float
- › Default:
1- › Signal:
typicalSizeChanged()
- › Attributes:
Readonly
values
This property holds all available values provided for convenience in the following order:
Mass concentration PM1.0: massPM1_0
Mass concentration PM2.5: massPM2_5
Mass concentration PM4.0: massPM4_0
Mass concentration PM10: massPM10
Number concentration PM0.5: numberPM0_5
Number concentration PM1.0: numberPM1_0
Number concentration PM2.5: numberPM2_5
Number concentration PM4.0: numberPM4_0
Number concentration PM10: numberPM10
Typical particle size: typicalSize
- › Type:
List
- › Signal:
valuesChanged()
- › Attributes:
Readonly, Requires Polling
Methods
pollValues()
This method polls the values property. It is called automatically when using a Polling property modifier on this property and usually does not have to be called manually.
startFanCleaning()
This method starts the fan-cleaning manually. For more details, see autoCleaningInterval
Example
import InCore.Foundation 2.5
import InCore.IO 2.5
Application {
SensirionSPS30 {
serialPort: SerialPort { portName: "ttyUSB0" }
autoCleaningInterval: 10 * 60 * 1000
onErrorChanged: console.log( errorString )
Polling on values { interval: 2000 }
onValuesChanged: console.log( values )
}
}