This is my first project, feedback welcome!
With all the wildfires in California this year, we keep constantly checking our phones and laptops for the air quality - to catch these 1-2 hours during the day when the air is acceptable and we can finally go out.
Having a display with the current air quality makes it more convenient to stay in the know.Hardware:
1. Connect Photon Particle to the LCD
- Basically, any LCD/screen project that works for you can be used here
- Kudos to "What to Wear LCD" project (https://www.hackster.io/45726/what-to-wear-lcd-c2c520 and http://blog.jongallant.com/2015/10/particle-photon-lcd-setup/) for the wiring hints
- My Potentiometer's pins were too wide so had to bend hen to fit the 3x4 footprint (originally 3x5)
Software (the code is not optimized but seems to work):
1. Connect libraries
- Particle IDE might curse if you don't manually add a library.
- Go to libraries on build.particle.io and add HTTPClient, ArduinoJSON, LiquidCrystal
- Typing the following should add Arduino libraries: #include "application.h"
2. Get sensor data from PurpleAir.com on PM2.5 particle air contamination
- Find the sensor close to you on PurpleAir.com/map and get its number
- Replace YOUR_SENSOR_NUMBER in line 68 with your sensor number
- Line 97 sets the delay in milliseconds between API pings: currently, it is 300, 000 or 5 minutes
- For more detail on PurpleAir API, go to https://docs.google.com/document/d/15ijz94dXJ-YAZLi9iZ_RaBwrZ4KtYeCy08goGBwnbCU/edit
3. Convert PM2.5 data to the AQI index that as displayed on PurpleAir website
- For more detail, go to https://aqs.epa.gov/aqsweb/documents/codetables/aqi_breakpoints.html
4. Display AQI index on the LCD, be in the know!
- Change YOUR_CITY_NAME in line 60 with the name of your city