This device continuously monitors atmospheric particulate matter. It sends sensor data to a registered ThingSpeak channel and displays realtime Air Quality Index calculations. It was designed to be cheap and efficient.
- ESP8266 Arduino-compatible microcontroller. I‘m using a WeMos D1 mini, pins will need to be transposed for other controllers
- Plantower PMS5003 laser particle concentration sensor
- TM1637 seven segment LED display module
- A momentary switch for resetting the wifi configuration
- A minimally hacked version (included in this repo) of tzapu’s WiFiManager
- Arduino_JSON
- fu-hsi‘s library for Plantower PMS x003 family sensors
- bremme‘s library for controlling TM1637 display modules
- mathwork‘s ThingSpeak library – note: latest version is buggy, use release v1.4.3
- madleech‘s Button library
ArduinoAQI uses ThingSpeak for both uploading sensor data and for reading configuration. You will need a ThingSpeak account and least two channels: a registration channel to store configuration and a data channel to write sensor data to. The registration channel should have three fields:
- Device MAC Address
- Data Channel ID
- Data Channel Write API Key
The data channel should have four fields:
- PM 1.0 (µg/m³)
- PM 2.5 (µg/m³)
- PM 10.0 (µg/m³)
- AQI
You will need to upload or import data into the registration channel, with one data point per device containing the desired data channel ID and corresponding Write API Key.
Copy config.h
to private/config.h
and fill in at least THINGSPEAK_REGISTRY_CHANNEL_NUMBER
and THINGSPEAK_REGISTRY_API_KEY
with the ID of the ThingSpeak registration channel ID and corresponding Read API Key.
You can use the shell command addSensor.sh
to partially automate the creation and registration processes above.
To setup wifi connectivity, the device will create an ArduinoAQI Setup access point when first run. Connect to this network with a phone or computer to set your wifi credentials.
The device powers up in spinup mode for an initial ten seconds. Set wifi mode to off by clicking the reset button during spinup. In wifi mode, the reset button will clear your network credentials and relaunch the configuration access point.
View detailed setup instructions for a new device.
Also tested with a WeMos D1 R2 development board. Note: Pin labels on the D1 R2 fritzing component are wonky.
See ChartAQI to view your sensor data and any optional PurpleAir sensors.