Particulate Matter Sensor
The ParticulateMatter sensor class provides access to a particulate matter sensor.
Constructor
Section titled “Constructor”ParticulateMatter(options)
Section titled “ParticulateMatter(options)”Creates a new ParticulateMatter object instance.
ParticulateMatter(options)Parameters
Section titled “Parameters”options
An object of properties used to construct the class.
sensor- The hardware connection definition.
interval(optional) - The sampling interval in milliseconds.
Instance Methods
Section titled “Instance Methods”sample()
Section titled “sample()”Returns a sample object containing the current particulate matter concentration data.
sample()Return Value
Section titled “Return Value”An object with the following property:
particulateMatter- A number that represents the sampled particulate matter levels in micrograms per cubic meter.
Examples
Section titled “Examples”const sensor = new device.sensor.ParticulateMatter({ sensor: { io: device.io.I2C, address: 0x36 }});
const sample = sensor.sample();console.log(`PM level: ${sample.particulateMatter} ug/m3`);