In this experiment, we will learn how to use the flame sensor module.
This module is sensitive to the flame and radiation. It also can detect ordinary light source in the range of a wavelength 760nm-1100 nm. The detection distance is up to 100 cm. The Flame sensor can output digital or analog signal. It can be used as a flame alarm or in firefighting robots.
A sensor module to detect flames. The spectral sensitivity of the sensor is optimized to detect emissions from naked flames. The output signal ‘DO’ is pulled high (active high) when a flame is detected. The switching threshold is adjustable via a preset pot. An analog output signal from the sensor is available at pin ‘AO’.
• Typical spectral sensitivity: 720-1100 nm
• Typical detection angle: 60°!
Flamesensor module:
Digital and AnalogOutput
You can click the blue text link to download the program file to your local device, and double-click the file to open it after the download is complete. Please note: Before opening the file, ensure that you have installed the Arduino IDE development environment and completed the installation of relevant components such as the board support package and driver corresponding to the board.
int Led=2; //define LED port
int buttonpin=18; //define switch port
int val; //define digital variable val
void setup()
{
pinMode(Led,OUTPUT);//define LED as a output port
pinMode(buttonpin,INPUT);//define switch as a output port
}
void loop(){ val=digitalRead(buttonpin);//read the value of the digital interface 3 assigned to val
if(val==HIGH)//when the switch sensor have signal, LED blink
{
digitalWrite(Led,HIGH);
}
else
{
digitalWrite(Led,LOW);
}
}
This piece of code is relatively simple. The flame sensor works as a switch with only two states: triggered and untriggered. You only need to modify the pin definition according to different types of main control boards.