Flame Detection Sensor

Flame Detection Sensor

Introduction

This experiment uses a flame detection sensor to detect the presence of fire or flame. It is often used in safety and alarm systems.

Flame Detection Sensor

Components Needed

Circuit Setup

  1. Connect the VCC pin of the flame sensor to the 5V pin on the Arduino.
  2. Connect the GND pin of the sensor to the GND pin on the Arduino.
  3. Connect the OUT pin of the sensor to a digital input pin (e.g., pin 2) on the Arduino.

Ensure all connections are correctly made and that the sensor is facing an appropriate light source.

Flame Sensor Circuit Setup

Code for Flame Detection

Upload the following code to your Arduino to detect the presence of flame:


const int flamePin = 2; // Pin connected to the flame sensor
void setup() {
  pinMode(flamePin, INPUT);
  Serial.begin(9600); // Start serial communication
}

void loop() {
  int flameState = digitalRead(flamePin); // Read the sensor
  if (flameState == HIGH) {
    Serial.println("Flame detected!");
  } else {
    Serial.println("No flame detected.");
  }
  delay(1000);
}
            

Explanation

The flame sensor detects light in the infrared range and outputs a HIGH signal when a flame is detected. The Arduino reads this signal and prints the result to the serial monitor.

Troubleshooting