Arduino Flame Sensor Interface

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



  1. anitha June 1, 2017 Reply
  2. Costas August 29, 2017 Reply
  3. mho December 14, 2017 Reply
    • Coe May 17, 2018 Reply
  4. Emin Kültürel October 6, 2018 Reply
    • Guy January 8, 2019 Reply

Add a Comment

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