Skip to main content

A python driver for plantower pms7003 pm sensor

Project description

A minimalistic python interface for PMS7003 sensor

The code reads PM values from serial port. Tested on Raspberry Pi, but it should work on any machine with Python and serial port.

Device description:


To install the driver, simply do:

pip3 install pms7003

Usage example

from pms7003 import Pms7003Sensor, PmsSensorException

if __name__ == '__main__':

    sensor = Pms7003Sensor('/dev/serial0')

    while True:
        except PmsSensorException:
            print('Connection problem')


The read function has an option of returning values as a dict or OrderedDict.

Usage example with threading:

import time
from pms7003 import Pms7003Thread

if __name__ == "__main__":

    with Pms7003Thread("/dev/serial0") as sensor:

        while True:
            # We're free to do computation in main thread 
            a = 2**32

Project details

Download files

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

Files for pms7003, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size pms7003-1.1.0.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View
Filename, size pms7003-1.1.0-py3-none-any.whl (5.8 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page