https://github.com/pimoroni/pms5003-python
Python library for the PMS5003 particulate sensor
https://github.com/pimoroni/pms5003-python
pypi-package
Last synced: 3 months ago
JSON representation
Python library for the PMS5003 particulate sensor
- Host: GitHub
- URL: https://github.com/pimoroni/pms5003-python
- Owner: pimoroni
- License: mit
- Created: 2019-06-04T09:50:42.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-04-24T14:12:47.000Z (over 1 year ago)
- Last Synced: 2025-08-18T00:59:11.768Z (3 months ago)
- Topics: pypi-package
- Language: Shell
- Size: 52.7 KB
- Stars: 54
- Watchers: 7
- Forks: 19
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PMS5003 Particulate Sensor
[](https://github.com/pimoroni/pms5003-python/actions/workflows/test.yml)
[](https://coveralls.io/github/pimoroni/pms5003-python?branch=main)
[](https://pypi.python.org/pypi/pms5003)
[](https://pypi.python.org/pypi/pms5003)
# Installing
**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._


:warning: This library now supports Python 3 only, Python 2 is EOL - https://www.python.org/doc/sunset-python-2/
## Install and configure dependencies from GitHub:
* `git clone https://github.com/pimoroni/pms5003-python`
* `cd pms5003-python`
* `./install.sh`
**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:
### Bookworm
* 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`
### Bullseye
* 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 https://www.raspberrypi.org/documentation/configuration/uart.md for more details.