A flame sensor is a module used to detect the presence of fire or flames. It typically consists of an infrared (IR) sensor that detects the IR radiation emitted by flames. When flames are detected, the sensor outputs a digital signal to indicate the presence of fire.
To interface a flame sensor with an Arduino, you’ll need to connect the sensor module to the Arduino board. The flame sensor typically has three pins: VCC (power), GND (ground), and OUT (signal). Here’s how you can connect it:
Code
define FLAME_PIN 2
void setup() {
Serial.begin(9600);
pinMode(FLAME_PIN, INPUT);
}
void loop() {
int flameValue = digitalRead(FLAME_PIN);
if (flameValue == HIGH) {
Serial.println(“Flame detected!”);
} else {
Serial.println(“No flame detected”);
}
delay(1000);
}