Skip to content

craftzdog/anavi-phat-sensors-ui

Repository files navigation

Web Interface for ANAVI pHAT & MH-Z19 Sensors

A web interface that displays air quality data captured with ANAVI pHAT sensors and MH-Z19.

Supported sensors:

  • BH1750
  • BMP180
  • HTU21D
  • MH_Z19

Prerequisites

Read the instructions of ANAVI pHAT and MH-Z19 Python module.

Install dependencies:

apt install build-essential wiringpi
sudo apt install python-pip
sudo pip install mh-z19

Put your service-account-key.json for the Firebase in the project root directory. See the documentation for more detail.

How to build

HTU21D:

cd ./sensors/HTU21D
make

BMP180:

cd ./sensors/BMP180
make

BH1750:

cd ./sensors/BH1750
make

How to set up

Configure root's crontab like so:

*/5 * * * * /usr/bin/python -m mh_z19                > /<path-to-project>/data/MH_Z19.json
*/5 * * * * /<path-to-project>/sensors/HTU21D/HTU21D > /<path-to-project>/data/HTU21D.json
*/5 * * * * /<path-to-project>/sensors/BMP180/BMP180 > /<path-to-project>/data/BMP180.json
*/5 * * * * /<path-to-project>/sensors/BH1750/BH1750 > /<path-to-project>/data/BH1750.json

License

C programs for retrieving pHAT sensor data are provided under MIT License by Anavi Technology.

The rest of the scripts are under MIT License by Takuya Matsuyama.

The sound effect is provided by freeSFX.