trijalsrimal
Published © GPL3+

Fire, Gas and Smoke Detector

This project can detect gas leaks, fire and smoke and when powered by a nine volt adapter can act as a gas leak detector for kitchens.

IntermediateFull instructions provided28,990
Fire, Gas and Smoke Detector

Things used in this project

Hardware components

Arduino Mega 2560
Arduino Mega 2560
×1
MQ2 gas and smoke sensor
×1
Flame Sensor
×1
5 mm LED: Red
5 mm LED: Red
×1
5 mm LED: Green
5 mm LED: Green
×1
Buzzer, Piezo
Buzzer, Piezo
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
9V battery (generic)
9V battery (generic)
×1
9V Battery Clip
9V Battery Clip
×1

Software apps and online services

Arduino IDE
Arduino IDE
Arduino Web Editor
Arduino Web Editor

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver
Screwdriver can be used to adjust the potentiometer behind the sensors.

Story

Read more

Schematics

Schematic

THE pins are to be connected as such
MQ2 sensor A0-A0
gnd -gnd
vcc-5 v
flame sensor analog -A1
vcc-5 v
gnd-gnd
green led -digital pin 11
red led-digital pin 12
buzzer- ditital pin 10
buzzer and led gnd to arduino's gnd

The mq 4 sensor in the fritzing file has the safe config as the mq 2 sensor.
The flame sensor also is the one which i found on fritzing but the one which i have used can be bought from the following link https://www.flipkart.com/rotobotix-fire-flame-sensor-module/p/itmefvrkaevfwpee?gclid=CjwKCAjwo9rtBRAdEiwA_WXcFqBWJgasifZo2X3zWz6o8nJwQT2OZ3zHCLg2yew_anP1qPaYZznAKRoCHgwQAvD_BwE&pid=ETYEFVRKR4F7ZBDH&lid=LSTETYEFVRKR4F7ZBDHQFGCGR&marketplace=FLIPKART&cmpid=content_learning-toy_8965229628_gmc_pla&tgi=sem,1,G,11214002,g,search,,301302884581,1o1,,,c,,,,,,,&ef_id=CjwKCAjwo9rtBRAdEiwA_WXcFqBWJgasifZo2X3zWz6o8nJwQT2OZ3zHCLg2yew_anP1qPaYZznAKRoCHgwQAvD_BwE:G:s&s_kwcid=AL!739!3!301302884581!!!g!297659526198!
File missing, please reupload.

Code

FIre and gas detection sensor

Arduino
#include<SoftwareSerial.h>
int redLed = 12;
int greenLed = 11;
int buzzer = 10;
int smokeA0 = A0;
int sensorPin = A1;
int sensorThres = 500;

void setup() {
  pinMode(redLed, OUTPUT);
  pinMode(greenLed, OUTPUT);
  pinMode(buzzer, OUTPUT);
  pinMode(smokeA0, INPUT);
  pinMode(sensorPin,INPUT);
  
  Serial.begin(9600);
}

void loop() {
  int analogSensor = analogRead(smokeA0);

  Serial.print("Pin A0: ");
  Serial.println(analogSensor);
  if (analogSensor > sensorThres)
  {
    digitalWrite(redLed, HIGH);
    digitalWrite(greenLed, LOW);
    tone(buzzer, 1000, 200);
  }
  else
  {
    digitalWrite(redLed, LOW);
    digitalWrite(greenLed, HIGH);
    noTone(buzzer);
  }
  delay(100);

Serial.println("Flame Sensor");

int sensorValue = analogRead(sensorPin);

Serial.println(sensorValue);

if (sensorValue < 100)

{

Serial.println("Fire Detected");

Serial.println("LED on");

digitalWrite(redLed,HIGH);
digitalWrite(greenLed,LOW);
tone(buzzer,1000,200);

}
else
{
digitalWrite(redLed,LOW);
digitalWrite(greenLed,HIGH);
noTone(buzzer);
}
delay(100);

}

Credits

trijalsrimal

trijalsrimal

0 projects • 5 followers

Comments