My flame sensor is failing to detect flame however it is detecting movement???
My flame sensor:
My code:
int led_pin = 22; // Assigns led to digital pin 22
int flame_sensor_pin = 23; // Assigns flame sensor to pin 23
int flame_pin = HIGH; // state of sensor
void setup() {
pinMode (led_pin, OUTPUT); // declaring led pin as ouput
pinMode ( flame_sensor_pin, INPUT); // declaring sensor pin as input for Arduino
Serial.begin (9600); // setting baud rate at 9600
}
void loop() {
flame_pin = digitalRead (flame_sensor_pin); // reading from the sensor and writing it to flame_pin for IF statement
if (flame_pin == LOW) // Telling sensor to print to serial port and activate LED if there is fire.
{
Serial.println ("We're all gonna die!!!!!!!!!!1");
digitalWrite (led_pin , HIGH);
}
else
{
Serial.println (" All is well");
digitalWrite ( led_pin, LOW); // Otherwise keep led off.
}
}