
In this we are going to interface Flame Sensor with Arduino Uno and detect flames.
Components Required
- Arduino Uno – (Checkout)
- Flame Sensor – (Checkout)
- Jumpers – (Checkout)
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. This Flame Sensor module is accurate up to about 3 feet. 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.
Pins:
VCC – Positive voltage input: 5v for analog 3.3v for Digital.
A0 – Analog output
D0 – Digital output
GND – Ground
Circuit Diagram

To connect the Flame Sensor to the Arduino connect the following as shown in the above Diagram:
Flame sensor – Arduino
VCC —> 5v
GND —> GND
A0 —> Analog in 0
Code
// lowest and highest sensor readings:
const int sensorMin = 0; // sensor minimum
const int sensorMax = 1024; // sensor maximum
void setup()
{
// initialize serial communication @ 9600 baud:
Serial.begin(9600);
}
void loop()
{
// read the sensor on analog A0:
int sensorReading = analogRead(A0);
// map the sensor range (four options):
// ex: 'long int map(long int, long int, long int, long int, long int)'
int range = map(sensorReading, sensorMin, sensorMax, 0, 3);
// range value:
switch (range)
{
case 0: // A fire closer than 1.5 feet away.
Serial.println("** Close Fire **");
break;
case 1: // A fire between 1-3 feet away.
Serial.println("** Distant Fire **");
break;
case 2: // No fire detected.
Serial.println("No Fire");
break;
}
delay(1); // delay between reads
}