/particulate-matter-sensor-storage

Store the particulate matter data from a luftdaten.info sensor in BigQuery

Primary LanguagePython

Particulate Matter Sensor – Store Data in BigQuery

Build Status

The project luftdaten.info by Code for Germany enables people to build a particulate matter sensor and measure the air qualitiy. The firmware that runs on the sensor has the option to send the data also to an own API.

The Google Cloud Function stores the sensor data together with a timestamp in BigQuery. The sensor data in BigQuery can be easily analyzed. As an example a reported created with Data Studio accessing that data:

Data Studio report demo

Setup Cloud Function

Local Development

Create a virtual environment

python3 -m venv .venv
source .venv/bin/activate

Install the dependencies

pip install --requirement requirements.txt

Deployment

Deploy the Cloud Function

make deploy

Setup sensor

Configuration

  • Open the configuration page of the senor

  • Enable the option Send data to custom API with the settings

    Optional Value
    Server europe-west1-GCP-PROJECT.cloudfunctions.net
    Path /pm_sensor_storage
    Port 80

Note: The firmware supports HTTPS, but the sensor crashes for larger SSL certificates because of the limited memory. (Source)