fbpx

Most orders for IN STOCK items placed by 12PM CST M-F ship SAME DAY. Orders for custom items and prints may take additional time to process.

Sensor Wiki: KY-026 Flame IR Sensor

This wiki article covers the KY-026 flame IR sensor. Included are wiring diagrams, code examples, pinouts, and technical data. This sensor is designed for use in reliably detecting open flames using an Arduino or Raspberry Pi.

Content

  •  Sensor/Module Image Gallery
  •  Description and Technical Data
  •  Device Pinout
  •  Projects that use this Sensor/Module
  • Code Examples
    • Code example for Arduino
    • Code example for Raspberry Pi

 Description and Technical Data

The KY-026 flame IR sensor is packed with a photo diode that is sensitive to the spectral range of light that is created by an open flame.  The flame sensor detects wavelengths ranging from 760nm to 1100nm in the infrared spectrum. After detecting a flame, the digital out (DO) line will become HIGH.  The analog out (AO) will provide a direct measurement of the reading.

It is not recommend that this device contacts a flame, as the plastic is likely to melt, or combust.  Flame sensor should be kept at a reasonable distance from the source flame.

Tech Specs for the KY-012 Flame Sensor:

  • Chip: LM393 comparator
  • Min/Max Operating Voltage: +3.3V to +5V
  • Maximum Current: 15mA
  • Ultraviolet Detection Range: 760nm to 1100nm
  • Detection Angle: ~60 degrees
  • Potentiometer adjusts sensitivity
  • LED lights indicators:
    • Red Power LED indicator
    • Green Trigger LED indicator
  • Dimensions: 1.26in X 0.55in (32mm  X 14mm)

 Device Pinout & Schematics

This module has four pins: GND, Vcc+, Analog Out (AO), and Digital Out (DO).  The pinout is as follows:

The KY-026 flame IR sensor schematic is as follows:

 Our Projects that Use this Sensor

We do not currently have any Geek Pub projects that use the flame sensor. We will be creating one soon though so check back!

 Code Examples

You’ll find below code examples of using the KY-026 flame IR sensor with both Arduino and Raspberry Pi (Python).

KY-026 Flame IR Sensor Code Example for Arduino

The following code example is for the Arduino. This code will read the Analog Output Sensor value and write it to the serial console, pause 500ms and repeat.

Arduino Wiring:

  • KY-026 Sensor GND to Arduino GND
  • KY-026 Sensor AO to Arduino PIN A0
  • KY-026 Sensor Vcc+ to Arduino +5V
  • KY-026 Sensor D0 to No Connection
int GPFlameAnalogPIN = A0; // define analog pin
  
void setup ()
{
  pinMode (GPFlameAnalogPIN, INPUT); //define pin as input
       
  Serial.begin (9600); // start the serial console
}
  
void loop ()
{
  float GPAnalog;
    
  //Current values will be read and converted to voltage
  GPAnalog = analogRead (GPFlameAnalogPIN) * (5.0 / 1023.0); 
    
  Serial.print ("Flame Sensor value:"); 
  Serial.println (GPAnalog, 4);  
  
  delay (500);
}  

KY-026 Flame IR Sensor Code Example for Raspberry Pi

The following code example is for the Raspberry Pi using the Python programming language. This code will read the Analog Output Sensor value and write it to the terminal window, pause 500ms and repeat.

Raspberry Pi Wiring:

  • KY-026 Sensor GND to Raspbery Pi GND
  • KY-026 Sensor AO to Raspberry Pi PIN A0
  • KY-026 Sensor Vcc+ to Raspberry Pi PIN 1
  • KY-026 Sensor D0 to No Connection
#######################
# Import the needed modules
from Adafruit_ADS1x15 import ADS1x15    # KY-026 library
from time import sleep                  # sleep library
import math, signal, sys, os            # system libraries
import RPi.GPIO as GPIO                 # GPIO libraries


# initialize the GPIO pins
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
 
# initialise ADC (ADS1115)

GPadc = ADS1x15(ic=0x01)
 
# Input pin for the digital signal will be picked here
Digital_PIN = 24
GPIO.setup(Digital_PIN, GPIO.IN, pull_up_down = GPIO.PUD_OFF)
  
 
    while True:
        #Current values will be recorded
        GPanalog = GPadc.readADCSingleEnded(0, 4096, 64)
        print ("Analog voltage value: " + analog + "\n")
        sleep(500)
    

We hope this wiki article has been helpful to you. Please leave a comment below if you have any questions or comments, as we try to keep these articles constantly up to date.

 Back to List of Arduino Sensors and Modules

Upgrade to Premium

If you like our content maybe consider upgrading to Premium. You’ll get access to

  • Free access to all plans
  • Member only videos
  • Early access to content
  • Ad free Experience
  • Discounts on store merch
  • Direct hotline contact form

One Response

Leave a Reply