MQ-135 Air Quality Detector Using Arduino | Cirkit Designer Simulation Project

 

 MQ-135 Air Quality Detector using Arduino Uno in Cirkit Designer

 Introduction

The MQ-135 Air Quality Monitoring System is a smart environmental project that detects harmful gases and monitors indoor air pollution levels in real time. This project is designed and simulated using Cirkit Designer, making it perfect for:

  • Beginners

  • School & college students

  • Science fair projects

  • IoT learners

  • Electronics hobbyists

It helps you understand how gas sensors work and how microcontrollers process environmental data.


 About the MQ-135 Gas Sensor

The MQ-135 sensor detects multiple harmful gases such as:

  • Ammonia (NH₃)

  • Nitrogen Oxides (NOx)

  • Alcohol vapors

  • Benzene

  • Smoke

  • Carbon Dioxide (CO₂)

It provides:

  • Analog Output (AOUT) → Measures gas concentration level

  • Digital Output (DOUT) → Triggers when gas exceeds a threshold (set via onboard potentiometer)


 Components Required

  • Arduino Uno

  • MQ-135 Gas Sensor Module

  • Red LED

  • Green LED

  • 220Ω Resistors

  • Jumper wires


 Circuit Connections

MQ-135 PinArduino Connection
VCC5V
GNDGND
AOUTA0
DOUTPin 2

LEDs:

LEDArduino Pin
Red LEDPin 9
Green LEDPin 10
  • LED anode → Arduino pin via 220Ω resistor

  • LED cathode → GND


 How the Code Works

1️⃣ Analog Reading

int raw = analogRead(PIN_AOUT);

Reads gas concentration value (0–1023).

2️⃣ Voltage Conversion

float volts = raw * (5.0 / 1023.0);

Converts analog reading to voltage.

3️⃣ Digital Threshold Detection

int doLevel = digitalRead(PIN_DOUT);
  • LOW → Gas level above threshold (Danger)

  • HIGH → Safe

4️⃣ Alert System

  • Red LED ON → Dangerous air quality

  • Green LED ON → Safe air quality

5️⃣ Serial Monitor Output

Displays:

  • Raw sensor value

  • Voltage

  • Safety status


 Example Serial Output

AOUT=350 (1.711 V) DOUT=HIGH (SAFE)
AOUT=720 (3.520 V) DOUT=LOW (DANGER)

 Key Features

✔ Real-time air quality monitoring
✔ Analog gas detection
✔ Digital threshold-based alert system
✔ LED safety indicator
✔ Simulation-friendly design
✔ Beginner-friendly Arduino code


 Learning Concepts Covered

  • Analog input using analogRead()

  • Digital input detection

  • Voltage calculation

  • Environmental sensing

  • Embedded system alerts

  • Serial communication debugging


 Applications

  • Indoor air pollution monitoring

  • Smart home automation

  • Industrial safety monitoring

  • IoT environmental systems

  • School science exhibitions

  • Smart classroom air monitoring


 Why Use Cirkit Designer?

  • No physical hardware required

  • Safe simulation of gas sensors

  • Real-time debugging

  • Easy wiring visualization

  • Ideal for beginners


 Important Notes

  • MQ-135 requires preheating time in real hardware for accurate readings.

  • Sensor values are relative — calibration is required for precise ppm measurement.

  • In simulation, readings are simplified for learning purposes.


 Possible Enhancements

You can upgrade this project by adding:

  •  Buzzer for sound alert

  •  16x2 LCD display for air quality value

  •  ESP8266 / IoT cloud monitoring

  •  Air Quality Index (AQI) calculation

  •  Mobile app notifications


 Conclusion

The MQ-135 Air Quality Detector using Arduino Uno is a practical and educational project that teaches:

  • Gas sensing technology

  • Pollution detection systems

  • Analog signal processing

  • Microcontroller programming

This project is ideal for students, beginners, and IoT enthusiasts who want to explore environmental monitoring systems in a simple and interactive way.

Code:
const int PIN_AOUT = A0;
const int PIN_DOUT = 2;
const int LED_RED = 9;
const int LED_GREEN = 10;

