Skip to content

Collects air quality data from the SDS011 sensor and pushes it to Adafruit IO

License

Notifications You must be signed in to change notification settings

HoukasaurusRex/RaspberryPi-AQIPi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RaspberryPi-AQIPi

Collects air quality data from the SDS011 sensor and pushes it to Adafruit IO

Prerequisites

Getting Started

Connect the SDS011 to the Raspberry Pi with the serial adapter, install the project dependencies, then run main.py. Once the code is running fine, add the script to your crontab.

Setting Env Vars

echo "
AIO_USERNAME='MyAIOUsername'
AIO_KEY='MyAIOActiveKey'
CITY='beijing'
" > /home/pi/RaspberryPi-AQIPi/.env

Installing Globally

pip3 install -r requirements.txt
python3 main.py

Installing Locally

pipenv install -e
pipenv run main.py

Add to Crontab

crontab -e

and add

# set path to python deps and run script on reboot
@reboot PYTHONPATH=/usr/lib/python3/dist-packages python3 /home/pi/RaspberryPiAQIPi/main.py &

# write logs to logs/aqipi.log
* * * * * /home/pi/RaspberryPi-AQIPi/main.py >> /home/pi/logs/aqipi.log 2>&1

Make it Executable

chmod u+x /home/pi/RaspberryPi-AQIPi/main.py

Safe levels

Once you’re monitoring your PM2.5 data, what should you look out for? The World Health Organisation air quality guideline stipulates that PM2.5 not exceed 10 µg/m3 annual mean, or 25 µg/m3 24-hour mean; and that PM10 not exceed 20 µg/m3 annual mean, or 50 µg/m3 24-hour mean. However, even these might not be safe. In 2013, a large survey published in The Lancet “found a 7% increase in mortality with each 5 micrograms per cubic metre increase in particulate matter with a diameter of 2.5 micrometres (PM2.5).”

Where to locate your sensor

Standard advice for locating your sensor is that it should be outside and four metres above ground level. That’s good advice for general environmental monitoring; however, we’re not necessarily interested in general environmental monitoring – we’re interested in knowing what we’re breathing in.

Locating your monitor near your workbench will give you an idea of what you’re actually inhaling – useless for any environmental study, but useful if you spend a lot of time in there. We found, for example, that the glue gun produced huge amounts of PM2.5, and we’ll be far more careful with ventilation when using this tool in the future.

Acknowledgements

About

Collects air quality data from the SDS011 sensor and pushes it to Adafruit IO

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published