Tekko BDSimSimulatorProjects

এয়ার কোয়ালিটি মনিটর (MQ-135): LCD তে বাতাসের মানAir quality monitor (MQ-135): fresh or polluted on an LCD

▶ ফ্রি চালিয়ে দেখো / Run it free Parts অর্ডার করো (WhatsApp)

সার্কিট ডায়াগ্রাম · Circuit diagram

Air quality monitor (MQ-135): fresh or polluted on an LCD circuit diagram — Arduino Uno, Air quality sensor (MQ-135), LCD 16x2 with I2C, Resistor 220Ω, LED (green), LED (red), Buzzer, Jumper wires

যা যা লাগবে · Parts you need

সব part একসাথে · All parts in one box: iot air quality monitoring kit

তার লাগানো · Wiring

Air quality sensor (MQ-135) VCC→Arduino Uno 5V
Air quality sensor (MQ-135) GND→Arduino Uno GND
Air quality sensor (MQ-135) AO→Arduino Uno A0
LCD 16x2 with I2C VCC→Arduino Uno 5V
LCD 16x2 with I2C GND→Arduino Uno GND
LCD 16x2 with I2C SDA→Arduino Uno A4
LCD 16x2 with I2C SCL→Arduino Uno A5
Arduino Uno D7→Resistor a
Resistor b→LED A
LED K→Arduino Uno GND.3
Arduino Uno D8→Resistor a
Resistor b→LED A
LED K→Arduino Uno GND.3
Arduino Uno D4→Buzzer +
Buzzer -→Arduino Uno GND.3

Code (Arduino C++)

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Air quality monitor: the MQ-135 smells CO2, smoke and ammonia — AO rises as the
// air gets dirtier. Under the limit the green LED says FRESH; above it the red LED
// and the buzzer warn you, the way a CO2 alarm does in a classroom or lab.
// Slide the "Air pollution" control to change what the sensor breathes.
LiquidCrystal_I2C lcd(0x27, 16, 2);
const int LIMIT = 500;

void setup() {
  pinMode(7, OUTPUT); pinMode(8, OUTPUT); pinMode(4, OUTPUT);
  lcd.init();
  lcd.backlight();
  Serial.begin(9600);
  Serial.println("Warming up the MQ-135 (in real life: 1-2 minutes)");
}

void loop() {
  int ppm = analogRead(A0);
  bool dirty = ppm > LIMIT;
  digitalWrite(7, dirty ? LOW : HIGH);
  digitalWrite(8, dirty ? HIGH : LOW);
  digitalWrite(4, dirty ? HIGH : LOW);
  lcd.setCursor(0, 0); lcd.print("Air: "); lcd.print(ppm); lcd.print(" ppm   ");
  lcd.setCursor(0, 1); lcd.print(dirty ? "POLLUTED!      " : "Fresh air      ");
  Serial.print(ppm); Serial.println(dirty ? " POLLUTED" : " fresh");
  delay(400);
}

আরো project · More projects