Arduino(2): Flame Sensing Module KY-23

The building where I live has several times triggered fire alarms due to old wiring, usually using smoke sensors to trigger the alarm. The other type is to detect flames. This type of sensor is used for short-distance fire detection. It can also be used as a safety precaution to turn on or off equipment, such as automatic sprinklers. Among the common sensors, there is a module that can detect flames. In this implementation, we will understand how this sensor module works.


[Flame Sensing Module]

Sensing module features: 
  • It can detect flames or light sources with wavelengths ranging from 760 nm (nano, 10 minus 9 powers) to 1100 nm. The lighter test flame distance is 80 cm. When the flame is larger, the test distance is farther.
  • The detection angle is about 60 degrees, which is especially sensitive to the flame spectrum.
  • Adjustable sensitivity (blue digital potentiometer adjustment in the figure)
  • Working voltage 3.3V-5V
  • Output form: DO digital switch output (0 and 1) and AO analog voltage output
  • Use wide voltage LM393 comparator


Module usage precautions:
  • The flame sensor is most sensitive to the flame and also responds to ordinary light. It is generally used for flame alarms and other purposes.
  • The sensor should be kept at a certain distance from the flame to prevent the sensor from being damaged by high temperature. The flame distance of the lighter is about 80 cm. When the flame is larger, the test distance is farther.

Pin definition:
  • GND: Ground wire
  • VCC: Power supply range 3~24V
  • DO: Digital output: When the temperature reaches a certain threshold, the output high and low signals can be adjusted through the potentiometer.
  • AO: Analog output: The instantaneous output voltage signal on the thermistor.

[material]

  • Arduino Uno x 1
  • Flame sensing module x 1
  •  Breadboard x 1
  • LED x 1
  • 220K resistance x 1
  • Buzzer x 1
  • Connection line x 7



[Wiring and circuit diagram]

Arduino
KY-23
5V (VCC)
VCC
GND
GND
A0
A0


[Code]

#include <SoftwareSerial.h>
// Read Max & Min
const int sensorMin = 0;     
const int sensorMax = 1024;  
int sensorPin = A0; // select the input pin for the LDR
int led = 9;     // LED 
int buzzer = 12;  
int sensorValue = 0; 

void setup() {

  Serial.begin(9600);
  
  pinMode(led, OUTPUT);
  pinMode(buzzer,OUTPUT);
  
}
void loop() {

  sensorValue = analogRead(A0);

  int range = map(sensorValue, sensorMin, sensorMax, 0, 3);
  

  switch (range) {
  case 0:   
    Serial.println("** Close Fire **");
    Serial.println("Fire Detected");
    Serial.println("LED on");
    digitalWrite(led,HIGH);
    digitalWrite(buzzer,HIGH);
    delay(2000);
    break;
  case 1:   
    Serial.println("** Distant Fire **");
    break;
  case 2:   
    Serial.println("No Fire");
    break;
  }

  digitalWrite(led,LOW);
  digitalWrite(buzzer,LOW);
  delay(sensorValue);

  delay(1);
}

[Results]



[Reference]

• Arduino Projecthub:Flame Sensor  
• Instructables: Fire Detection Using Arduino and Flame Sensor

Post a Comment

Previous Post Next Post