A simple LED-based air quality indicator to help you decide when to let in some fresh air or do outside activities.
Air quality data is collected from the World Air Quality Index Project, then displayed using 4 LEDs.
- hardware
- NodeMCU microcontroller + USB cable
- 3× LED (red, yellow, green)
- 3× resistor
- breadboard
- jumper wires
- power supply (optional)
- Visual Studio Code
- PlatformIO for Visual Studio Code
- An AQICN API token
- Install Visual Studio Code and the PlatformIO extension
- Clone this repository
- Open the project folder in Visual Studio Code
- Generate an API token
- Edit your Wi-Fi credentials, geographical location, API token, and refresh rate (in minutes) at
src/settings_example.h
, then rename it tosettings.h
- Connect the microcontroller to your computer via a USB cable
- Upload the program using PlatformIO and verify that it is working correctly
- Assemble the hardware
- Place the NodeMCU on the breadboard
- Place the red LED on the breadboard, install an appropriate resistor between its cathode and the ground rail, then connect its anode to pin
D1
- Repeat step 2 with the yellow LED and pin
D2
- Repeat step 2 with the green LED and pin
D3
- Connect the ground rail to any pin marked
GND
- Verify that the hardware is working correctly by running
pio test -e nodemcuv2
in the PlatformIO CLI