Introduction: Arduino Modules - Flame Sensor

Picture of Arduino Modules - Flame Sensor

Quick and simple start guide for using and exploring the Flame Sensor module with an Arduino.

The model in the example is a single sensor module from my store, you can find it at Cipher Computer and Robotics.

(The instructable for the Rain Sensor is now available!)

Materials needed:

  • Flame Sensor (model with an analog out)
  • Male to Female jumper wires
  • An Arduino, any flavor.
  • Lighter or another flame source for testing.

Step 1: Getting to Know Your Flame Sensor:

Picture of Getting to Know Your Flame Sensor:

These types of sensors are used for short range fire detection and can be used to monitor projects or as a safety precaution to cut devices off / on.


I have found this unit is mostly accurate up to about 3 feet.

How it works:

The flame sensor is very sensitive to IR wavelength at 760 nm ~ 1100 nm light.

Analog output (A0): Real-time output voltage signal on the thermal resistance.

Digital output (D0): When the temperature reaches a certain threshold, the output high and low signal threshold adjustable via potentiometer.


VCC...... Positive voltage input: 5v for analog 3.3v for Digital.

A0.......... Analog output

D0......... Digital output

GND..... Ground


1.18 in x 0.59 in x 0.20 in (3.0 cm x 1.5 cm x 0.5 cm)


0.28 oz (8 g)

Step 2: Testing and Troubleshooting:

Picture of Testing and Troubleshooting:

To test the Flame Sensor and ensure that it is working correctly connect the VCC to a 5v power source and GND. Move a flame source with in a foot of the front of the Ir sensor and the D0-LED should light up.


If the D0-LED does not light up check the following:

  • Is the power source 5v?
  • Is the ground hooked up?
  • Is the flame with in 1 foot and in Line of Sight?

If none of the previous makes the D0-LED light up, your sensor may be defective.

Step 3: Wiring to an Arduino:

Picture of Wiring to an Arduino:

To wire the Flame Sensor to the Arduino simply connect the following as shown:

Flame sensor ............... Arduino

VCC............................... 5v


A0.................................. Analog in 0

Step 4: Arduino Sketch Example:

The following code maps and reads the analog values given by the flame sensor (0-1024). The stock flame sensor will have the following reaction with this code:

  • If holding a flame within 1.5 feet in front of the sensor; "case 0" will be activated and " ** Close Fire ** " will be sent to the serial monitor.
  • If holding a flame between 1.5 feet and 3 feet in front of the sensor; "case 1" will be activated and " **Distant Fire** " will be sent to the serial monitor.
  • If no flame is detected in front of the sensor; "case 2" will be activated and " No Fire " will be sent to the serial monitor.

* To view the output, point a serial monitor such as Putty at your Arduino.

* This code is constantly updating in order to provide a real time feedback of the flame sensor.


  • Attached due to formatting.


aaryesh (author)2016-03-22

i purchased a sensor with no analog pin , it only has D0 , anyway that i can make it work????

diy_bloke (author)aaryesh2017-08-14

a bit late, but maybe someone else is helped with it. Look here under wiring diagram

KaushikmerinT (author)aaryesh2016-03-23

You could try plugging that pin into A0. Maybe that works.

waeltken (author)2016-05-01

Hi Reichenstein7,

I building an outdoor project using this type of sensor on a propane burner. Looks like this sensor is very sensitive to daylight which impairs its ability to distinguish between daylight with and without a flame in front of it. Any ideas for a flame sensor which would not be daylight impaired? I thought about using a thermocouple, but a LPG propane burner flame is around 3500 deg F and most thermocouples won't be able to deal. I thought about maybe a laser type sensor, but not sure what happens to a laser when it's pointed through a "blue" (400-500 nm) flame, vs not. Or are there other flame sensors that would be better suited to detect a flame in daylight?

Any advice you have would be much appreciated....

arduinomaster (author)waeltken2017-05-06

try a gas and smoke sensor. They work well an d are independent of daylight.

Joe Moger (author)waeltken2017-01-15

i notice it too.

erice1984 (author)waeltken2017-01-02

I was about to embark on a similar project. I was thinking of placing the sensor inside a tube, maybe some iron pipe and have the pipe be directed at the flame drastically cutting down ambient light false readings. I am curious if you solved your problem.

R Jordan Kreindler (author)2016-07-11

A topic of interest, thanks - it is appreciated.

FallagaF (author)2016-03-27

Excuse me. But i don't have module like this. I have the sensor itself with two legs (short and long). Please can anybody help how to wire it to arduino uno. Thanks.

prasannas7 (author)2016-03-20

about flame sensor????

SharweenK (author)2016-01-04

Say i would want my robot to stop 30cm before the fire when it is detected. Can it be done by using an additional flame sensor? thanks.

vandenbrande (author)SharweenK2016-03-10

Yes that should be possible, when it reads a certain value it would stop.. all you need to do is see at what value the sensor is when you hold it 30 cm infront a fire and set that value in the "if" statement.

Actually you could use the built in potentiometer to set a max range for the sensor to your desired 30cm. Basically 30cm would trigger the sensor to read from low to high and give you a signal.

** These sensors are not very good at reading distance so you will not get a reliable signal that varies in centimeters. Its much more reliable for reading either ON (Fire) or OFF (No Fire).

BoKKeR (author)2015-09-05

