https://github.com/randombenj/air-quality-monitoring
Air quality monitoring with an SGP30 and a Raspberry PI
https://github.com/randombenj/air-quality-monitoring
air-quality air-quality-monitor raspberry-pi sgp30
Last synced: 6 months ago
JSON representation
Air quality monitoring with an SGP30 and a Raspberry PI
- Host: GitHub
- URL: https://github.com/randombenj/air-quality-monitoring
- Owner: randombenj
- Created: 2021-01-24T08:57:12.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-06T22:58:44.000Z (over 4 years ago)
- Last Synced: 2025-03-28T07:03:49.599Z (7 months ago)
- Topics: air-quality, air-quality-monitor, raspberry-pi, sgp30
- Language: HTML
- Homepage:
- Size: 41 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Air quality monitoring
> When should I open my window for fresh air?
> Here is the answer!This repository provides a ready to install app for
air quality monitoring with an [SGP30 Air Quality Sensor](https://www.sparkfun.com/products/16531)
and a raspberry pi.## Setup
You will need:
- [SGP30 Air Quality Sensor](https://www.sparkfun.com/products/16531)
- A Raspberry Pi### Flash already built image
If you just want this to work, you can install the latest image
from the [latest build](https://github.com/randombenj/air-quality-monitoring/actions?query=workflow%3A%22OS+image%22)
and [flash it to an sd card](https://raspberrypi.stackexchange.com/a/932).### Install from source
You may want to use [poetry](https://python-poetry.org/) for an easyer installation.
If you already have a Raspberry Pi set up, you can install the package
from source like this:```sh
# get the source
git clone git@github.com:randombenj/air-quality-monitoring.git
cd air-quality-monitoring/qualitair# install dependencies
poetry install# run it!
poetry shell
cd ..
python -m qualitair
```## Desktop notification
If you want to get a desktop notification (on Ubuntu) when to open windows,
you can simply add this cronjob:```
* * * * * CO2=$(curl -s http://RASPI_IP:8080/\?limit=1 | jq '.measurements[0].co2') && test $CO2 -gt 1100 && XDG_RUNTIME_DIR=/run/user/$(id -u) notify-send "Open windows!" "CO2: $CO2"
```Note that you will need to install [jq](https://stedolan.github.io/jq/) for this to work.