void setup() {
  pinMode(PIN_DOUT, INPUT); // DOUT is active-low on LM393 modules
  pinMode(LED_RED, OUTPUT);
  pinMode(LED_GREEN, OUTPUT);
  digitalWrite(LED_RED, LOW);
  digitalWrite(LED_GREEN, LOW);
  Serial.begin(115200);
}

void loop() {
  int raw = analogRead(PIN_AOUT);
  float volts = raw * (5.0f / 1023.0f);

  int doLevel = digitalRead(PIN_DOUT);      // LOW = danger (above threshold), HIGH = safe
  bool danger = (doLevel == LOW);

  digitalWrite(LED_RED, danger ? HIGH : LOW);
  digitalWrite(LED_GREEN, danger ? LOW : HIGH);

  Serial.print("AOUT=");
  Serial.print(raw);
  Serial.print(" (");
  Serial.print(volts, 3);
  Serial.print(" V)  DOUT=");
  Serial.println(doLevel == LOW ? "LOW (DANGER)" : "HIGH (SAFE)");

  delay(100);
}

Using Cirkit Designer simulation, users can:

  • Design the complete circuit online

  • Connect MQ-135 sensor to Arduino virtually

  • Test air quality readings in real time

  • Debug code efficiently

  • Understand gas sensor working principles

 Key Features:

  • Real-time air quality monitoring

  • Analog gas concentration detection

  • Arduino-based alert system

  • Beginner-friendly simulation project

  • Low-cost environmental monitoring solution

This Arduino MQ-135 air quality monitoring project helps students understand gas sensing technology, pollution detection systems, and microcontroller programming in a simple and practical way.

  

IOT & SMART SYSTEM PROJECTS

  1. IoT Weather Monitoring System (NodeMCU ESP8266 + DHT11 + Rain Sensor)
  2. ESP8266 NodeMCU Smart Health & Environment Monitoring System with Pulse, Temperature and Motion Sensors
  3. ESP32 Wi-Fi Weight Sensor with HX711
  4. Smart RFID Access Control System Using ESP32 Dev Board and UHF RFID Reader Module
  5. Smart IoT Motor Control System Using ESP32 Dev Board and L298N Motor Driver Module
  6. Smart Waste Management System Using Arduino Nano, Ultrasonic Sensor & GSM Module – Solar Powered IoT Solution
  7. Raspberry Pi Zero W and GSM SIM900 Based Ultrasonic Distance Measurement System
  8. Arduino UNO Smart Surveillance System with ESP8266 WiFi, PIR Motion Sensor & Camera Module
  9. Arduino UNO Environmental Monitoring System with OLED & 16x2 I2C LCD Display
  10. Arduino UNO-Based Smart Home Automation System with Flame and IR Sensors 
  11. Arduino Nano-Based Landslide Detection System with GSM Alerts – Smart Disaster Monitoring Project
  12. Arduino Nano Rain-Sensing Stepper Motor System
  13. Arduino Based Automatic Tire Inflator Using Pressure Sensor, Relay Module and LCD Display
  14. Arduino-Based Automatic Cooker Using Servo Motors, DC Stirrer Motor, Temperature Sensor and Relay-Controlled Heater
  15. Arduino Sketch for Plastic Bottle and Can Reverse Vending Machine

 TRAFFIC & SMART CITY PROJECTS
  1. RFID-Based Smart Traffic Control System (Arduino Mega)
  2. Arduino UNO Traffic Light Control System – Smart LED Signal Project
  3.  Arduino UNO Controlled Traffic Light System with Joystick Interface

ROBOTICS PROJECTS
  1. Arduino UNO Smart Obstacle Avoiding Robot (Ultrasonic + IR + GSM)
  2. Arduino-Powered Autonomous Obstacle Avoidance Robot with Servo Control
  3. Arduino Nano Bluetooth Controlled Line Follower Robot Using L298N Motor Driver
  4. Arduino UNO Bluetooth Controlled 4WD Robot Car Using L298N Motor Driver
  5. Arduino UNO Multi-Sensor Obstacle Avoidance & Bluetooth Controlled Robot Car Using L298N
  6. Raspberry Pi Motor Control Robot (L298N + Li-ion)
  7. RC Car Simulation with L298N Motor Driver and Joystick Control using Arduino (CirkitDesign Simulation)
  8. Raspberry Pi Robotic Arm Control System with Camera Module and Motor Driver – Smart Automation & Vision-Based Robotics Project
  9. ESP32-Based 4WD Robot Car Using Dual L298N Motor Drivers – Circuit Diagram and IoT Control Project

