lcd.setCursor(0, 1);
lcd.print("No Fire Detected");
digitalWrite(redLED, HIGH);
}
delay(2500);
}
This is my code and ive added an image of the sensor im using. i have connected the DO pin to D5 and the vcc pin to 5v. there seems to be twisting screw on the top of the blue part of the sensor, im not sure if it affects anything. im using a remote controller to test the sensor (something i saw in a video) because i cant use a fire close to the sensor, but even then my bic lighter doesnt seem to register.
How can i test the sensitivity if I'm using a digital pin? Also is the remote controller method correct or will it not work?
i hope you will pardon my lack of knowledge i havent worked on such a sensor before.
Your program prints out the value read from the digital pin. Remove this line, delay(2500);
or replace the delay with a smaller value, and while watching the LCD, turn the screw until the flame is detected.
I would try first seeing in the Serial monitor what you're getting, if anything.
so add
Serial.begin(9600);
to setup(), and
Serial.println("No Fire Detected");
where the similar lcd.print line is, similarly
Serial.println("Fire Alarm");
also where appropriate for you.
Lastly, just like there's an adjustment screw on that sensor, on the back of the LCD there is likely a small potentiometer to adjust the contrast. Sometimes they are set poorly from the factory, at least I know it's happened to me.
Ok so i have tried your method, i put the delay on the true statement. the issue now is that is instead of saying "fire alarm" the lcd says "fire alarmdetected" how do i fix this?
Just print the digital output on the serial monitor as 1s and 0s, and watch that while adjusting the screw, with flame present or flame not present. You should find a setting that reliably detects flame.
"Flame detected" could correspond to either be a 1 or a 0, depending on how the sensor is designed.