Arduino lesson – Flame Sensor


Arduino lesson – Flame Sensor


Overhere we will show you what is the flame sensor and how it works, you can follow the next lesson to get how to use the flame sensor with the Osoyoo UNO board.

Flame sensor is an electronic device which is capable of sensing/detection of fire or a high temperature zone. It gives an indication through an LED attached at its top, just after sensing the fire. These type of sensors are usually used for short ranges. They are able to detect the fire up to 3 feet. Flame sensors is the most common device available in the market these days due to its good results and cost efficiency.

Flame sensors are available in the market in two types one having three pins and the other having four pins respectively. Both of the sensors can be easily interfaced to any micro-controller. We are using four pin flame sensor in this tutorial. You will see the complete wiring diagram for interfacing flame sensor with Arduino and the complete Arduino source code and its description as well.



  • Osoyoo UNO Board (Fully compatible with Arduino UNO rev.3) x 1
  • Flame Sensor x 1
  • F/M jumpers
  • USB Cable x 1
  • PC x 1


  • Arduino IDE (version 1.6.4+)

About Flame Sensor

The Flame Sensor can detect flames in the 760 – 1100 nano meter wavelength range. Small flames like a lighter flame can be detected at roughly 0.8m. Detection angle is roughly 60 degrees and the sensor is particularly sensitive to the flame spectrum.The module consists of an IR sensor, potentiometer, OP-Amp circuitry and a led indicator. An on board LM393 op amp is used as a comparator to adjust the sensitivity level. The sensor has a digital and analog output and sensitivity can be adjusted via the blue potentiometer.


  • The operating voltage is from 3.3 – 5V.
  • It gives us both analog and digital output.
  • It has a led indicator, which indicates that whether the flame is detected or not.
  • The threshold value can be changes by rotating the top of potentiometer.
  • Flame detection distance, lighter flame test can be triggered within 0.8m, if the intensity of flame is high, the detection distance will be increased.
  • The detection angle of the flame sensor module is about 60 degrees.

It has both outputs, analog and digital. The analog output gives us a real time voltage output signal on thermal resistance while the digital output allows us to set a threshold via a potentiometer. In our tutorial we are going to use both of these outputs one by one and see how the sensor works.We can use the flame sensor to make an alarm when detecting the fire, for safety purpose in many projects and in many more ways.

Working Principle

  • Flame sensor is very sensitive to flame and other lights.
  • Its analog output provides real time output voltage on the thermal resistance.
  • When the temperatures reaches at the certain threshold the output high and low signal threshold adjustable via potentio-meter , Its the task of digital output.

flame sensor Pin Out

The pin out of the flame is as follows.

A0: This is the analog pin and this will be connected to the analog pin of the Arduino.

G/GND: This is the ground pin and this will be connected to the ground of the Arduino.

+/VCC: This is the input voltage pin of the sensor and this will be connected to the +5V of Arduino.

D0: This is the digital pin and this will be connected to the digital pin of Arduino.

Arduino Application Circuit

Arduino Code for Flame Sensor

Flame Sensor Digital (D0) Output

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("HIGH FLAME");
    digitalWrite(Buzzer, HIGH);
  { Serial.println("No flame");
    digitalWrite(Buzzer, LOW);

Flame Sensor Analog (A0) Output

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


About the Author

amber administrator

You must be logged in to post a comment