LORA & WIRELESS COMMUNICATION PROJECTS
  1. Arduino LoRa Communication Project Using Adafruit RFM95W LoRa RadioArduino Nano with RFM95 SX1276 LoRa
  2. Arduino Nano with RFM95 LoRa SX1276 Module – Long Range Wireless Communication Project
  3. Arduino Nano Digital Clock Using DS3231 RTC and TM1637 4-Digit Display – Circuit Diagram and Project Guide

 LED, LIGHTING & DISPLAY PROJECTS
  1. Arduino UNO Controlled NeoPixel Ring Light Show
  2. Wi-Fi Controlled NeoPixel Ring (ESP8266)
  3. Chained NeoPixel Rings with Arduino – Addressable RGB LED Control Project
  4. Arduino Nano-Controlled Lighting System with Gesture and Sound Interaction
  5. Raspberry Pi GPIO Multi-LED Control System – Beginner-Friendly Embedded Electronics Project
  6. 4 Channel Relay Module with Arduino UNO

 SENSOR & DETECTION PROJECTS
  1. Arduino UNO Color Sensor + Proximity System (TCS3200 + Inductive)
  2. Arduino Color Detection Project Using Adafruit TCS34725 RGB Color Sensor
  3. Arduino Gas Leakage Detection and Safety Alert System Using MQ-2 Gas Sensor
  4. MQ-135 Air Quality Detector Using Arduino | Cirkit Designer Simulation Project
  5. Pulse Sensor Using Arduino – Complete Guide with Simulation 
  6. HX711 Load Sensor Demo Using Arduino | Digital Weight Measurement Project
  7. Track Time with DS1307 RTC and Display on Arduino Uno with 16x2 LCD | Cirkit Designer Project
  8. Parking Sensor Simulator using Arduino Uno and HC-SR04 Ultrasonic Sensor

 FUN & INTERACTIVE PROJECTS
  1. Pong Game with Arduino UNO and OLED Display – Project Explanation
  2.   Arduino UNO Bluetooth-Controlled Servo Motor System
  3. Arduino UNO-Based Interactive Touch and Distance Sensing System with LED Indicators and Servo Control

 INDUSTRIAL / AUTOMATION PROJECTS
  1. Arduino UNO Smart Waste Sorting System Using Ultrasonic Sensor, Moisture Sensor, Servo, Stepper Motor and LCD
  2. Arduino-Based Smart Waste Segregation System Using Metal, Plastic and Moisture Sensors with Stepper and Servo Control
  3. ESP32-Based Digital Weighing Scale Using 50kg Load Cell, HX711 Module and 16x2 LCD Display
  4. Arduino-Based Smart Toll Gate Automation System with RFID, GSM, Ultrasonic Sensor and LCD Display

  5. Arduino-Based Automatic Pill Dispenser Machine with LCD Display, Servo Motor and Buzzer Reminder

  6. Arduino UNO Smart Water Quality Monitoring System with pH Sensor, Turbidity Sensor and LCD Display

  7. Arduino-Based Ocean Cleaning Boat Robot with Dual IBT-2 Motor Drivers and Conveyor Belt System

  8. IoT-Based Accident Detection and Health Monitoring System Using Raspberry Pi with GSM, GPS and Camera Integration

  9. Raspberry Pi RFID and Keypad Based Smart Door Lock System with LCD Display and L298N Motor Driver

  10. Smart Shopping Trolley Using Arduino UNO & RFID | Automatic Billing System

  11. Arduino UNO Based Automatic Liquid Hand Sanitizer & Soap Dispenser System

  12. Arduino Based Robotic Weeding Machine with Ultrasonic Obstacle Detection and L298N Motor Driver

  13. Arduino UNO Based Biometric Electronic Voting System with LCD Display and Fingerprint Authentication

  14. Arduino UNO Based Electronic Voting System with ILI9341 TFT Display





Comments