Flame Sensor with Arduino UNO

Introduction
The Flame Sensor is a fire detection sensor designed to detect infrared light emitted by flames. It is commonly used in fire alarm systems, safety monitoring devices, industrial protection systems, and smart home automation projects. The sensor can quickly detect the presence of a flame and provide a digital output signal to the Arduino.
In this tutorial, you will learn how to interface a Flame Sensor with an Arduino UNO, upload the code, and detect the presence of fire using the Serial Monitor. By the end of this guide, you'll understand how to build basic fire detection systems using Arduino.
Components Required
Tools Required
Software Required
| Item Name | Action |
|---|---|
Arduio IDE | Download |
Circuit Diagram
Source Code
const int flameSensorPin = 2;
void setup()
{
pinMode(flameSensorPin, INPUT);
Serial.begin(9600);
}
void loop()
{
int flameState = digitalRead(flameSensorPin);
if(flameState == LOW)
{
Serial.println("Flame Detected");
}
else
{
Serial.println("No Flame");
}
delay(500);
}Step by Step Instructions
Step 1: Connect the Flame Sensor
Make the following connections:
Flame Sensor | Arduino UNO |
|---|---|
VCC | 5V |
GND | GND |
DO | D2 |
Step 2: Open Arduino IDE
Launch Arduino IDE.
Connect Arduino UNO using USB.
Select:
Board → Arduino UNO
Port → Correct COM Port
Step 3: Create a New Sketch
Create a new Arduino sketch and paste the provided code.
Step 4: Verify the Code
Click the Verify button to check for syntax errors.
Step 5: Upload the Code
Click Upload and wait until the upload process completes successfully.
Step 6: Open Serial Monitor
Open Serial Monitor.
Set the baud rate to 9600.
Carefully bring a small flame source (such as a candle) near the sensor.
Observe the detection messages displayed on the Serial Monitor.
The Serial Monitor will continuously display the flame detection status.
Expected Output
When no flame is present:
No Flame
No Flame
No FlameWhen a flame is detected:
Flame Detected
Flame Detected
Flame DetectedConclusion
In this tutorial, you learned how to interface a Flame Sensor with Arduino UNO and detect the presence of fire using digital input. This setup can be used in fire alarm systems, safety monitoring devices, industrial protection systems, and various Arduino projects that require flame detection.









