pmsa003i
v1.0.0
Published
A driver for the PMSA003I particle concentration sensor.
Maintainers
Readme
A NodeJS driver for Plantower PMSA003I Digital Particle Concentration Sensor
This library uses the i2c-bus nodeJS package to communicate with the chip over I2C.
Installation
npm install pmsa003iUsage
const { PMSA003I } = require('pmsa003i');
(async () => {
const sensor = new PMSA003I();
while (true) {
const data = await sensor.read();
console.log(`PM1.0: ${data.pm1_0_env} ug/m3`);
console.log(`PM2.5: ${data.pm2_5_env} ug/m3`);
console.log(`PM10: ${data.pm10_env} ug/m3`);
console.log(`Particles >0.3um: ${data.particles_0_3} per 0.1L`);
await new Promise((r) => setTimeout(r, 1000));
}
})();API Reference
Constructor Options
| Option | Default | Description |
|--------|---------|-------------|
| i2cBusNumber | 1 | I2C bus number |
| address | 0x12 | I2C address of the device |
Read Data Fields
| Field | Unit | Description |
|-------|------|-------------|
| pm1_0_standard | ug/m3 | PM1.0 concentration (CF=1, standard particle) |
| pm2_5_standard | ug/m3 | PM2.5 concentration (CF=1, standard particle) |
| pm10_standard | ug/m3 | PM10 concentration (CF=1, standard particle) |
| pm1_0_env | ug/m3 | PM1.0 concentration (atmospheric environment) |
| pm2_5_env | ug/m3 | PM2.5 concentration (atmospheric environment) |
| pm10_env | ug/m3 | PM10 concentration (atmospheric environment) |
| particles_0_3 | per 0.1L | Particles with diameter beyond 0.3 um |
| particles_0_5 | per 0.1L | Particles with diameter beyond 0.5 um |
| particles_1_0 | per 0.1L | Particles with diameter beyond 1.0 um |
| particles_2_5 | per 0.1L | Particles with diameter beyond 2.5 um |
| particles_5_0 | per 0.1L | Particles with diameter beyond 5.0 um |
| particles_10 | per 0.1L | Particles with diameter beyond 10 um |
| version | - | Sensor firmware version |
| errorCode | - | Sensor error code (0 = no error) |
"Standard" concentrations are corrected to standard atmospheric conditions (CF=1, for factory/calibration use). "Environmental" concentrations are measured under current atmospheric conditions and are typically what you want.