hey can you help me how to make it more accurate, how to edit the values so it detects a little better? I have a light sensor but it works the same way

BoKKeR (author)BoKKeR2015-09-05

okay I found out if you use sensormin around 800-900 it responds better to changes

MohammadA30 (author)2015-06-09

i have bought 5 channel flame sensor, but i don't have any idea how to connect and program it.i didn't found any tutorial regarding this flame sensor..kindly help me out!!

Your sensor should be about the same. Instead of reading the value from one sensor, you can read a value from 5 sensors. For instance if you read the value one at a time, you could use your sensor to figure out which direction a flame is in (at a short distance, depending on the sensor).

If you can send me a link to yours I can take a look at it.

Have a look at the sensor, i was asking about

Mariammal (author)2015-08-24

Can this type of flame sensor only detect up to 2-3 feet?

How can We improve its efficiency?

can you please explain?

my mail id:

Reichenstein7 (author)Mariammal2015-08-28

This sensor was only designed for very close ranges, such as detecting a pilot light (USE AT YOUR OWN DISCRETION).

韋棠王 (author)2015-07-24

Hi Reichenstein7,I would want to know if I can get the temperature from the relation to the analog output value and the thermal resistance.

Reichenstein7 (author)韋棠王2015-08-28

Sorry this will not achieve temperature readings. I would combine a temperature sensor, even an infrared one to your project.

TheGreatResistor (author)2015-07-22

i dont have the module only the ir sensor i have any codes projects i can do

gurmohitwadhwa (author)2015-04-19

how to interface the sensor using digital output...?

While this module will support digital output I found it super simple and useful for my project to collect from the A0 pin in analog. Digital output should be hooked up to the D0 output pin on the Flame Sensor Module.

dmason12 (author)2015-04-25

Hi Reichenstein, I would like to use an IR sensor to detect when a goal has been scored on an air hockey table? Would you say this is feasible?

Reichenstein7 (author)dmason122015-04-30

This should be doable, though I wouldn't use a flame sensor for it. All you would have to do is have an IR beam fire across the hole for the goal. Emitter on one side, collector on the other. I would worry about the sensitivity of the sensor versus the speed in which that puck must travel. A a neat experiment you may want to try is a laser across the goal hole. Puck breaks the beam, code counts the breaks..

ShravyaM (author)2015-01-03

i just got my falme sensor module from ebay. D0 led glows even when there is no flame near by. i tried adjusting the sensitivity but it didnt help. do you think it could be faulty???

Reichenstein7 (author)ShravyaM2015-04-30

I have not seen one of these sensors where the D0 LED stays lit even after the sensor is removed from a flames view. I would imagine that is it either a fault or the sensitivity adjustment is damaged. I have seen a few of those trim pots not work on other devices such as voltage steppers.

AliW3 (author)2015-03-29

How can I use a piezo speaker if long fire is detected and also short fire? (I dont know coding please help!)

(Close fire = LOUD noise alarmlike) long fire = not too loud noise

g0dard (author)2014-11-12

i cannot find the sketch?!

Reichenstein7 (author)g0dard2014-11-12

It's the "Flame_Sensor_Example_Reichenstein7.ino" file located at the end of the Instructable.

g0dard (author)Reichenstein72014-11-12

thx... i had to switch the language inside to see the attachment. its not visible on the german site. thx again.

amro.qandour (author)2014-08-26

I hope they would release long range IR sensors. These DX sensors aren't so useful when it comes to real-world implementation.

These sensors are made for detecting flame in a confined space, for example a pilot light. They are not broad enough to say detect a fire in a room or open space.

maverickvinz (author)2014-08-25

Where can i buy that one sir ?

I cannot tell from the description if this model is analog or digital. If it is digital only then this Arduino code will not work. This model also appears not to have the test light.

The model that I used includes Digital and Analog pins. It can be found through the website "Deal Extreme". ( )

The Arduino was just an old one I had laying around and the attached code should work with any model.

XVinnys (author)2014-08-26

Hello there.
Do you think this could make a log of how much time a gas water heater is on?

Or should I think of "hacking" the heater flow sensor into the arduino for a log?

Thaks for your reply. Nice project ;)

Reichenstein7 (author)XVinnys2014-08-27

There are two ways of doing this that I can think of with a flame sensor.

With the flame sensor pointed at the burner port:

a) Log the time that the sensor is active, you can change your algorithm for seconds, minutes, or hours, but this would be an accumulated total.

b) Throw a Real Time Clock module into the mix like the DS1302 and be able to log the results in real time.

For better results with the examples above, try sending your data to Processing ( for a more robust feedback.

- Hope this helps!

dheiss made it! (author)2014-08-26

Very nice!! Good tip! Thanks!

SamM5 (author)2014-08-26

Nice Instructable ! . Can you integrate that with BlueAct application mm like playing alarm sound or send SMS when there is a flame ? BTW nice and clean graphic :D

ArduinoGuido (author)2014-08-25

Very good Instructable! I have purchased one of these and never got around to learning it and you saved me a great amount of time. Thanks.

MsSweetSatisfaction (author)2014-08-24

Neat project concept, and good job explaining the complex parts. Thanks for sharing!

Thank you. =)

About This Instructable




More by Reichenstein7:Boneless Pork Loin With Bacon LatticeUArm Miniature Palletizing Robot Arm for ArduinoGeneral Tso Boneless Ribs
Add instructable to: