book collections email follower instructable user

Step 2: Flame Sensor

Picture of Flame Sensor
FLAME_arduino.jpg
FLAMEparaguas.jpg
FLAME_valores.jpg
FLAMEporcentajeRadiacion.jpg

Learning objectives

  • To measure infrared radiation
  • To detect sources of infrared radiation.
  • To analyze how electromagnetic radiation is transmitted and reflected.

The flame sensor is a module that detects the infrared (IR) radiation that comes from a fire, the Sun, and other sources of heat. It is sensitive to short wavelength infrared radiation, that is, radiation with a wavelength in the range 760-1100 nanometers. The detection angle is approximately 60°.

When this sensor receives IR radiation the output signal is low (close to 0), and when it doesn't detect radiation the output signal is high (close to 1023). In other words, low values in the sensor mean high levels of IR radiation, and high values in the sensor mean low levels of IR radiation.

Connecting the sensor

The sensor can be connected directly to Arduino, but you can as well use a breadboard. It has four pins, but we'll be using only three of them. The sensor's pin labeled as + (or VCC) is connected to +5 V in Arduino, and pin G (or GND) in the sensor is connected to ground in Arduino. Pin AO (Analog Output) is the analog data pin, so Arduino reads through this pin the values measured by the sensor. Connect it to any analog input in your board (from A0 to A5). The Digital Output (DO) pin in the sensor is not connected.

Reading the sensor

To try this sensor, you can use the same program that we used to read the analog signal of the LM35 temperature sensor:

void setup() {
  Serial.begin(9600);
}

void loop() {
  int sensorValue = analogRead(0);
  Serial.println(sensorValue);
  delay(1000);
}

Upload the sketch and open the serial monitor. Aim the sensor to the sunlight. Now take it inside a dark room. Do you see how the values change depending on where the sensor is pointing to?

Transforming raw values into percentage

The raw values measured by the sensor give us a good idea of how the sensor works, and how the amount of IR radiation changes depending on the environmental conditions. But they are not very descriptive. So let's transform them into a percentage. This way a value of 0 % would mean “No IR radiation at all” and 100 % would be the maximum IR radiation that the sensor can measure. To achieve this we'll use a very useful function in Arduino: the map() function. Try this code (you may want to adjust the potentiometer in the module to obtain a suitable range in the measured values):

// The flame sensor is connected to analog pin 0
const int sensor = 0;

void setup() {
  // Initializing the serial communication at 9600 bauds  
  Serial.begin(9600);
}

void loop() {
  // Reading the value of the sensor
  // and storing it in a variable called sensorValue
  int sensorValue = analogRead(sensor);
	
  // Transforming the measured value into percentage using map()
  // map(value, fromLow, fromHigh, toLow, toHigh)
  int percentage = map(sensorValue, 0, 1023, 100, 0);

  // Printing the values on the serial monitor
  Serial.print("IR radiation: ");
  Serial.print(percentage);
  Serial.println(" %");

  // Delay in between reads (in milliseconds)
  delay(1000);
}

Activities for students

1. Select different light sources (the Sun, a flame, an incandescent light bulb, an LED light...). Are they a source of infrared radiation? Compare the amount of IR radiation that they emit.

2. Aim the sensor to an area that doesn't receive direct sunlight, and read the value measured by the sensor. Now, without changing the position of the sensor, put a reflecting material (for example, a surface covered in aluminum foil) that reflects the sunlight into the sensor. Compare the values measured in both situations.

3. What materials are transparent to infrared radiation? What materials block this radiation? Try with cardboard, glass, plastic, etc.