هنر
زیبایی و سلامت
صنایع دستی
فرهنگ و تاریخ
سرگرمی
محیط زیست
غذا و نوشیدنی
مهندسی معکوس
علوم
ورزش
فناوری
پوشیدنی‌ها
Building an Air-Quality Monitor
Ed

ایجاد شده توسط

Ed

13. ژوئیه 2026FI
۳۸
۰
۰
۰
۰

Building an Air-Quality Monitor

Build a traffic-light air-quality monitor. An MQ-135 sensor responds to smoke, fumes, alcohol, CO2 and other gases; the Arduino compares the reading to clean air and lights a green, yellow or red LED for good, moderate or poor air. A hands-on way to watch indoor air change — with the honest limit that it shows RELATIVE quality, not a calibrated ppm figure.

متوسط
1-2 hours

دستورالعمل‌ها

1

Wire the sensor and three LEDs

On the breadboard: MQ-135 VCC to Arduino 5V, GND to GND, and its analog output (AOUT) to A0. Wire three LEDs — ideally green, yellow and red — to pins 5, 6 and 7, each through a 330 Ω resistor to GND (long leg to the pin).

مواد مورد نیاز این مرحله:

Arduino Uno R3Arduino Uno R31 قطعه
ماژول حسگر کیفیت هوا MQ-135ماژول حسگر کیفیت هوا MQ-1351 قطعه
ال‌ای‌دی ۵ میلی‌متریال‌ای‌دی ۵ میلی‌متری1 بسته
مقاومت ۳۳۰ اهممقاومت ۳۳۰ اهم1 بسته
بردبوردبردبورد1 قطعه
سیم رابطسیم رابط1 بسته
2

Connect and open the IDE

Plug the Arduino into your computer with the USB cable, open the Arduino IDE, and select Arduino Uno and its serial port.

ابزارهای مورد نیاز:

رایانه با Arduino IDEرایانه با Arduino IDE
کابل USB-Bکابل USB-B
3

Upload the traffic-light sketch

Paste this sketch and upload. It warms the sensor, records a clean-air baseline, then lights green for good air, yellow for moderate and red for poor. Open the Serial Monitor to see the raw reading.

air_quality_monitor.inoarduino
// Traffic-light air-quality monitor using an MQ-135 sensor.
// Shows RELATIVE air quality vs a clean-air baseline - not a calibrated ppm meter.
// MQ-135 analog out on A0; green LED pin 5, yellow pin 6, red pin 7.

const int MQ135_PIN = A0;
const int GREEN_PIN = 5;
const int YELLOW_PIN = 6;
const int RED_PIN = 7;

int cleanAir = 0;             // baseline, set at startup
const int MODERATE = 80;     // rise above baseline -> moderate
const int POOR = 200;        // rise above baseline -> poor

void setup() {
  pinMode(GREEN_PIN, OUTPUT);
  pinMode(YELLOW_PIN, OUTPUT);
  pinMode(RED_PIN, OUTPUT);
  Serial.begin(9600);

  Serial.println("Warming up MQ-135 (2 min) in clean air...");
  delay(120000);
  cleanAir = analogRead(MQ135_PIN);
  Serial.print("Clean-air baseline: ");
  Serial.println(cleanAir);
}

void loop() {
  int reading = analogRead(MQ135_PIN);
  int rise = reading - cleanAir;
  Serial.println(reading);

  digitalWrite(GREEN_PIN, LOW);
  digitalWrite(YELLOW_PIN, LOW);
  digitalWrite(RED_PIN, LOW);

  if (rise >= POOR) {
    digitalWrite(RED_PIN, HIGH);       // poor
  } else if (rise >= MODERATE) {
    digitalWrite(YELLOW_PIN, HIGH);    // moderate
  } else {
    digitalWrite(GREEN_PIN, HIGH);     // good
  }
  delay(500);
}
4

Warm up, baseline and test

Run it in fresh air and let the 2-minute warm-up set the baseline (a new MQ-135 also needs a 24–48 h burn-in to settle). Then test it: breathe on it, spray a little deodorant nearby, or hold a blown-out match's smoke close — it should climb to yellow then red, and return to green in clean air. Tune MODERATE and POOR to change the thresholds.

5

Know the limits

The MQ-135 reacts to many gases at once and gives a RELATIVE reading, not a calibrated CO2 or ppm value — despite what some tutorials claim, real ppm needs proper calibration against known concentrations. It also drifts and needs re-baselining. Treat this as an air-change indicator and a great sensing project, not a laboratory instrument.

مواد

6
  • 1 قطعه
    1 vendor sell this, none ship to you yet
    جایگزین
  • جایگزین
  • 1 بسته
    1 vendor sell this, none ship to you yet
    جایگزین
  • جایگزین
  • 1 قطعه
    1 vendor sell this, none ship to you yet
    جایگزین
  • 1 بسته
    3 vendors sell this, none ship to you yet
    جایگزین

ابزارهای لازم

3
  • جایگزین
  • 1 vendor sell this, none ship to you yet
    جایگزین
  • 1 vendor sell this, none ship to you yet
    جایگزین

نقشه‌های مرتبط

این نقشه‌ها دانش مشترکی دارند — تکنیک‌ها، مواد یا اصول

CC0 مالکیت عمومی

این نقشه تحت مجوز CC0 منتشر شده است. شما آزاد هستید آن را کپی، ویرایش، توزیع و برای هر هدفی بدون نیاز به اجازه استفاده کنید.

با خرید محصولات از طریق نقشه از سازنده حمایت کنید و او کمیسیون سازنده تعیین شده توسط فروشندگان، دریافت می‌کند یا یک نسخه جدید از این نقشه ایجاد کنید و آن را به عنوان اتصال در نقشه خود قرار دهید تا درآمد به اشتراک گذاشته شود.

بحث و گفتگو

(0)

ورود برای شرکت در بحث

در حال بارگذاری نظرات...