In my previous posted I showed the DIY AirGradient Sensor board I built from airgradient.com, and this is pretty cool on it’s own and shows the readings on the little OLED screen but I wanted to log this data.
Data Collection and Dashboard
The original video that put me onto the sensor was from Jeff Geerling and he talks in that video about using a docker container and some PHP he’d written to accept the data that the AirGradient Arduino sketch sends and then make it available to Prometheus as a target.
Since then he has updated his repo to provide a version of the Arduino sketch that switches up how the sensor board behaves. His code makes the data available to Prometheus from the AirGradient board without the need for a translation layer in between. Jeff’s code.
This is the response you get when running the code from the repo, it’s in the format that Prometheus can ingest:

I then setup a target in Prometheus to collect that every 30 seconds and built a basic dashboard in Grafana to present the data.
