Learn to DIY a Fire Alarm System in 3 Minutes: A Practical Guide

Build your fire alarm system at home using Arduino UNO. In this tutorial, you will learn all the steps to DIY an Arduino fire alarm system.

Learn to DIY a Fire Alarm System in 3 Minutes: A Practical Guide

Components Required for This Project

Hardware Components

  • Arduino Mega 2560 and Genuino Mega 2560

  • Buzzer

  • Flame Sensor

  • Jumper Wires (Generic)

Software Apps and Online Services

Arduino IDE

Make your fire alarm system at home using Arduino UNO. In this tutorial, you will learn all the steps to DIY an Arduino fire alarm system. In this project, we need an IR-based flame sensor to detect flames, which will send a signal to the Arduino and connect a buzzer to provide us with a fire alarm.

There are two types of flame sensors: analog and digital. Some sensors have two functions that you can easily use with minor modifications to the circuit diagram, which is not a big issue. We will use both types of sensors, and the source codes for both will be provided in the relevant sections.

Learn to DIY a Fire Alarm System in 3 Minutes: A Practical Guide

Arduino Flame Alarm System

Build a fire alarm or fireplace detector using a flame sensor and Arduino board. The sensor primarily detects infrared light emitted from flames with wavelengths of 760 nm – 1100 nm. The YG1006 sensor is preferred for most fire sensors due to its fast feedback speed and high sensitivity to NPN silicon phototransistors. As the sensor is sensitive to infrared radiation, black epoxy resin contains abrasive (miles). By using this method, you can identify and measure the distance from the sensor to the center of the flame, which is best suited for combat robots, fire alarms, etc.

Required Components

Arduino UNO (Any)

Flame Sensor

Buzzer

Jumper Wires

9V Power Supply

Learn to DIY a Fire Alarm System in 3 Minutes: A Practical Guide

Flame Sensor Circuit Diagram

Now, you need to connect all components correctly. Refer to the following for both types of sensors.

1. For the digital sensor, connect as shown in the diagram.

Learn to DIY a Fire Alarm System in 3 Minutes: A Practical Guide

2. For A0 (analog sensor), the wiring will be as shown in the diagram.

Learn to DIY a Fire Alarm System in 3 Minutes: A Practical Guide

Source Code for Flame Sensor

1. Digital flame sensor code. (D0)

// http://www.mrmodder.com visits for more Arduino Projects //

int Buzzer = 13; // Use buzzer for alert

int FlamePin = 2; // This is for input pin

int Flame = HIGH; // HIGH when FLAME Exposed

void setup() {

pinMode(Buzzer, OUTPUT);

pinMode(FlamePin, INPUT);

Serial.begin(9600);

}

void loop() {

Flame = digitalRead(FlamePin);

if (Flame== HIGH)

{

Serial.println(“HIGHFLAME”);

digitalWrite(Buzzer, HIGH);

}

else

{

Serial.println(“Noflame”);

digitalWrite(Buzzer, LOW);

}

}

//        http://www.mrmodder.com   visits for more Arduino Projects //
const int analogPin = A0;    // Flame Sensor (A0) to Arduino analog input pin A0
const int BuzzerPin = 13;       // Buzzer output pin
const int threshold = 400;   // Flame level threshold (You can vary the value depends on your need)
 
void setup() {
 
 pinMode(BuzzerPin, OUTPUT);
 // initialize serial communications:
 Serial.begin(9600);
}
 
void loop() {
 // read the value of the Flame Sensor:
 int analogValue = analogRead(analogPin);
 

2. Source code for A0 analog flame sensor.

 Serial.println(analogValue);//serial print the FLAME sensor value
 
 if (analogValue > threshold) {
   digitalWrite(BuzzerPin, HIGH);
   Serial.print("High FLAME");
 }
  else if (analogValue == threshold){
   Serial.print("Low FLAME");
   digitalWrite(BuzzerPin, HIGH);
   delay(400);
   digitalWrite(BuzzerPin, LOW);
 }
 else {
   digitalWrite(BuzzerPin, LOW);
   Serial.print("No flame");
 }
 
 delay(1);      
}

Upload the relevant code to the Arduino board to test the flame sensor. It can detect fires within a 3-foot range from my testing point. However, this depends on the quality of the sensor, and it may vary on your sensor.

Leave a Comment

×