Objective
This experiment demonstrates how to detect flame using a flame sensor, which can be used for fire detection and safety systems.
Required Components
- Flame Sensor
- Arduino Board (e.g., Arduino Uno)
- Jumper wires
- Breadboard
- Arduino IDE (for programming)
Working Principle
The flame sensor detects infrared radiation from a flame or fire. When exposed to a flame, the sensor detects changes in the IR spectrum and sends an output to the microcontroller.
Circuit Diagram
Follow these steps to wire the flame sensor:
- Connect the VCC pin of the sensor to the 5V pin on the Arduino.
- Connect the GND pin of the sensor to the GND pin on the Arduino.
- Connect the signal pin of the sensor to digital pin 2 on the Arduino.
Arduino Code
/*
* Flame Detection using Flame Sensor
* This code detects the presence of a flame and outputs the result to the serial monitor.
*/
const int flamePin = 2; // Flame sensor connected to digital pin 2
int flameState = 0;
void setup() {
Serial.begin(9600); // Initialize serial communication
pinMode(flamePin, INPUT); // Set the flame sensor pin as input
}
void loop() {
// Read the flame sensor
flameState = digitalRead(flamePin);
// If the flame is detected
if (flameState == HIGH) {
Serial.println("Flame Detected!");
} else {
Serial.println("No Flame.");
}
delay(500); // Wait for 0.5 seconds
}
Results
The serial monitor will display "Flame Detected!" when the sensor detects a flame and "No Flame" when it doesn't.
Applications
- Fire safety systems
- Flame detection in industrial areas
- Robotics for fire fighting applications
Conclusion
The flame sensor is an essential tool for detecting fires, with applications in fire safety, industrial safety, and robotics for fire fighting.