How TO USE MQ2 GAS SENSOR WITH ARDUINO FOR SMOKE DETECTION.

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 พ.ย. 2019
  • In this tutorial we demonstrate how to interface the MQ2 gas sensor with Arduino to make a simple smoke detector.
    Subscribe to my channel: bit.ly/2LiMpF0
    ==========Recommended products from Amazon :=========
    i). Wavesahre MQ-2 Gas Sensor Module LP,Propane,Hydrogen Detection Sensor Gas Detector Sensor Module for Arduino Raspberry pi: amzn.to/34aZwwM
    ii). 9PCS/Lot Gas Detection Sensor Module MQ-2, MQ-3, MQ-4, MQ-5 MQ-6, MQ-7, MQ-8, MQ-9, MQ-135 Sensor Module Gas Sensor Starter Kit: amzn.to/37r6W1d
    For Schematics and code visit the link: mytectutor.com/how-mq2-gas-se...
    DISCLAIMER: This video description contains affiliate links. If you buy any item using these product links, I may receive a small commission. I would appreciate your support in this way!

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

  • @ajaykalsi6007
    @ajaykalsi6007 3 ปีที่แล้ว

    thankyou so muck great video also i have a question for your video using A I2C LCD WITH ULTRASONIC SENSOR can you add like for the library lcd bar graph

  • @sivakumarc3853
    @sivakumarc3853 3 ปีที่แล้ว

    Hiii.....this tutorial was awesome...thank you.....how to do this in proteus ..please help me...also how to give the input to the sensor instead of logic toggle since it is 0 and 1 only

  • @rrshorts7373
    @rrshorts7373 2 ปีที่แล้ว

    Sir can we use same connection and code for mq135 sensor

  • @kennmarkeay6193
    @kennmarkeay6193 2 ปีที่แล้ว

    verry nice

  • @Dancopymus
    @Dancopymus 3 ปีที่แล้ว

    First of all, thanks for the video.
    Is this sensor reliable? I would like to take advantage of your code and add it with another code with DHT22 Temperature and Humidity sensor, for example, while there is no detection of gas and/or smoke, showing Temperature and Humidity on the LCD screen. Do you have something like that or could you give me a hint on how to do it? Thank you

    • @mytectutor
      @mytectutor  3 ปีที่แล้ว

      This sensor is quite good for smoke detection. About your other idea it’s just a matter or adding the libraries for the dht11. However you may need a larger lcd to be able to display all the readings for temperature, humidity and the state of the smoke sensor properly. I have a tutorial on the dht11 where u can make reference

    • @Dancopymus
      @Dancopymus 3 ปีที่แล้ว

      @@mytectutor Thank you, I'll take a look. But, what I need is for gas leak detection.

    • @markofficialvlog3415
      @markofficialvlog3415 3 ปีที่แล้ว

      @@mytectutor Sir can you explain how to adjust the sensetivity of MQ 135 ?

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

    Without i2c.work?

  • @williamchupin4842
    @williamchupin4842 7 หลายเดือนก่อน +1

    here is the code again if you are getting errors
    #include
    #include
    LiquidCrystal_I2C lcd(0x27,16,2);
    #define MQ2pin (0)
    int buzzer = 10;
    int sensorValue; //variable to store sensor value
    void setup()
    {
    pinMode(buzzer, OUTPUT);
    lcd.begin();
    lcd.backlight();
    lcd.setCursor(0,0);
    lcd.print(" GAS SENSOR ");
    delay(1000);
    lcd.setCursor(0,1);
    lcd.print(" WARMING UP ! ");
    delay(100); // allow the MQ-6 to warm up
    }
    void loop()
    {
    lcd.clear();
    sensorValue = analogRead(MQ2pin); // read analog input pin 0
    lcd.setCursor(0,0);
    lcd.print("VALUE: ");
    lcd.print(sensorValue);
    lcd.print("ppm");
    if(sensorValue > 300)
    {
    lcd.setCursor(0,1);
    lcd.print("SMOKE DETECTED");
    tone(buzzer, 500, 2000);
    }
    else
    {
    lcd.setCursor(0,1);
    lcd.print(" NO SMOKE");
    noTone(buzzer);
    }
    delay(2000); // wait 2s for next reading
    }

  • @kixbix3292
    @kixbix3292 2 ปีที่แล้ว

    Can you please provide library l2C Lcd zip file for this?its giving me error

  • @mohamedsameerah1383
    @mohamedsameerah1383 3 ปีที่แล้ว

    I have a doubt y arduino... This work smoke detector does rgt... Bcoz of digital number

  • @zzpotato1238
    @zzpotato1238 2 ปีที่แล้ว

    Anyone know why I can't run the code on Arduino software. It's say I cannot detect the #INCLUDE liquid crystal name

  • @KenanPolat
    @KenanPolat 2 ปีที่แล้ว

    program code?

  • @rauljurado4534
    @rauljurado4534 3 ปีที่แล้ว +1

    Hi,
    I have the error:
    'POSITIVE' was not declared in this scope
    Any idea of how to solve it ?

    • @kixbix3292
      @kixbix3292 2 ปีที่แล้ว

      I m gng to try this project ! Does this run good efficiently ?? Please do reply

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

      same positive

    • @williamchupin4842
      @williamchupin4842 7 หลายเดือนก่อน

      #include
      #include
      LiquidCrystal_I2C lcd(0x27,16,2);
      #define MQ2pin (0)
      int buzzer = 10;
      int sensorValue; //variable to store sensor value
      void setup()
      {
      pinMode(buzzer, OUTPUT);
      lcd.begin();
      lcd.backlight();
      lcd.setCursor(0,0);
      lcd.print(" GAS SENSOR ");
      delay(1000);
      lcd.setCursor(0,1);
      lcd.print(" WARMING UP ! ");
      delay(100); // allow the MQ-6 to warm up
      }
      void loop()
      {
      lcd.clear();
      sensorValue = analogRead(MQ2pin); // read analog input pin 0
      lcd.setCursor(0,0);
      lcd.print("VALUE: ");
      lcd.print(sensorValue);
      lcd.print("ppm");
      if(sensorValue > 300)
      {
      lcd.setCursor(0,1);
      lcd.print("SMOKE DETECTED");
      tone(buzzer, 500, 2000);
      }
      else
      {
      lcd.setCursor(0,1);
      lcd.print(" NO SMOKE");
      noTone(buzzer);
      }
      delay(2000); // wait 2s for next reading
      }

    • @williamchupin4842
      @williamchupin4842 7 หลายเดือนก่อน

      @@beysik6871 i posted the working code

    • @williamchupin4842
      @williamchupin4842 7 หลายเดือนก่อน

      @@kixbix3292 i posted the working code

  • @gerogecluney4860
    @gerogecluney4860 2 ปีที่แล้ว

    These aint ppm values!