Skip to main content

PMS5003 Particulate Sensor

Project description

PMS5003 Particulate Sensor

Build Status Coverage Status PyPi Package Python Versions


Note The code in this repository supports both the Enviro+ and Enviro Mini boards. The Enviro Mini board does not have the Gas sensor or the breakout for the PM sensor.

Enviro Plus pHAT Enviro Mini pHAT

:warning: This library now supports Python 3 only, Python 2 is EOL -

Install and configure dependencies from GitHub:

  • git clone
  • cd pms5003-python
  • ./

Note Libraries will be installed in the "pimoroni" virtual environment, you will need to activate it to run examples:

source ~/.virtualenvs/pimoroni/bin/activate

Note Raspbian/Raspberry Pi OS Lite users may first need to install git: sudo apt install git

Or... Install from PyPi and configure manually:

  • python3 -m venv --system-site-packages $HOME/.virtualenvs/pimoroni
  • Run python3 -m pip install pms5003

Note this will not perform any of the required configuration changes on your Pi, you may additionally need to:


  • Enable serial: raspi-config nonint do_serial_hw 0
  • Disable serial terminal: raspi-config nonint do_serial_cons 1
  • Add dtoverlay=pi3-miniuart-bt to your /boot/config.txt


  • Enable serial: raspi-config nonint set_config_var enable_uart 1 /boot/config.txt
  • Disable serial terminal: sudo raspi-config nonint do_serial 1
  • Add dtoverlay=pi3-miniuart-bt to your /boot/config.txt

In both cases the last line will switch Bluetooth over to miniUART, see for more details.


  • Remove platform detection and default to Pi-compatible pins
  • Support passing in LineRequest and offset for custom pins (supported in gpiodevice>=0.0.4)


  • Repackage to hatch/pyproject.toml
  • Port to gpiod/gpiodevice (away from RPi.GPIO)


  • BugFix: Read start-of-frame a byte at a time to avoid misalignment issues, potential fix for #2, #3 and #4
  • Enhancement: Clarified error message when length packet cannot be read
  • Enhancement: Clarified error message when start of frame cannot be read
  • Enhancement: Added new error message where raw data length is less than expected (frame length)


  • Packaging improvements/bugfix from boilerplate


  • Added pyserial dependency


  • Added reset function


  • Initial Release

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

pms5003-1.0.1.tar.gz (12.5 kB view hashes)

Uploaded Source

Built Distribution

pms5003-1.0.1-py3-none-any.whl (7.9 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