Это видео недоступно.
Сожалеем об этом.
How TO USE MQ2 GAS SENSOR WITH ARDUINO FOR SMOKE DETECTION.
HTML-код
- Опубликовано: 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...
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!
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
}
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
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
verry nice
Without i2c.work?
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
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
@@mytectutor Thank you, I'll take a look. But, what I need is for gas leak detection.
@@mytectutor Sir can you explain how to adjust the sensetivity of MQ 135 ?
Sir can we use same connection and code for mq135 sensor
Hi,
I have the error:
'POSITIVE' was not declared in this scope
Any idea of how to solve it ?
I m gng to try this project ! Does this run good efficiently ?? Please do reply
same positive
#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
}
@@beysik6871 i posted the working code
@@kixbix3292 i posted the working code
Anyone know why I can't run the code on Arduino software. It's say I cannot detect the #INCLUDE liquid crystal name
I have a doubt y arduino... This work smoke detector does rgt... Bcoz of digital number
Can you please provide library l2C Lcd zip file for this?its giving me error
program code?
These aint ppm values!