AirGradient’s sensor set up is a good base and reasonably affordable. This Arduino sketch allows you to integrate with a locally run InfluxDB instance or MQTT. This also allows you to easy integrate with Home Assistant. This was loosely based off of AirGradient’s original example. A couple additional features are also included.
Note: InfluxDB isn't required, there is a config option that will allow you to disable it.
DeviceConfig
Add ESP8266 platform information.
http://arduino.esp8266.com/stable/package_esp8266com_index.json
to Additional Board Manager URLs Imageesp8266
by ESP8266 community
ImageLOLIN(WEMOS) D1 R2 & mini
ImageAdd the required libraries.
AirGradient Air Quality Sensor
ImageIf only using sensors, with no connectivity skip to step two
ESP8266 and ESP32 OLED driver for SSD1306 displays
by ThingPulse ImageOnly needed if you enable Influxdb
ESP8266 Influxdb
by Tobias Schürg, InfluxData ImageOnly needed if you enable MQTT
home-assistant-integration
by Dawid Chyrzynski Image You will be asked if you would like to install dependencies, select Install all ImageNavigate to DeviceConfig.hpp tab and enable any features you would like to use. Then fill out their corresponding credentials.
Once customization is complete, plug the device (esp8266) into your computer then click upload. Optionally, if you want to monitor what the device is doing, you can open Serial Monitor