Arduino Projects

Fire Security System using Arduino & Flame Sensor

Today we will learn to make Fire Security System using Arduino & Flame Sensor. Actually this system will be an automated system. i.e. once we deploy the system it works automatically. So, let’s make a Fire security/control system using Arduino UNO, Flame sensor, and 12 volt DC Fan. So let’s get started without any delay.

Components required

Here are the components required for the Fire Security System using Arduino.

  • Arduino UNO
  • 12volt DC fan
  • Relay Module
  • Flame Sensor
  • LED
  • Breadboard
  • Few jumper wires

Circuit diagram of fire control system

Now it’s time to interfere with all the components to the Arduino UNO board.

Circuit Diagram of Fire control system using arduino and flame sensor
Interfacing Flame Sensor, Relay & DC Fan with Arduino UNO
  • First of all, connect the 5volt to the Positive rail on the breadboard.
  • Then connect GND Pin to the negative rail of the breadboard.
  • To interfere with the flame sensor Connect Vcc and GND to Vcc and GND on the breadboard.
  • Now Connect the D0 pin(signal pin of the flame sensor) to pin 3 of Arduino.
  • Similarly, interface single channel relay GND and Vcc pin to GND and Vcc. Then, Input Pin to Arduino Pins no 12.
  • Now let’s connect the positive terminal of LED to pin 13 of Arduino and Negative Terminal to GND.
  • Finally, connect 12v DC fan Vcc to the common of the relay. In normally open, connect the positive terminal of the fan. Here relay works as a switch.
  • Finally, the Negative Terminal of DC fan to the GND pin on the breadboard.
Fire Security System using Arduino and flame sensor with 12v DC Fan

Actually, we have successfully assembled the circuit. Now let’s get into the programming part. The programming code is provided below.

Program Code Explanation

The program code for Fire Security System using Arduino & Flame Sensor is very easy and simple to understand. Anyone with a basic knowledge can code the program for this system. Here, LED, Relay, and flame sensor pins are defined according to our circuit diagram.

int LED = 13;
int RELAY = 12;
int Flame_sensor = 3;

The serial monitor begins at a baud rate of 9600 to debug the program.

void setup()
{
  Serial.begin(9600);

The pinMode function for LED and Relay is defined as output and for the flame sensor, it is defined as input.

pinMode(LED, OUTPUT);
  pinMode(RELAY, OUTPUT);
  digitalWrite(RELAY, HIGH);
  pinMode(Flame_sensor, INPUT);

In the void loop, If flame_detected==0 then it will execute some commands like Flame or Fire detected, and immediate action is taken. Here we can see the status on the serial monitor. Where LED is turned ON and the DC fan is also turned ON.

void loop()
{
  Flame_detected = digitalRead(Flame_sensor);
  Serial.println(Flame_detected);
  //delay(100);
  if (Flame_detected == 0)
  {
    Serial.println("Flame detected...! take action immediately.");
    digitalWrite(LED, HIGH);
    digitalWrite(RELAY, LOW);
    delay(500);
  }
  

If the above statement goes false It simply displays No flame detected and no action is taken.

else
  {
    Serial.println("No Flame detected. stay cool");
    digitalWrite(LED, LOW);
    digitalWrite(RELAY, HIGH);
  }
}

Isn’t the programming code is super easy to understand? However, if you still have any queries regarding this program code. You can ask me in the comment section below.

Fire Security System Arduino Program Code

This is the full program code for Fire Security System using Arduino & Flame Sensor project. just copy the below code and paste it in your Arduino IDE Program.

int LED = 13;
int RELAY = 12;
int Flame_sensor = 3;
int Flame_detected;
void setup()
{
  Serial.begin(9600);
  pinMode(LED, OUTPUT);
  pinMode(RELAY, OUTPUT);
  digitalWrite(RELAY, HIGH);
  pinMode(Flame_sensor, INPUT);
}
void loop()
{
  Flame_detected = digitalRead(Flame_sensor);
  Serial.println(Flame_detected);
  //delay(100);
  if (Flame_detected == 0)
  {
    Serial.println("Flame detected...! take action immediately.");
    digitalWrite(LED, HIGH);
    digitalWrite(RELAY, LOW);
    delay(500);
  }
  else
  {
    Serial.println("No Flame detected. stay cool");
    digitalWrite(LED, LOW);
    digitalWrite(RELAY, HIGH);
  }
}

Uploading Code

Now go to the Tools menu and select the Arduino UNO board and its COM Port. Now, click on upload to upload the code to the Arduino board.

After successful upload, open your serial monitor at the baud rate of 9600 to see the status.

Fire control system on serial monitor

Here we need some more speed on the fan, so connect the 12v adapter and change the common Pin connected to Vcc to Vin pin of Arduino.


Now it works perfectly. Let’s see some demonstrations.

Video Demonstration of Arduino Fire Security system

Wrapping up

So that’s all for today. We have successfully made an Arduino based fire control system. I hope this tutorial was helpful to you.

Recommended Projects:

Related Articles

3 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button