How to use the Infrared Flame Sensor with Arduino
How to use the Infrared Flame Sensor with Arduino
INTRODUCTION
The IR (Infrared) flame detector/sensor is a device designed to detect and respond to the presence of a flame or fire.
APPLICATIONS
Can be used as a safety device to detect a flame and sounding an alarm, deactivating a fuel line (such as a propane or a natural gas line), and activating a fire suppression system.
WIRING DIAGRAM
VCC – 5V
D0 – Digital Pin 2
GND - GND
CODE
int SensorPin = 2; void setup() { // set SensorPin as INPUT: Serial.begin(9600); pinMode(SensorPin, INPUT); } void loop() { // default mode for the sensor pin is HIGH. Here we are telling it // to do the opposite and print “fire detected” when sensor receives input // from a fire source: int buttonstate = digitalRead(SensorPin); if (buttonstate == LOW){ Serial.println("fire detected");} if (buttonstate == HIGH){ Serial.println("no fire detected");} delay(50); }
END RESULT
Find a lighter or a light source and test out the sensor with the serial monitor.
ADDITIONAL RESOURCES
https://create.arduino.cc/projecthub/SURYATEJA/arduino-modules-flame-sensor-6322fb
https://www.instructables.com/id/Arduino-Modules-Flame-Sensor/