A python 3 script designed to work with the RaspberryPi, Enviro + Air Quality Hat, and Particulate Matter Sensor
- I used a Raspberry Pi Zero W. If you'd prefer not to solder the header use the Raspberry Pi Zero WH. Any Pi with a 40-pin male GPIO header should work fine.
- A microSD card with Raspberry Pi OS.
- Enviro + Air Quality for Raspberry Pi
- PMS5003 Particulate Matter Sensor
I'm using Python 3.7.3. After setting up the hardware I installed the Python packages supplied by Pimoroni. They supply a one-line installer but I didn't use it. I did the following:
git clone https://github.com/pimoroni/enviroplus-python
cd enviroplus-python
sudo ./install.sh
I also had to install some packages manually. I don't remember exactly which were installed manually but here's a summary of what I used:
ST7735(for writing on the LCD screen)psutil(for accessing memory and CPU load)gpiozero(for accessing CPU temperature)smbus2andbme280(for reading the humidity and pressure sensors)enviroplus(for reading the gas sensor)pms5003(for reading the air quality sensors)
Once everything is set up just run the script:
python3 runEnviroPi.py
I used the following cron job to schedule the script to run when the Pi boots:
@reboot Python3 /home/pi/EnviroPi/runEnviroPi.py
- An outdoor air quality station with Enviro+ and Luftdaten: A guide written by Sandy Macdonald (hosted on Pimoroni) discussing how to set up and use the hardware.
- enviroplus-python: The github repository contains many helpful examples.