Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » Fire Detection System using Flame Sensor & Arduino
Arduino Projects

Fire Detection System using Flame Sensor & Arduino

Mamtaz AlamBy Mamtaz AlamUpdated:February 2, 20251 Comment5 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Fire Detection Flame Sensor Arduino
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Overview

In this project, we will build a Fire Detection System using Flame Sensor & Arduino. Earlier we build a simple Fire Detector Project using Thermistor. But this project uses a specific sensor called Flame Sensor instead of any temperature sensor.

Fire accidents can cause devastating damage to life and property. Early detection of fires is crucial for safety and prevention. With advancements in technology, it’s possible to create a simple yet effective fire detection system using a flame sensor and an Arduino Code.

This post will discuss how to set up a fire detection system that not only senses the presence of a flame but also alerts the surroundings with a visual signal and a melody alarm.


Bill of Materials

For this tutorial I am using the SunFounder Arduino Starter Kit which has 90+ components.

Here are the list of components I am using from this Kit.

S.N.ComponentsQuantityPurchase Links
1Arduino UNO R4/R3 Board1Amazon | AliExpress
2Flame Sensor1Amazon | AliExpress | SunFounder
3Red LED1Amazon | AliExpress | SunFounder
4Buzzer1Amazon | AliExpress | SunFounder
5Connecting Wires10Amazon | AliExpress | SunFounder
6Type C USB Cable1Amazon | AliExpress
7Breadboard1Amazon | AliExpress | SunFounder




Flame Sensor

A flame sensor is a device that can detect the presence of fire or other light sources within a specific wavelength range, typically from 760nm to 1100 nm.

Flame Sensor

It is an essential component in various applications, especially in safety systems where fire detection is crucial. The Flame Sensor is one such device that utilizes the YG1006 sensor, a high-speed and highly sensitive NPN silicon phototransistor, to detect flames.

Working of the Flame Sensor

IR sensors like all other photosensor work on the principle that a photon of sufficient energy can knock out electrons so that the resistance of the circuit is changed.

An IR sensor consists of an emitter, detector, and associated circuitry. The circuit required to make an IR sensor consists of two parts; the emitter circuit and the receiver circuit.

The emitter is simply an IR LED (Light Emitting Diode) and the detector is simply an IR photodiode that is sensitive to IR light of the same wavelength as that emitted by the IR LED. When IR light falls on the photodiode, its resistance and correspondingly, its output voltage, change in proportion to the magnitude of the IR light received.



Features and Specifications

  • Sensor Type: Utilizes YG1006 NPN silicon phototransistor.
  • Sensitivity: Specifically sensitive to infrared radiation due to its black epoxy packaging.
  • Operating Voltage: Ranges from 3.3V to 5V, making it compatible with most microcontroller platforms.
  • Output: Provides both analog and digital outputs for flexibility in interfacing with other circuits.
  • Indicator LED: Comes with an LED indicator that lights up when a flame is detected.
  • Adjustable Threshold: Features a potentiometer to adjust the detection threshold for different flame intensities.
  • Detection Distance: Capable of detecting a lighter flame at a distance of up to 0.8 meters; greater flame intensities can increase this range.
  • Detection Angle: Offers a detection angle of approximately 60 degrees, allowing for a focused detection range.

Pinout

The flame sensor module typically has three to four pins:

Flame Sensor Pinout

  1. VCC: Connects to the power supply (3.3V to 5V).
  2. GND: Connects to the ground of the power supply.
  3. D0 (Digital Output): Outputs a digital signal (high or low) based on flame detection.
  4. A0 (Analog Output): Outputs an analog signal proportional to the intensity of the detected flame.

Fire Detection System using Flame Sensor & Arduino

Now let us interface the Flame Sensor with Arduino UNO board and make our own Fire Detection System.

Circuit Diagram & Connections

Here is a simple circuit diagram for this project.

Fire Detection Flame Sensor Arduino

Connect the flame sensor’s VCC to Arduino’s 5V and GND to Arduino’s GND, and its digital output pin to Arduino’s pin 4.

Flame Sensor Arduino Circuit

The buzzer’s positive lead connects to Arduino’s pin 3, and its negative lead to another GND pin. Lastly, connect the LED’s anode to Arduino’s pin 2 through a 220-ohm resistor, and its cathode directly to Arduino’s GND.


