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.
Command Line Interface
Usage: pms [OPTIONS] COMMAND [ARGS]...
Options:
-m, --sensor-model [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]
--version
--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
- MCU680: chinese module with a BME680 sensor, STM32F051K8 mirocontroller (μC) and 3.3V low-dropout regulator (LDO). The μC acts as I2C/UART bridge, providing outputs from the closed source integration library.
Want More Sensors
For more Air Quality sensors open an issue.
Changelog
- 0.4.0
- capture raw messages with
pms csv --capture
- decode captured messages with
pms serial --capture
- hexdump format with
pms serial --format hexdump
- deprecate subset observation method
- capture raw messages with
- 0.3.1
- fix influxdb default tags
- 0.3.0
- option for a fix number of samples
- PMSx003 consistency check after sleep/wake
- 0.2.*
- 0.1.*
- widen project scope beyond Plantower PM sensors
- support NovaFitness, Honeywell and Senserion PM sensors
- cli for logging to csv file, InfluxDB server or MQTT server
Project details
Release history Release notifications | RSS feed
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.4.0.tar.gz
(23.0 kB
view hashes)
Built Distribution
pypms-0.4.0-py3-none-any.whl
(33.0 kB
view hashes)