Interfacing Flame Sensor with Arduino to Build a Fire Alarm System
In this project we interface Flame Sensor withArduino and learn all the steps to build Fire Alarm System by using Arduino and flame sensor. Flame sensor module has photodiode to detect the light and op-amp to control the sensitivity. It is used to detect fire and provide HIGH signal upon the detection. Arduino reads the signal and provides alert by turning on buzzer and LED. Flame sensor used here is an IR based flame sensor.
A flame detector is a sensor designed to detect and respond to the presence of a flame or fire. Responses to a detected flame depend on the installation, but can include sounding an alarm, deactivating a fuel line (such as a propane or a natural gas line), and activating a fire suppression system.
There are different types of flame detection methods. Some of them are: Ultraviolet detector, near IR array detector, infrared (IR) detector, Infrared thermal cameras, UV/IR detector etc.
When fire burns it emits a small amount of Infra-red light, this light will be received by the Photodiode (IR receiver) on the sensor module. Then we use an Op-Amp to check for change in voltage across the IR Receiver, so that if a fire is detected the output pin (DO) will give 0V(LOW) and if the is no fire the output pin will be 5V(HIGH).
In this project we are using an IR based flame sensor. It is based on the YG1006 sensor which is a high speed and high sensitive NPN silicon phototransistor. It can detect infrared light with a wavelength ranging from 700nm to 1000nm and its detection angle is about 60°. Flame sensor module consists of a photodiode (IR receiver), resistor, capacitor, potentiometer, and LM393 comparator in an integrated circuit. The sensitivity can be adjusted by varying the on board potentiometer. Working voltage is between 3.3v and 5v DC, with a digital output. Logic high on the output indicates presence of flame or fire. Logic low on output indicates absence of flame or fire.
Below is the Pin Description of Flame sensor Module:
Vcc 3.3 – 5V power supply
Dout Digital output
Applications of flame sensors
Combustion monitors for burners
Oil and gas pipelines
Automotive manufacturing facilities
Arduino Uno (any Arduino board can be used)
Working of Flame Sensor with Arduino
Arduino Uno is a open source microcontroller board based on ATmega328p microcontroller. It has 14 digital pins (out of which 6 pins can be used as PWM outputs), 6 analog inputs, on board voltage regulators etc. Arduino Uno has 32KB of flash memory, 2KB of SRAM and 1KB of EEPROM. It operates at the clock frequency of 16MHz. Arduino Uno supports Serial, I2C, SPI communication for communicating with other devices. The table below shows the technical specification of Arduino Uno.
The flame sensor detects the presence of fire or flame based on the Infrared (IR) wavelength emitted by the flame. It gives logic 1 as output if flame is detected, otherwise it gives logic 0 as output. Arduino Uno checks the logic level on the output pin of the sensor and performs further tasks such as activating the buzzer and LED, sending an alert message.
The complete Arduino code for this project is given at the end of this article. The code is split into small meaningful chunks and explained below.
In this part of the code we are going to define pins for Flame sensor, LED and buzzer which are connected to Arduino. Flame sensor is connected to digital pin 4 of Arduino. Buzzer is connected to digital pin 8 of Arduino. LED is connected to digital pin 7 of Arduino.
Variable “flame_detected” is used for storing the digital value read out from flame sensor. Based on this value we will detect the presence of flame.
int buzzer = 8 ;
int LED = 7 ;
int flame_sensor = 4 ;
int flame_detected ;
In this part of the code, we are going to set the status of digital pins of Arduino and configure .Baud rate for Serial communication with PC for displaying status of flame detection circuit.