Smit Babariya
Published

Smoke/Gas Leakage Indicator or Alarm

Combustible gas/smoke leakage detector using Arduino.

IntermediateProtip162
Smoke/Gas Leakage Indicator or Alarm

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Grove - Gas Sensor(MQ2)
Seeed Grove - Gas Sensor(MQ2)
for Gas Detection
×1
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1
5 mm LED: Red
5 mm LED: Red
Warning Light ! When Smoke Detected
×1
5 mm LED: Green
5 mm LED: Green
For No Smoke detection
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Gas OR Smoke detector simulation

Code

smoke detector

Arduino
#include<LiquidCrystal.h>
const int rs=2,en=3,d4=4,d5=5,d6=6,d7=7;
LiquidCrystal lcd(rs,en,d4,d5,d6,d7); 
const int red=8,green=10;
int i;
void setup() {
lcd.begin(16,2);
pinMode(green,OUTPUT);
pinMode(red,OUTPUT);
pinMode(9,INPUT);  
lcd.setCursor(0,0);
lcd.print("smoke Detector");  
}

void loop() {


if(digitalRead(9)==1)
{
  digitalWrite(green,LOW);
  digitalWrite(red,HIGH);
  lcd.setCursor(0,1);
  lcd.print("Smoke Detected");
}

else
{
  digitalWrite(green,HIGH);
  digitalWrite(red,LOW);
  lcd.setCursor(0,1);
  lcd.print("No smoke detted ");
}


}

Credits

Smit Babariya

Smit Babariya

8 projects • 3 followers

Comments

Add projectSign up / Login