Source Code/Program

The code for Fire Detection System using Flame Sensor & Arduino is very simple and is written in Arduino IDE. You can copy the following code and paste it on your Arduino IDE editor window.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
int flame_sensor_pin = 4;       // initializing pin 4 as the sensor output pin
int buzzer_pin = 3;             // initializing pin 8 as the buzzer pin
int led_pin = 2;                // initializing the pin 2 as the led pin
 
int flame_pin = HIGH;           // state of sensor
 
 
void setup()
{
  pinMode(led_pin, OUTPUT);             // declaring led pin as output pin
  pinMode(flame_sensor_pin, INPUT);     // declaring sensor pin as input pin for Arduino
  pinMode(buzzer_pin, OUTPUT);          // declaring buzzer pin as output pin
  Serial.begin(9600);                   // setting baud rate at 9600
}
 
 
void loop()
{
  flame_pin = digitalRead(flame_sensor_pin);          // reading from the sensor
  if (flame_pin == LOW)                               // applying condition
  {
    Serial.println("FLAME, FLAME, FLAME");
    digitalWrite(led_pin, HIGH);                      // if state is high, then turn high the led
    playMelody();                                     // play a melody on the buzzer
  }
  else
  {
    Serial.println("no flame");
    digitalWrite(led_pin, LOW);                       // otherwise turn it low
    noTone(buzzer_pin);                               // stop playing any tone
  }
}
 
 
void playMelody()
{
  // Play a simple melody: C4, E4, G4, C5
  tone(buzzer_pin, 262, 200);             // C4
  delay(200);
  tone(buzzer_pin, 330, 200);             // E4
  delay(200);
  tone(buzzer_pin, 392, 200);             // G4
  delay(200);
  tone(buzzer_pin, 523, 200);             // C5
  delay(200);
}

From the tools menu, Select the Arduino UNO Board and the Arduino COM port. Then click on the upload icon to upload the code.

Testing & Results

When the flame sensor detects a flame, it sends a digital LOW signal to Digital Pin 4 on the Arduino. The code is written such that when the Arduino detects this LOW signal, it performs two actions.

Fire Detection System Arduino

It sends a HIGH signal to Digital Pin 2, turning on the LED. This serves as a visual indicator that a flame has been detected. It also activates the buzzer on Digital Pin 3 to play a melody.

When the flame sensor does not detect a flame, it sends a HIGH signal to the Arduino, which results in the code sending a LOW signal to the LED pin, turning it off, and stopping any tone on the buzzer.



Video Tutorial & Guide

Fire/flame Detector using Flame Sensor and Arduino
Watch this video on YouTube.


Conclusion

Creating a fire detection system with an Arduino and a flame sensor is a great project for hobbyists and those looking to understand the basics of electronic sensors and alarms. It demonstrates the potential of simple components and how they can be used to create life-saving systems. With the right setup and programming, anyone can build a basic fire detection system that increases safety and provides a quick response to potential fire outbreaks.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleGas Leak Detection & Alarm using MQ2 Sensor & Arduino
Next Article Vibration Detection with SW-420 Vibration Sensor & Arduino

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
View 1 Comment

1 Comment

  1. Divya on October 28, 2018 7:33 PM

    Can you send the block diagram of flame detection circuit

    Reply

CommentsCancel reply

Latest Posts
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

May 31, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
DIY Colorimeter using AS7265x Spectroscopy Sensor & ESP32

DIY Colorimeter using AS7265x Spectroscopy Sensor & ESP32

February 1, 2026
Top Posts & Pages
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • How to use INA226 DC Current Sensor with Arduino
    How to use INA226 DC Current Sensor with Arduino
  • ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
    ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
  • How to use Modbus RTU with ESP32 to read Sensor Data
    How to use Modbus RTU with ESP32 to read Sensor Data
  • IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
    IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
  • IoT Based Electricity Energy Meter using ESP32 & Blynk
    IoT Based Electricity Energy Meter using ESP32 & Blynk
  • Designing of MPPT Solar Charge Controller using Arduino
    Designing of MPPT Solar Charge Controller using Arduino
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (204)
    • ESP32 MicroPython (7)
    • ESP32 Projects (81)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.