This project introduces how to design a flame detector through a raspberry pi board and flame sensor.
The component parts
|flame sensor x1|
|Analog to digital convertor(ADC) x1|
Within the range of wave length 760-1100 nm,the flame sensor can both output the digital and analog signal. When the flame is detected by sensor,the digital signal would output the high level signal. The output voltage by analog signal is determined by the size of the flame. The bigger the flame size is, the high the voltage output. The sensitivity of the flame sensor can be adjusted by the adjustable potentiometer.
When the distance between lighter and flame sensor is 80cm, the flame can be detected by sensor. The larger the flame is, the farther the detected distance can be. The flame sensor is sensitive to the flame radiation spectrum if the detected angle is 60 degree.
Pay more attention to the anode and cathode, otherwise it would burnout your raspberry pi board and flame sensor. You can connect the GND of flame sensor to OV, VCC to 3.3V. You could visit the article for your referenc if you want to learn more about the raspberry pi IO port. ： How to read Raspberry Pi i/o pin diagram (GPIO pin graph)
You could choose to connect the raspberry pi to monitor, or login in pi via SSH.
1)Compiling the code
enter the following command to create a new file named motionsensor-test.py and save this file at direction: /home/pi, and then press enter
Add new file named flame.py through nano editor (the name is arbitrary)
sudo nano flame.py
Write the sample code in new file, the code can be obtained by executing shell commands.
sudo wget --no-check-certificate http://osoyoo.com/driver/flame.py
2)Execute python program
sudo python ./flame.py
When the programme start, you can open the lighter in front of flame sensor. The green light of flame sensor turns on and the prompt message would show on the monitor. The green lighter is not on if there is no flame. If the green light keep on without flame,you need to correct it via the adjustable potentiometer. The correct information is as follows: