กลับไปหน้ารวมไฟล์
iot-based-simple-air-pollution-monitoring-system-9c0513-en.md

Environmental Vigilance: DIY Air Quality Monitoring

Air pollution is often invisible but has a profound impact on long-term respiratory health. This project empowers makers to build a cost-effective, high-sensitivity IoT Air Pollution Monitoring System using the MQ135 Gas Sensor and an Arduino Uno. It provides both visual (LED) and acoustic (Buzzer) alerts when harmful gas concentrations reach unsafe levels.

The MQ135 Sensor: Chemical Sensitivity

The MQ135 is a specialized tin dioxide (SnO2) semiconductor sensor designed for atmospheric monitoring:

  • Multi-Gas Detection: It is highly sensitive to Ammonia (NH3), Nitrogen Oxides (NOx), Alcohol, Benzene, Smoke, and Carbon Dioxide (CO2), making it the "Nose of the Internet."
  • Internal Heating: To function correctly, the sensor contains an internal heating element that must "pre-heat" for 24-48 hours upon first use (and ~2 minutes every subsequent startup) to reach chemical equilibrium.
  • Logarithmic Response: The sensor's resistance decreases as gas concentration increases. The Arduino code interprets this analog voltage shift, mapping it to a 0-1023 scale that triggers different alert stages.

Multi-Stage Feedback Logic

The system is designed to provide immediate, intuitive feedback to the user:

  • Safe State (Green LED): Indicates that atmospheric contaminants are below the set threshold, signifying healthy air quality.
  • Alert State (Red LED + Buzzer): Triggered when the sensor detects a spike in CO2 or smoke (simulated in tutorials using an incense stick). The buzzer provides an urgent acoustic warning, alerting occupants who may not be looking at the device.
  • Calibration and Thresholding: Through the Arduino Serial Monitor, users can calibrate the "Baseline" (clean air) value, ensuring the system adapts to the specific indoor environment it is placed in.

Scaling to the Internet of Things (IoT)

While this prototype focuses on local alerts, the use of an Arduino Uno provides a gateway to broader connectivity. By adding an ESP8266 or GSM module, this data can be pushed to cloud platforms like ThingsPeak or Blynk, allowing for city-wide mesh networks of air quality status—helping communities track pollution trends in real-time.

This page is about how to make an air pollution monitoring system using an Arduino UNO, buzzer, LEDs and MQ135 gas sensor.

Working principle:

When we keep some fuels which have harmful gases like CO2, NO2 etc(when we keep an inscence stick close to this sensor), the RED LED will glow and the buzzer starts ringing else if it is good quality air around, then green LED will glow.

Code is as given below:

code for this project

Connection diagram is as given below:

Connection diagram

The video tutorial is here:

ข้อมูล Frontmatter ดั้งเดิม

title: "IoT Based Simple Air Pollution Monitoring System"
description: "We are using some simple cost effective materials to make an IoT based air pollution monitoring system."
author: "vishnutheerth_e_p"
category: ""
tags:
  - "environmental sensing"
  - "internet of things"
  - "monitoring"
views: 15047
likes: 2
price: 870
difficulty: "Easy"
components:
  - "2x Resistor 221 ohm"
  - "1x Buzzer"
  - "1x Grove - Gas Sensor(MQ2)"
  - "1x Soldering iron (generic)"
  - "1x Breadboard (generic)"
  - "1x 5 mm LED: Green"
  - "1x 5 mm LED: Red"
  - "1x Arduino UNO"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles: []
documentationLinks: []
passwordHash: "faf79bb1cb8a36192643a86214a83346140186eebed6afdd9db4e225e9f181e9"
encryptedPayload: "U2FsdGVkX1+ONASnuu89D2kd4DHwHFUVYCNf6H47anWs1hApv4YDRyUJ7OZ5xJ7AsAqCE36rH2lMZKg01oe0f4dpmT4TA29qZmQh0IUqNME="
seoDescription: "Build a cost-effective IoT Based Air Pollution Monitoring System to track air quality using Sensors and Arduino."
videoLinks:
  - "https://www.youtube.com/embed/iLqW26EwdTg"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/iot-based-simple-air-pollution-monitoring-system-9c0513_cover.jpg"
lang: "en"