March 5, 2018

Home AQI monitor

PMS7003 + Raspberry PI + InfluxDB + Chronograf

InfluxDB as a time series data store, Chronograf as a data visualization.

PMS7003 reader and influxdb client code:



curl -sL | sudo apt-key add -
source /etc/os-release
test $VERSION_ID = "7" && echo "deb wheezy stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
test $VERSION_ID = "8" && echo "deb jessie stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
test $VERSION_ID = "9" && echo "deb stretch stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt update
sudo apt install influxdb
sudo systemctl start influxdb


sudo apt install chronograf

Create database

create database homeaqi

influxdb client code

git clone
cd raspberry_aqi
virtualenv .env
source .env/bin/activate
pip install -r requirements.txt


* * * * * /opt/raspberry_aqi/.env/bin/python /opt/raspberry_aqi/src/raspberry_aqi/ /home/pi/raspberry_aqi.conf

config chronograf

  • add a connection with influxdb
  • add a dashboard
  • add some cells on dashboard
  • add graph on cell

Powered by Hugo & Kiss.