এয়ার কোয়ালিটি মনিটর (MQ-135): LCD তে বাতাসের মানAir quality monitor (MQ-135): fresh or polluted on an LCD
সার্কিট ডায়াগ্রাম · Circuit diagram
যা যা লাগবে · Parts you need
- 1 × Arduino Uno Arduino Uno
- 1 × Air quality sensor (MQ-135) বাতাসের মান সেন্সর (MQ-135)
- 1 × LCD 16x2 with I2C LCD ১৬x২ (I2C)
- 2 × Resistor 220Ω Resistor
- 1 × LED (green) LED বাতি
- 1 × LED (red) LED বাতি
- 1 × Buzzer Buzzer (বাঁশি)
- 15 × Jumper wires জাম্পার তার
সব 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
- সোলার ট্র্যাকার: প্যানেল রোদের দিকে ঘোরেSolar tracker: the panel follows the sun
- দুমুখো ভিজিটর কাউন্টার (LCD তে ঢোকা-বের হওয়া)Bidirectional visitor counter (in/out on LCD)
- ক্ল্যাপ সুইচ: হাততালি দিলেই বাতি অন-অফClap switch: one clap toggles the lamp
- MOSFET দিয়ে DC মোটরের গতি নিয়ন্ত্রণ (PWM)DC motor speed control with a MOSFET (PWM)