How to make smoke detector alarm | Fire detector alarm

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 มี.ค. 2020
  • How to make smoke detector alarm | Fire detector alarm
    Scroll down for code.....
    We have seen fire alarm system or smoke detector alarm system in building or office. It is one of the best safety feature equipment for homes, offices or industries. It can cost around 8$ to 50$. but you can make your own Smoke Detector Alarm System using Arduino. It is suitable for detecting of NH3 (ammonia), Nox, Sulfide, alcohol, Benzene, smoke, CO2,etc. If you want to do more advance project like measure accurately particular gases etc. you need to calibrate it first. In this project we are detecting smoke and also calculating smoke percentage, which will be seen on LCD display.
    LiquidCrystal_I2C library Github link
    github.com/fdebrabander/Ardui...
    I2C scanner arduino website
    playground.arduino.cc/Main/I2...
    If you want to support my video please buy any product through my amazon affiliate link. I will receive a commission, at no extra cost to you.
    LIST OF COMPONENT (affiliate links)
    amzn.to/2fvSRJq (Arduino)
    amzn.to/2zg8aeX (I2C)
    amzn.to/2yBk7eT (LCD display)
    amzn.to/2Uj2AVl (MQ135 Air Quality Sensor)
    amzn.to/2vSpUON (LED)
    amzn.to/2uKfEDf (Piezo buzzer)
    amzn.to/2vmSK8l (Resistor)
    amzn.to/2wxPmWz (Breadboard)
    amzn.to/2vJ3lvo (Jumper wire)
    Song: Elektronomia & JJD - Free [NCS Release]
    Music provided by NoCopyrightSounds.
    Video: • Elektronomia & JJD - F...
    Link: ncs.io/Free
    #include (LiquidCrystal_I2C.h) //instead of parenthesis () put angle bracket as TH-cam description does not allow angle bracket
    // Set the LCD address to 0x27 for a 16 chars and 2 line display
    LiquidCrystal_I2C lcd(0x3F, 16, 2);
    int redLED = 2;
    int greenLED = 3;
    int buzzer = 9;
    int sensor = A0;
    float smokePercentage;
    float remainingGas;
    float tolerance = 20;
    int base_value = 305; // base value
    int state; // state for blinking LED & buzzer without delay function
    unsigned long previousMillis = 0;
    const long interval = 400; // interval at which to LED blink & Buzzer sound (milliseconds)
    void setup() {
    pinMode(redLED, OUTPUT);
    pinMode(greenLED, OUTPUT);
    pinMode(buzzer, OUTPUT);
    pinMode(sensor, INPUT);
    Serial.begin(9600);
    lcd.begin();
    }
    void loop() {
    unsigned long currentMillis = millis();
    float MQ135SensorValues = analogRead(sensor);
    Serial.print("Sensor Values: ");
    Serial.println(MQ135SensorValues);
    lcd.setCursor(0, 0);
    lcd.print("Smoke % :");
    remainingGas = 1023 - base_value + tolerance;
    smokePercentage = (MQ135SensorValues- base_value) /remainingGas ;
    if (smokePercentage ) 0){
    Serial.print("Smoke percentage: ");
    Serial.println(smokePercentage*100);
    lcd.setCursor(9, 0);
    lcd.print(smokePercentage*100);
    lcd.setCursor(14, 0);
    lcd.print("%");
    }
    else {
    lcd.setCursor(10, 0);
    lcd.print("-SAFE-");
    }
    if (MQ135SensorValues ( (base_value + tolerance)) // Checks if MQ135 Sensor Value greater than base + tolerance value
    {
    digitalWrite(greenLED, LOW);
    lcd.setCursor(0, 1);
    lcd.print("Smoke Detected!!");
    Serial.println("Smoke Detected!!");
    if (currentMillis - previousMillis )= interval) {
    // save the last time you blinked the LED
    previousMillis = currentMillis;
    // if the LED & buzzer is off turn it on and vice-versa:
    if (state == LOW) {
    state = HIGH;
    } else {
    state = LOW;
    }
    // Red LED and buzzer go HIGH or LOW
    digitalWrite(redLED, state);
    digitalWrite(buzzer, state);
    }
    }
    else
    {
    digitalWrite(redLED, LOW);
    digitalWrite(greenLED, HIGH);
    digitalWrite(buzzer, LOW);
    lcd.setCursor(0, 1);
    lcd.print("Sensor Value:");
    lcd.setCursor(13, 1);
    lcd.print(MQ135SensorValues);
    }
    delay(500);
    lcd.clear();
    }
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 7

  • @khaledmahrous2623
    @khaledmahrous2623 2 ปีที่แล้ว +1

    I Added A Flame Sensor And Gonna Deliver It Tomorrow
    Really THX DuDe :)

  • @user-ug5yk7yk7o
    @user-ug5yk7yk7o 4 หลายเดือนก่อน

    Sir can you please explain how exactly we have wrtite that program

  • @rehanshaikh3598
    @rehanshaikh3598 4 ปีที่แล้ว +1

    👍👍👍👍👍

  • @kunalrathod2187
    @kunalrathod2187 3 หลายเดือนก่อน

    🎉

  • @artheeshwaranp4797
    @artheeshwaranp4797 ปีที่แล้ว

    Bro intha project panrathuku materials eppadi order pannanum sollunga please

    • @melvineric7913
      @melvineric7913 8 วันที่ผ่านมา

      amazon

    • @santhoshg8456
      @santhoshg8456 7 วันที่ผ่านมา

      ​@@melvineric7913poda myre