Arduino Flame Sensor Interface

Last Updated on March 16, 2024

arduino flame sensor

Build fire alarm or fire detector using Flame sensor and Arduino board, the sensor basically detects IR (Infra Red) light wavelength between 760 nm – 1100 nm (nano meter) that is emitted from fire flame. Most of the flame sensors came with YG1006 sensor which is a high speed and high sensitive NPN silicon photo transistor.

It is covered with black epoxy, since the sensor is sensitive to infrared radiation. By using this concept project you can understand how to monitor and alert about fire flame, It is most suitable for fire fighting robot, fire alarm etc..,

Flame Sensor

Flame Sensor

The flame sensors available in the market with two categories one is having three pins (D0, Gnd, Vcc) and second one is having four pins (A0, D0, Gnd, Vcc) both are can be easily interfaced with Arduino and arduino compatible boards.

If you wish to connect manually without any sensor module you can try the following circuit with discrete components, yes you can 🙂

Flame Sensor Circuit Diagram


Circuit diagram Source:

Choose comparator amplifier for output drive and make two possible output as A0 and D0, here

D0 – Give Zero output for nothing detected and One for a +Ve detection.

A0 – Give values in range representing the flame probability/size/distance and must be connected to the PWM input of microcontroller.

Testing Angle of Sensitivity

Make little experiment to test the angle of sensitivity for your flame sensor, to find the exact active vision range and angle.

fire sensor

By connecting sensor output pins with multimeter and showing towards flame with different angle and distance gives you describable details about viewing angle.

Arduino Flame sensor Hookup

Analog (A0) Output

arduino flame sensor hookup


Digital (D0) Output

arduino flame sensor connection

Connect as per the hookup diagram give power supply from the power source of Arduino board. connect output pin of flame sensor to the Arduino GPIO pin, and upload the following code as per your wish.

Arduino Code for Flame Sensor 

Flame Sensor Digital (D0) Output


/* Source:*/

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);

void loop() {
  Flame = digitalRead(FlamePin);
  if (Flame== HIGH)
    Serial.println("HIGH FLAME");
    digitalWrite(Buzzer, HIGH);
    Serial.println("No flame");
    digitalWrite(Buzzer, LOW);

Flame Sensor Analog (A0) Output


/* Source: */

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:

void loop() {
  // read the value of the Flame Sensor:
  int analogValue = analogRead(analogPin);
   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);
    digitalWrite(BuzzerPin, LOW);
  else {
    digitalWrite(BuzzerPin, LOW);
    Serial.print("No flame");


7 thoughts on “Arduino Flame Sensor Interface

  1. can we know the the distance how long distance the fire were detected..
    plz provide me the solution for it.

  2. Correct me if I’m wrong, but from the diagram, the LED will glow when the output goes LOW, so I will guess the output goes low when a fire is sensed. Your code however senses HIGH, what is really going on here?

    1. I interfaced the flame sensor to PIC16F877A and it gave a LOW when it detected flame, that should be the case

  3. Hi,

    Circuits senses candle flame or some other white emitting light sources but not natural gas flame. I think it happens due to difference of the frequencies of the sources.

    How will it be possible to sense natural gas flame?


    1. I also wanted to detect flame in my propane boiler, but it does not respond. If anyone has a solotuion for sensing gas flames, I also would be interested. Thanks

  4. it was rellay good project to make fire alarm circuit and i used this circuit in my home kitchen some times automatically the buzzer rangs without any flame why the problem was occuring i dont know but anyway this circuit was really help for me thank you I bought the flame sensor from

Leave a Reply

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