Skip to Content

FLAME DETECTION AND FIRE ALARM SYSTEM

Fire safety is a critical concern in homes, offices, and industrial settings. Early detection of fire can significantly reduce the risk of damage, injuries, and loss of life. The Flame Detection and Fire Alarm System is a compact, cost-effective, and efficient solution designed to detect the presence of fire using a flame sensor and trigger an alarm system (buzzer and LED) to alert occupants. This system leverages the power of an Arduino Uno/Nano microcontroller to process sensor data and activate the alarm when a flame is detected.

The flame sensor used in this system is an IR-based sensor, which detects infrared radiation emitted by flames. When the sensor detects a flame, it sends a signal to the Arduino, which then activates the buzzer and LED as visual and auditory warnings. Additionally, the system can be expanded to include a relay module for activating fire suppression systems like sprinklers or sending alerts to external devices via Wi-Fi or GSM modules.

This project is ideal for beginners and hobbyists interested in electronics and fire safety systems. It provides a hands-on opportunity to learn about sensor integration, microcontroller programming, and circuit design. The system is also scalable, making it suitable for small-scale applications like homes or large-scale industrial setups.

Components Required

  • Arduino Uno
  • Flame Sensor 
  • Buzzer
  • LED
  • 220Ω Resistor
  • Jumper wires
  • Breadboard
  • Power Supply

Circuit Diagram

1. Connecting the Flame Sensor to Arduino  

The flame sensor detects the presence of fire by sensing infrared radiation (IR) emitted from  flames. It provides both analog and digital output:  

  • The analog output (A0) gives precise fire intensity readings (optional). 
  • The digital output (D0) triggers when the detected IR level exceeds a set threshold.  

Follow these steps to connect the sensor:  

  • VCC (Power Supply) → Connect to 5V on Arduino to provide power to the sensor. 
  • GND (Ground) → Connect to GND on Arduino to complete the circuit.  
  • D0 (Digital Output Pin) → Connect to D2 on Arduino. This pin will be used for  detecting fire.  

2. Connecting the Buzzer and LED  

When fire is detected, an LED will turn on as a visual alert, and a buzzer will sound as an audio  warning.  

Buzzer Connection  

  • Buzzer Positive (+) (Red Wire) → Connect to D8 on Arduino. This pin will activate  the buzzer when fire is detected.  
  • Buzzer Negative (-) (Black Wire) → Connect to GND on Arduino.  

LED Connection  

  • Anode (+) (Longer Leg of LED) → Connect to D7 on Arduino through a 220Ω  resistor. This ensures that the LED doesn’t draw too much current.  
  • Cathode (-) (Shorter Leg of LED) → Connect to GND on Arduino.  

Why use a 220Ω resistor? 

The resistor limits excessive current flow, preventing the LED from burning out.  

3. Powering the System  

You need to provide a stable 5V power source to the Arduino and its components. There are two  recommended options:  

  • USB Power Bank: Connect the Arduino’s USB port to a USB power bank or adapter for reliable operation.  
  • 9V Battery (for standalone operation): Connect the positive terminal of a 9V battery to the VIN pin on Arduino, and the negative terminal to GND.  

Important: 

Do NOT connect a 9V battery directly to the 5V pin, as this could damage the Arduino. Always use VIN, which allows the Arduino's built-in voltage regulator to step down the  voltage safely



CODE

#define FLAME_SENSOR 2  

#define BUZZER 8  

#define LED 7  

void setup() {  

​ pinMode(FLAME_SENSOR, INPUT);  

​ pinMode(BUZZER, OUTPUT);  

​ pinMode(LED, OUTPUT);

​ digitalWrite(BUZZER, LOW);  

​ digitalWrite(LED, LOW);  

​ Serial.begin(9600);  

}

void loop()  {  

 int flameDetected = digitalRead(FLAME_SENSOR);  

 if (flameDetected == LOW) { // Fire detected(sensor outputs LOW when flame is detected)  

​ digitalWrite(BUZZER, HIGH);  

​ digitalWrite(LED, HIGH);  

​ Serial.println("Fire Detected! Alarm Activated!");

}

else { // No fire detected  

​ digitalWrite(BUZZER, LOW);  

​ digitalWrite(LED, LOW);

  ​Serial.println("No Fire Detected.");  

 }  

 delay(500);  

}

CODE EXPLANATION

1. Pin Definitions

