MQ-135 Air Quality Monitoring System
Arduino UNO, MQ-135 Gas Sensor & SSD1306 I2C OLED Display
This environmental telemetry station uses an Arduino processing unit to continuously track structural air parameters. By acquiring real-time analog data from an MQ-135 gas sensor block, the firmware monitors pollution levels and harmful gas concentrations. Data points are evaluated against dynamic thresholds and mapped smoothly onto an integrated, high-contrast SSD1306 OLED matrix terminal using default I2C lines.
Watch the full demonstration, component wiring overview, and system calibration running live below:
Procure the following components to execute the core prototyping phase layout configurations:
| Target Component Label | Structural Allocation Quantity | Functional Deployment Purpose |
|---|---|---|
| Arduino UNO | 1 Unit | Central processing execution core and telemetry clock loop. |
| MQ-135 Gas Sensor | 1 Unit | Detects harmful ambient gases and produces corresponding analog metrics. |
| OLED Display (SSD1306) | 1 Unit | High-readability graphical matrix screen for real-time status readouts. |
| Breadboard & Jumper Wires | 1 Set | Solderless hardware interface routing connection matrix. |
Wire the physical subsystem communication buses in accordance with the following structured reference maps:
| Sensor Transducer Node Pin | Arduino Host Mapping Node Pin |
|---|---|
| VCC (Module Power) | 5V Power Output Rail |
| GND (Ground Return Plane) | GND Common Reference Ground |
| A0 (Analog Interface Line) | A0 Analog Input Intercept Node |
| OLED Screen Board Node | Arduino Master Mapping Pin Interface |
|---|---|
| VCC (Module Power) | 5V Core Positive Voltage Rail |
| GND (Module Ground) | GND Common Reference Ground Plane |
| SDA (I2C Serial Data Line) | A4 Hardware I2C Communication Line |
| SCL (I2C Serial Clock Line) | A5 Hardware I2C Communication Line |
Copy and integrate this production-ready code directly into your local desktop Arduino IDE environment:
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
const int mqPin = A0;
void setup() {
Serial.begin(9600);
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println("OLED not found");
while (1);
}
display.clearDisplay();
}
void loop() {
int airValue = analogRead(mqPin);
String status;
if (airValue <= 300) {
status = "GOOD AIR \uD83D\uDE0A";
}
else if (airValue <= 600) {
status = "MODERATE \u26A0\uFE0F";
}
else {
status = "BAD AIR \u2620\uFE0F";
}
// Serial Monitor
Serial.print("Air Value: ");
Serial.print(airValue);
Serial.print(" | Status: ");
Serial.println(status);
// OLED Display
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0, 0);
display.print("Air Quality Monitor");
display.setCursor(0, 20);
display.print("Value: ");
display.print(airValue);
display.setCursor(0, 40);
display.print(status);
display.display();
delay(1000);
}
Adafruit SSD1306 and Adafruit GFX libraries correctly loaded via your Arduino Library Manager before pushing the compile cycle.

0 Comments