npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@serialpilot/driver-plantower

v0.1.0

Published

Plantower PM sensor driver for serialpilot — PMS5003, PMS1003, PMS3003 particulate matter readings.

Readme

@serialpilot/driver-plantower

Plantower PM sensor driver for SerialPilot. Reads particulate matter data from PMS5003, PMS1003, and PMS3003 sensors.

Active mode only — the sensor sends readings automatically every ~1 s; the driver listens, frames, parses, and emits typed events. No write API in v0.1.

Install

npm install serialpilot @serialpilot/driver-plantower

Quick start

import { SerialPilot } from 'serialpilot'
import { Plantower } from '@serialpilot/driver-plantower'

const port = new SerialPilot({ path: '/dev/ttyUSB0', baudRate: 9600 })
const sensor = new Plantower({ transport: port })

sensor.on('reading', r => {
  console.log(`PM2.5: ${r.pm2_5} μg/m³, PM10: ${r.pm10} μg/m³`)
})
sensor.on('reading-compact', r => {
  console.log(`PMS3003 — PM2.5: ${r.pm2_5} μg/m³`)
})
sensor.on('parse-error', e => console.warn('bad frame:', e.reason))

await sensor.open()
await sensor.start()

// later: await sensor.stop(); await sensor.close()

Events

| Event | Payload | Notes | | --- | --- | --- | | 'reading' | Reading | PMS5003 / PMS1003 13-field frame | | 'reading-compact' | CompactReading | PMS3003 7-field frame (no atmospheric, no particle counts) | | 'reading-raw' | RawReading | Every valid frame, regardless of model | | 'parse-error' | ParseError | Bad start bytes, length mismatch, failed checksum | | Inherited | 'open' \| 'close' \| 'state' \| 'error' \| 'data' | From Device |

Limitations (v0.1)

  • Active mode only. No passive-mode read/sleep/wake commands.
  • PMS5003 and PMS1003 are indistinguishable on the wire. Both produce 32-byte frames with the same field layout. RawReading.model defaults to 'PMS5003' for 32-byte frames.
  • No PMS5003ST support. That variant adds an HCHO field; deferred.
  • No inter-frame timing. Frames are detected by start bytes + length, which is reliable for single-sensor active mode.

License

MIT