Arduino Based Fire Monitoring System


This simple project explains how to build a fire monitoring system using Arduino.

Flame sensor is used to detect fire in a specific area (eg:Living room,Kitchen..) and outputs HIGH or LOW.

Arduino is programmed to read the digital input from the flame sensor and send a text message to a predefined phone number by communicating with GSM Module.

In normal condition(no fire) nothing will happen.

Tools & Components

1 X Arduino Nano

1 X SIM900A GSM Module

1 X KY026 Flame Sensor

1 X 5VDC 2A Power Supply

1 X Breadboard

 Jumper Wires

Functioning Sim Card


Connecting Components


Flame Sensor Dout Pin - Arduino Pin D02

GSM Module RX Pin - Arduino Pin D03

GSM Module TX Pin - Arduino Pin D04

NOTE : GSM Module draws higher current when communicating.Hence a power supply with 2A current rating or higher is recommended for powering the system.Otherwise the GSM Module will not work properly.



Arduino Code

//www.craftybin.blogspot.com
//Author : Chathura H.

#include <SoftwareSerial.h>
SoftwareSerial mySerial(4, 3);
int flamedetect = 2;

void setup(){
  pinMode(flamedetect, INPUT);
  Serial.begin(9600);
  mySerial.begin(9600);
  Serial.println("Fire Monitoring System");
  Serial.println("Initializing System");
  delay(100);
 }

void loop(){
  int flame = digitalRead(flamedetect);
  if (flame == HIGH){
  mySerial.println("AT");
  updateSerial();
  mySerial.println("AT+CMGF=1");
  updateSerial();
  mySerial.println("AT+CMGS=\"+YYxxxxxxxxx\"");
//change YY with country code and xxxxxxxxxxx with phone number to sms
  updateSerial();
  mySerial.print("Alert : Fire Detected || Location : xxxxxx");
  updateSerial();
  mySerial.write(26);
  delay(1800000);
  }

 else if(flame == LOW){
  delay(10);
 }
}

void updateSerial()
{
  delay(500);
  while (Serial.available())
  {
    mySerial.write(Serial.read());
  }
  while(mySerial.available())
  {
    Serial.write(mySerial.read());
  }
}

Safety First !

Always Connect the power supply if you are absolutely sure that the components are connected correctly without changing polarity and short circuited the wiring.

Even if it seems nothing is wrong : DOUBLE CHECK EVERYTHING !!

Your Feedback is very important to us. 

Please Leave a comment about how you feel about this project.

1 Comments

Post a Comment

Previous Post Next Post