当前位置:网站首页>Flame sensor connected with Arduino
Flame sensor connected with Arduino
2022-08-02 04:51:00 【WENJIE Technology】
Flame sensor with Arduino 连接
前言
The damage caused by fire is devastating.To prevent personal injury or damage,It is necessary to detect fire,in order to provide a warning,An automatic fire extinguishing system can even be activated.There are several ways to detect fires,Such as detecting temperature changes、detect smoke etc..在所有这些方法中,Detecting temperature changes will be more accurate,Because some fires don't even have detectable smoke.Even temperature measurements are less reliable,Because sometimes it's too late to detect changes.为了克服这个问题,We can detect thermal radiation instead of temperature changes.The easiest and cheapest way to detect thermal radiation is to use a flame sensor.在本教程中,We'll see how to integrate the flame sensor module with Arduino 连接.
Flame sensor module pins
Common to flame sensor modules 4 个引脚.Two power pins and two signal pins.The pinout of the flame sensor module is as follows:
VCC==》为模块提供电源,连接到Arduino的5V引脚.
GND==》Ground is connected to Arduino 的接地引脚.
DO==》数字输出引脚.
AO==》Analog output pin.
Composed of flame sensor module
The flame sensor module has very few components,其中包括一个 IR 光电二极管、一个 LM393 比较器 IC and some free passive components.Power when the module is powered up LED 亮,When a flame is detected D0 LED 熄灭.Sensitivity can be adjusted with on-board trimmer resistors.
Frequently Asked Questions about Flame Sensors
How a flame sensor works?
Flame sensors work based on infrared radiation.An infrared photodiode will detect infrared radiation from any hot body.This value is then compared with the set value.Once the radiation reaches the threshold,The sensor will change its output accordingly.
What does the flame sensor detect?
This type of flame sensor detects infrared radiation.
Where is the flame sensor used?
Flame sensors are used anywhere a fire can occur.尤其是在工业领域.
Flame sensor module circuit diagram
A schematic diagram of the flame sensor module is shown below.如前所述,该板的组件数量非常少.The main components are the infrared photodiode and comparator circuit.
How the flame sensor module works?
The job of the flame sensor module is simple.The theory behind it is that hot objects emit infrared radiation.For flame or fire,This radiation will be very high.We will use an infrared photodiode to detect this infrared radiation.The conductivity of the photodiode will vary depending on the infrared radiation it detects.我们使用 LM393 to compare this radiation,当达到阈值时,The digital output will change.We can also use the analog output to measure infrared radiation intensity.The analog output is taken directly from the terminals of the photodiode.板载 D0 LED The presence of a fire will be displayed when detected.The sensitivity can be changed by adjusting the variable resistor on the board.This can be used to eliminate false triggers.
ArduinoFlame sensor interface circuit diagram
Now we fully understand how the flame sensor works,我们可以将所有必需的电线连接到 Arduino 并编写代码以从传感器中获取所有数据.The figure below shows the flame sensor module with the Arduino 连接的电路图.连接非常简单,只需要三根线.将模块的 VCC 和 GND 连接到 Arduino 的 5V 和 GND 引脚.然后将 D0 引脚连接到 Arduino 的数字引脚 2.We will monitor the state of this pin to detect fire.
Arduino Flame sensor code
The code to connect the flame sensor is very simple and easy to understand.我们只需要定义传感器与 Arduino 连接的引脚.完成此操作后,We will monitor the state of this pin.
void setup()
{
pinMode(2, INPUT);
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600);
}
在设置函数中,We will digital pins 2 初始化为输入.This pin is used to monitor the flame sensor output.接下来,We will connect the built-in LED 的引脚 13 初始化为输出.We will use this built-in LED as a status indicator.然后我们以 9600 The baud rate to initialize the serial port.
void loop()
{
if (digitalRead(2) == 1 )
{
digitalWrite(LED_BUILTIN, HIGH); // Led ON
Serial.println("** Warning!!!! Fire detected!!! **");
}
else
{
digitalWrite(LED_BUILTIN, LOW); // Led OFF
Serial.println("No Fire detected");
}
delay(100);
}
在Loop功能中,We will monitor the digital pins 2 的状态.When this pin is pulled low or high by the flame sensor,We will change the state LED 的状态,and print a warning message to the serial monitor.
下面的 GIF Displays the flame sensor interface in action.
边栏推荐
猜你喜欢
随机推荐
path 修补文件命令
Modify hosts file using batch script
【plang1.4.3】语言新特性:集合
Type c PD 电路设计
进程(番外):自定义shell命令行解释器
【Arduino连接时钟模块在LCD1602上显示时间】
2020 - AAAI - 图像修复 Image Inpainting论文导读 -《Region Normalization for Image Inpainting》
[Arduino connected to GP2Y1014AU0F dust sensor]
bluez5.50+pulseaudio实现蓝牙音响音频播放
“520” 如何正确地用代码向 ta 表白?
如何使用 PHP 实现网页交互
振芯科技GM8285C:功能TTL转LVDS芯片简介
MQ-5 可燃气体传感器与 Arduino 接口
Personal image bed construction based on Alibaba Cloud OSS+PicGo
Anaconda(Jupyter)里发现不能识别自己的GPU该怎么办?
基础IO(下):软硬链接和动静态库
关于IIC SDA毛刺的那些事
读取FBX文件踩坑清单
单火线开关设计详解
判断子序列 —— LeetCode-392