Flame Sensor
The infrared flame sensor is used to detect fire sources or other thermal sources with wavelengths between 700 nm and 1000 nm. In robotic competitions, the infrared flame sensor plays a crucial role, acting as the robot’s "eyes" to locate fire sources or objects, such as soccer balls. This sensor can be used to create fire-fighting robots and other similar applications.
The infrared flame sensor detects infrared light in the range of 700 nm to 1000 nm, with the highest sensitivity around 880 nm. The detection angle is 60°. It converts the variation in the strength of external infrared light into a change in current, which is reflected as a value ranging from 0 to 4095 via an A/D converter. The stronger the infrared light, the smaller the value; the weaker the infrared light, the larger the value.
Module Source
Purchase Link: https://item.taobao.com/item.htm?spm=a21n57.1.0.0.4c52523cd1r9Zc&id=35124127482&ns=1&abbucket=0&skuId=4634892497712
Baidu Netdisk Download Link: https://pan.baidu.com/s/14rzP9Gx7AjbmRSqD_A5Pyw
Password: risv
Specifications
Operating Voltage: 3.3V-5V
Detection Distance: 1 meter
Output Methods:
DO (Digital Output)
AO (Analog Output)
Reading Methods: ADC (Analog-to-Digital Conversion) and Digital (0 and 1)
Pin Count: 4 Pins (2.54mm pitch header)
Hardware Connection
- Connect the Vcc pin of the sensor to the 5V power supply of the development board.
- Connect the GND pin of the sensor to the GND of the development board.
- Connect the AO (Analog Output) pin to the A0 analog input pin of the development board.
- Connect the DO (Digital Output) pin to the digital pin 8 of the development board.
Usage Method
/******************************************************************************
* Test Hardware: LCSC ColorEasyDuino Development Board
* Version Number: V1.0
* Modified By: www.lckfb.com
* Modification Date: April 8, 2024
* Function Overview:
*****************************************************************************
* Open-source development board hardware and software information and related projects hardware and software information on official website
* Development board official website: www.lckfb.com
* Technical support resident forum, any technical problems are welcome at any time to exchange learning
* LCSC Forum: club.szlcsc.com
* Follow our Bilibili account: [立创开发板], stay toned to our latest news!
* We focus on cultivating Chinese engineers rather than profiting from board sales.
******************************************************************************/
int Flam_AO_Pin = A0; // 定义火焰传感器的AO连接到开发板的A0引脚
int Flam_DO_Pin = 8; // 定义火焰传感器的DO连接到开发板的8号引脚
int FlamValue = 0; // 用于存储火焰值的变量
#define ADC_MAX_VALUE 1023 //ADC的最大采集值
void setup() {
Serial.begin(9600); // 开始串行通讯,设置波特率为9600
pinMode(Flam_DO_Pin, INPUT_PULLUP);
}
void loop() {
// 读取状态
int FlamState = digitalRead(Flam_DO_Pin);
if (FlamState == LOW) {
Serial.println("检测到火焰");
} else {
Serial.println("未检测到火焰");
}
FlamValue = analogRead(Flam_AO_Pin); // 读取A0引脚的电压值
Serial.print("火焰值: ");
Serial.println( FlamValue); // 将读取的值发送到电脑的串行监视器
delay(1000); // 延时1秒
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38