#define FLAME_SENSOR 2  
#define BUZZER 8 
#define LED 7   
  • FLAME_SENSOR: The digital pin (D2) connected to the flame sensor's digital output (D0).
  • BUZZER: The digital pin (D8) connected to the buzzer's positive terminal.
  • LED: The digital pin (D7) connected to the LED's anode through a 220Ω resistor.

2. Setup Function

void setup() {  
  pinMode(FLAME_SENSOR, INPUT); 
  pinMode(BUZZER, OUTPUT); 
  pinMode(LED, OUTPUT); 
  digitalWrite(BUZZER, LOW); 
  digitalWrite(LED, LOW); 
  Serial.begin(9600); 
}
  • pinMode(FLAME_SENSOR, INPUT): Configures the flame sensor pin as an input to read the sensor's digital signal.
  • pinMode(BUZZER, OUTPUT): Configures the buzzer pin as an output to control the buzzer.
  • pinMode(LED, OUTPUT): Configures the LED pin as an output to control the LED.
  • digitalWrite(BUZZER/LED, LOW): Ensures the buzzer and LED are initially turned off.
  • Serial.begin(9600): Initializes serial communication at 9600 baud rate for debugging and monitoring.

3. Loop Function

void loop() {  
  int flameDetected = digitalRead(FLAME_SENSOR); 
   
  if (flameDetected == LOW) { // Fire detected (sensor outputs LOW when flame is detected) 
    digitalWrite(BUZZER, HIGH); 
    digitalWrite(LED, HIGH); 
    Serial.println("Fire Detected! Alarm Activated!"); 
  }
else { // No fire detected 
    digitalWrite(BUZZER, LOW); 
    digitalWrite(LED, LOW); 
    Serial.println("No Fire Detected."); 
  } 
  delay(500); 
}
  • flameDetected = digitalRead(FLAME_SENSOR): Reads the digital signal from the flame sensor. The sensor outputs LOW when a flame is detected and HIGH when no flame is detected.
  • if (flameDetected == LOW): Checks if a flame is detected.
    • digitalWrite(BUZZER, HIGH): Turns on the buzzer.
    • digitalWrite(LED, HIGH): Turns on the LED.
    • Serial.println(" Fire Detected! Alarm Activated!"): Prints a message to the Serial Monitor indicating that fire has been detected.
  • else: Executes when no flame is detected.
    • digitalWrite(BUZZER/LED, LOW): Turns off the buzzer and LED.
    • Serial.println("No Fire Detected."): Prints a message to the Serial Monitor indicating no fire is detected.
  • delay(500): Adds a 500ms delay to stabilize the loop and avoid rapid toggling of the alarm.

OBSERVING FUNCTIONALITY

  1. Place a small controlled flame (such as a lighter) near the flame sensor. 
  2. The buzzer will sound, and the LED will turn on when the flame is detected.  
  3. Move the flame away, and the alarm will stop automatical

COMMON PROBLEMS AND SOLUTIONS

1. Sensor Not Detecting Fire? 

  • Ensure the sensor is positioned correctly and facing the flame.  
  • Try adjusting the sensor's sensitivity using the onboard potentiometer.  

2. False Alarms (Buzzer Sounds When No Fire is Present)? 

  • The sensor may be detecting other infrared sources (e.g., sunlight, hot objects).  
  • Place the sensor away from direct sunlight and strong heat sources.  

3. Buzzer Not Sounding When Fire is Detected? 

  • Check if the buzzer is properly connected to D8 and GND. 
  • Verify that  the Arduino is receiving input from the flame sensor.

Conclusion

The Flame Detection and Fire Alarm System is a simple yet effective solution for early fire detection and alerting. By integrating a flame sensor, buzzer, and LED with an Arduino microcontroller, the system provides real-time monitoring and immediate alerts in the event of a fire. The project is not only cost-effective but also highly customizable, allowing for the addition of features like relay modules for fire suppression systems or IoT integration for remote alerts.

This system is particularly useful for homes, offices, and small industries where fire safety is a priority. It serves as an excellent educational tool for learning about electronics, programming, and sensor integration. With further enhancements, such as Wi-Fi or GSM modules, the system can be transformed into a comprehensive fire safety solution capable of sending alerts to smartphones or other devices.

In conclusion, this project demonstrates how technology can be leveraged to create practical, life-saving solutions. It highlights the importance of innovation in fire safety and encourages further exploration and development in this critical field. Happy tinkering!


Comments

AUTOMATED LIGHT DIMMER CONTROLLED BY AMBIENT LIGHT