Header Ads Widget

Responsive Advertisement

MQ-135-Air-Quality-Monitoring-System-using-Arduino-and-OLED-Display-main

MQ-135 Air Quality Monitoring System

Arduino UNO, MQ-135 Gas Sensor & SSD1306 I2C OLED Display

👁️ Operational Overview System Logic

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.

Sampling Refresher Delay
⏱️ Updates continuously every 1.0 second
HCI Threshold Mapping
📊 Categorized statuses: GOOD, MODERATE, or BAD AIR
📺 Project Demonstration & Guide Video Hub

Watch the full demonstration, component wiring overview, and system calibration running live below:

🛠️ Structural BOM Requirements Hardware List

Procure the following components to execute the core prototyping phase layout configurations:

Target Component Label Structural Allocation Quantity Functional Deployment Purpose
Arduino UNO1 UnitCentral processing execution core and telemetry clock loop.
MQ-135 Gas Sensor1 UnitDetects harmful ambient gases and produces corresponding analog metrics.
OLED Display (SSD1306)1 UnitHigh-readability graphical matrix screen for real-time status readouts.
Breadboard & Jumper Wires1 SetSolderless hardware interface routing connection matrix.
🔌 Device Interface Pin Maps I/O Infrastructure

Wire the physical subsystem communication buses in accordance with the following structured reference maps:

MQ-135 Air Quality Sensor Wiring Matrix:
Sensor Transducer Node PinArduino 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
SSD1306 Graphic OLED Board Map (I2C):
OLED Screen Board NodeArduino 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
💻 Optimized Production Code Engine Firmware Source

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);
}
Dependency Check: Ensure that you have the Adafruit SSD1306 and Adafruit GFX libraries correctly loaded via your Arduino Library Manager before pushing the compile cycle.

Post a Comment

0 Comments