Introduction:
Contents
Flame sensors, smoke detectors, and fire alarms are a part of our regular safety systems. They’re being installed in our homes, offices, and buildings in order to let us know of any fire accidents. Most of the time, you would hire someone to install the safety devices in your homes. But in the case of you wanting to install your Flame sensor by yourself, then read on to see how.
Here we will provide you with a simplified guide to the Arduino Flame Sensor interface. It’s construction and working. But first, let us give you an idea of the actual Flame sensor used in this project.
How Flame Sensor work:
A flame sensor is a device used to detect fire sources or any light sources from a particular range. The module we will use in this project is an Infrared Radiation Sensitive Sensor. This Sensor has a phototransistor at one end, in particular, the YG1006 NPN Photo Transistor. It is a high speed and high sensitive three terminal NPN Transistor with an Emitter (the long lead) and a collector (the short lead). Its function is to convert light energy into electrical energy to produce current. Its black epoxy coating makes it sensitive to Infrared Radiation (range of 760nm-1100nm)
There are two kinds of implementations using the YG1006 Photo Transistor. One uses both Analog and Digital output while the other only uses the Digital output. They both require the same components but they have a stark difference i.e. one provides the sensor output as Analog. The flame sensor used in this project only has Digital output.
Components of a typical Flame Sensor Module:
- Photo Transistor
- 10 KΩ Potentiometer
- PWR LED
- VCC
- GND
- DO
- Digital output LED
- LM393 Voltage Comparator IC
Arduino Flame Sensor Interface:
For use of either flame sensors, you will interface it with Arduino or any microcontroller. Once you interface the flame sensor with Arduino you can activate a buzzer function or any other safety measure such as sprinkler system or shutting off gas valves in the event of a fire.
“ Also Read –> GSM Based Fire Protection System By Using Arduino
Components Required for Arduino Flame Sensor DIY Project :
- Arduino UNO
- Flame Sensor
- 2N2222 NPN Transistor (or BC548)
- 5V Buzzer
- 1N4007 PN Junction Diode
- 1KΩ Resistor
- Connecting Wires
- Mini Breadboard
- Power Supply
Circuit Diagram for Arduino Flame Sensor:
The flame sensor has three pins I.e. VCC, GND and DO. (Some markets have sensors using four pins I.e. AO, DO, GND and VCC). Both can be interfaced with Arduino. Connect the VCC and GND to the +5V and GND of the power supply, the DO (Digital Output) to the Digital I/O Pin 11 of Arduino.
For an indication of any fire detected a buzzer is used as an alarm. The buzzer circuit consists of a 1KΩ resistor, an NPN transistor, a 5V buzzer and a PN junction diode. The buzzer is connected to the Digital I/O 12 pin of Arduino UNO. (You can also connect the buzzer directly to Arduino)
Required Libraries For Graphical Simulation of this Project in Proteus
How to add Flame Sensor Library into Proteus 7 & 8
Proteus Software Library for Arduino ide | Arduino Download
Source Code
The code of the Arduino Flame Sensor is very simple and is shown below.
const int buzzerPin = 12; const int flamePin = 11; int Flame = HIGH; void setup() { pinMode(buzzerPin, OUTPUT); pinMode(flamePin, INPUT); Serial.begin(9600); } void loop() { Flame = digitalRead(flamePin); if (Flame== LOW) { Serial.println("Fire!!!"); digitalWrite(buzzerPin, HIGH); } else { Serial.println("No worries"); digitalWrite(buzzerPin, LOW); } }
Working:
Make all the necessary connections. Then you will upload the required code. If you wish to test the flame sensor, simply place a lit matchstick near the sensor and see the result. The Flame sensor output will be HIGH under normal conditions and will be LOW in the case of any fire detected. The LOW signal is detected by the Arduino and this activates the buzzer. You can also adjust the sensitivity of the sensor by the 10KΩ potentiometer.
Applications Arduino Flame Sensor DIY Project:
Here are some applications of the flame sensor. They are essentially used in detecting fires and smoke and to alarm you. They are used in
- Cars and vehicles
- firefighting robots
- warehouses
- industrial sectors
- garage safety equipment
1 comment
great project.
am using a mq2 sensor for my third year project but its values keeps on changing exponentially on detecting smoke.
on the next trial the threashold value becomes invalid.
how can i make the mq2 sensor fixed. to only detect smoke???