An Arduino-based device designed to display real-time air pollution using the pulse.eco Rest API levels using LEDs and a 4-digit 7-segment display. The device aims to raise awareness about air quality at bus stops throughout the city and promote the Pulse Eco brand.
- Introduction
- Features
- Hardware Requirements
- Software Requirements
- 3D Models
- Setup and Installation
- Usage
- Code Explanation
- Troubleshooting
- Contributing
- Acknowledgments
This project involves creating a compact, Arduino-based device that displays air pollution data received from an ESP8266 module. The device uses an RGB LED to indicate pollution levels through color changes and a 4-digit 7-segment display to show numerical values. It's designed to be placed inside a black box installed at bus stops to inform the public about the current air quality and promote environmental awareness.
- Real-time Air Pollution Display: Shows pollution levels on a 4-digit 7-segment display.
- Visual Alerts: Uses an RGB LED to indicate pollution severity with different colors.
- Flipped Display Correction: Adjusts the display output to compensate for a 180-degree physical flip.
- Data Reception: Receives pollution data via serial communication from an ESP8266 module.
- Scalable Deployment: Simple setup allows for installation at multiple bus stops citywide.
- 3D-printed Box: Enviromentaly friendly materials used to make the box which stores the arduinos and all of its components.
- Arduino Uno or compatible microcontroller
- RGB LED (Common Cathode preferred)
- Red Pin connected to Pin 9
- Green Pin connected to Pin 11
- Blue Pin connected to Pin 10
- 4-Digit 7-Segment Display (Model: 3642BS with TM1637 driver)
- CLK (Clock) connected to Pin 13
- DIO (Data I/O) connected to Pin 12
- VCC connected to 5V
- GND connected to Ground
- ESP8266 Module (or similar) for data communication
- Connecting Wires
- Breadboard or PCB for assembling the circuit
- Power Supply (USB cable or external 5V power source)
- Arduino IDE (version 1.8.x or newer)
- TM1637Display Library for controlling the 7-segment display
- Install via Arduino IDE:
- Go to Sketch -> Include Library -> Manage Libraries...
- Search for TM1637Display and install the latest version.
- Install via Arduino IDE:
- Similar Installation for the Esp8266 library
The repository includes Fusion 360 files and 3D models for the enclosure. These files can be used to 3D print or modify the design of the box housing the components.
- Directory:
3D-Models/ - Files included:
- Fusion 360 project file (
.f3d) - STL files for 3D printing
- Fusion 360 project file (
To view or edit the 3D models, open the Fusion 360 files with Autodesk Fusion 360 or import the STEP files into your preferred 3D modeling software.
- Open the Arduino IDE.
- Navigate to Sketch -> Include Library -> Manage Libraries....
- Search for TM1637Display and install it.
- Go to Settings ->Additional Boards Manager URLs -> Paste this: http://arduino.esp8266.com/stable/package_esp8266com_index.json;
- Search the esp8266 Library and install it.
- Red Anode to Pin 9 (with a current-limiting resistor, e.g., 220Ω).
- Green Anode to Pin 11 (with resistor).
- Blue Anode to Pin 10 (with resistor).
- Common Cathode to Ground.
- CLK to Pin 13.
- DIO to Pin 12.
- VCC to 5V.
- GND to Ground.
- Ensure proper voltage levels; use a logic level converter if necessary.
- Make sure that when you are proggraming it to be in programmer mode and when you are sending data flip the RX and TX pins ( RX->TX, TX->RX)
- Open
esp_fetching.inoin the Arduino IDE. - Select the correct board and port under Tools -> Board and Tools -> Port. (in this case the Generic Esp8266 module).
- Ensure you are in programmer mode for the Esp8266 module.
- Click the Upload button to program the Arduino.
- Open
Arduino_uno_Led_lights_and_clock.inoin the Arduino IDE. - Select the correct board and port under Tools -> Board and Tools -> Port. (in this case the Arduino Uno).
- Ensure that the ESP8266 module is NOT in Programmer Mode, and the pins are RX->RX and TX->TX.
- Click the Upload button to program the Arduino.
- Connect the Arduino to a power source via USB cable or external power supply.
- The device waits for air pollution data sent over serial communication.
- Ensure the ESP8266 module is programmed to send integer values followed by a newline character (
\n).
- 7-Segment Display: Shows the numerical air pollution value.
- RGB LED Indicators:
- Green: Safe levels (value ≤ 50).
- Yellow: Moderate levels (50 < value ≤ 90).
- Red: High levels (value > 90).
- The device updates the display each time it receives new data.
- After updating, it enters a delay of 10 minutes (
600,000 milliseconds) before checking for new data.
-
Arduino_uno_code.ino: The Arduino code responsible for:
- Receiving data via serial communication.
- Controlling the RGB LED based on pollution levels.
- Displaying values on the 4-digit 7-segment display.
- Adjusting the display output for a physically flipped module
-
esp8226_module.ino: The ESP8266 code responsible for:
- Establishing a Wi-Fi connection to the specified network.
- Authenticating and fetching data from the Pulse Eco API using HTTPS.
- Parsing and filtering PM10 sensor data from the API response.
- Identifying the target sensor by its unique ID and extracting its value.
- the PM10 data over serial communication for further processing.
-
Display Not Showing Values:
- Ensure the wiring matches the pin assignments in the code.
- Verify that the
TM1637Displaylibrary is installed and up-to-date.
-
RGB LED Not Lighting Up:
- Confirm the polarity of the RGB LED (common cathode vs. common anode).
- Check that appropriate resistors (e.g., 220Ω) are used for each pin.
-
No Data Reception:
- Ensure the ESP8266 module is connected properly and configured to send integer values over serial.
- Verify the baud rate settings in both the Arduino code and ESP8266 configuration.
- Verify the pins are RX->TX and TX->RX when trying to send data via Serial.
Special thanks to Jakov Spriovski and Bojan Eftimoski, co-creators of this repository, for their invaluable contributions and support in building this project.

