I have connected the Flame Sensor with the Raspberry Pi,
This is my connections,
Flame Sensor has 3pins, VCC, Ground and D0 (Digital Output).
VCC is connected to 5 volts (the range is 3.3Volts to 5volts) GND is connected to the Ground. and D0 is connected to the GPIO4.
A resistor is connected between the signal pin and the ground.
The output is either 1 or a 0.
Here is my code for the sensor Flame detection,
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(7,GPIO.IN) input = GPIO.input(7) while True: if (GPIO.input(7)): print("Flame Detected") else: print("Not Detected")
I want to know if I write the code correctly ? Because, even if I put the Flame sensor close to the Flame it still gives the output as "Not Detected".
It is the link for the Sensor Datasheet, http://www.fut-electronics.com/wp-content/plugins/fe_downloads/Uploads/Flame-sensor-arduino.pdf