Skip to main content

Data acquisition and logging tool for PM sensors with UART interface

Project description

Serial Air Quality Sensors

Tools for reading Air Quality Sensors with serial (UART) interface, data acquisition and logging.

Build Status GitHub issues GitHub license Checked with mypy Code style: black DOI

Command Line Interface

Usage: pms [OPTIONS] COMMAND [ARGS]...

  Read serial sensor

Options:
  --sensor-model -m [PMSx003|PMS3003|PMS5003S|PMS5003ST|PMS5003T|SDS01x|SDS198|HPMA115S0|HPMA115C0|SPS30|MCU680]
                                  sensor model  [default: PMSx003]
  -s, --serial-port TEXT          serial port  [default: /dev/ttyUSB0]
  -i, --interval INTEGER          seconds to wait between updates  [default:
                                  60]
  -n, --samples INTEGER           stop after N samples
  --debug                         print DEBUG/logging messages  [default:
                                  False]

  --install-completion [bash|zsh|fish|powershell|pwsh]
                                  Install completion for the specified shell.
  --show-completion [bash|zsh|fish|powershell|pwsh]
                                  Show completion for the specified shell, to
                                  copy it or customize the installation.

  --help                          Show this message and exit.

Commands:
  bridge    Bridge between MQTT and InfluxDB servers
  csv       Read sensor and print measurements
  influxdb  Read sensor and push PM measurements to an InfluxDB server
  mqtt      Read sensor and push PM measurements to a MQTT server
  serial    Read sensor and print measurements

For details on a particular command and their options

pms COMMAND --help

Installation

# basic installation with pip
python3 -m pip install pypms

# or with pipx
pipx install pypms

Will allow you yo access to sensors via serial port (pms serial), and save observations to a csv file (pms csv).

Additional packages are required for pushing observations to an mqtt server (pms mqtt), to an influxdb server (pms influxdb), or provide a bridge between mqtt and influxdb servers (pms bridge).

# full installation with pip
python3 -m pip install pypms[mqtt,influxdb]

# or with pipx
pipx install pypms[mqtt,influxdb]

Particulate Matter Sensors

Sensor --sensor-model PM1 PM2.5 PM4 PM10 size bins Other Tested Works Doesn't Work Not Tested Datasheet Notes
Plantower
PMS1003 (aka G1) PMSx003 X X X 6 X en, cn
PMS3003 (aka G3) PMS3003 X X X X en, cn No passive mode read
PMS5003 (aka G5) PMSx003 X X X 6 X en, cn
PMS5003S PMS5003S X X X 6 HCHO concentration X
PMS5003ST PMS5003ST X X X 6 HCHO, temp. & rel.hum. X
PMS5003T PMS5003T X X X 4 temp. & rel.hum. X
PMS7003 (aka G7) PMSx003 X X X 6 X cn
PMSA003 (aka G10) PMSx003 X X X 6 X cn
NovaFitness
SDS011 SDS01x X X X en
SDS018 SDS01x X X X en
SDS021 SDS01x X X X en
SDS198 SDS198 PM100 X en
Honeywell
HPMA115S0 HPMA115S0 X X X en
HPMA115C0 HPMA115C0 X X X X X en
Senserion
SPS30 SPS30 X X X X 5 typical particle size X en UART 115200 8N1

Other Sensors

Want More Sensors

For more Air Quality sensors open an issue.

Changelog

  • 0.3.*
    • option for a fix number of samples
    • PMSx003 consistency check after sleep/wake
  • 0.2.*
    • widen project scope from PM sensors to AQ sensors in general
    • support BME680 sensor (MCU680 module)
  • 0.1.*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypms-0.3.0.tar.gz (21.8 kB view hashes)

Uploaded Source

Built Distribution

pypms-0.3.0-py3-none-any.whl (31.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page