KY-026 Flame Sensor Module

View on Amazon
Overview
About KY-026 Flame Sensor Module
The KY-026 Flame Sensor Module is designed to detect open flames and other light sources emitting wavelengths between 760 nm and 1100 nm. It features both analog and digital outputs: the analog output provides a voltage proportional to the detected flame intensity, while the digital output activates when the flame intensity exceeds a user-defined threshold, adjustable via an onboard potentiometer. This module is ideal for fire detection systems, flame alarms, and firefighting robots.
Get Your KY-026
💡 Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.
KY-026 Specifications
Complete technical specification details for KY-026 Flame Sensor Module
📊 Technical Parameters
KY-026 Pinout
The **KY-026** is a 4-pin flame sensor module with dual outputs:
Visual Pinout Diagram

Pin Types
Quick Tips
**Interface**: Dual output (analog + digital with comparator),🔥 **Sensor**: Infrared phototransistor (760-1100nm wavelength detection),📊 **Analog Output**: Continuous flame intensity measurement
**Digital Output**: Threshold-based fire alarm trigger (adjustable via potentiometer),⚡ **Power**: 3.3V or 5V operation,📏 **Detection Range**: 60-100cm (varies with flame size)
**Detection Angle**: Approximately 60° cone,🎯 **Applications**: Fire detection systems, flame alarms, firefighting robots, safety monitors
Pin Descriptions
| Pin Name | Type | Description | Notes |
|---|---|---|---|
1 GND | Power | Ground connection | |
2 +V | Power | Power supply | 3.3V or 5V |
3 D0 | Communication | Digital output | HIGH when flame intensity exceeds threshold |
4 A0 | Communication | Analog output | Voltage proportional to flame intensity |
Wiring KY-026 to ESP32
To interface the **KY-026** with an **ESP32** for flame detection:
Visual Wiring Diagram

Connection Status
Protocol
Pin Connections
| KY-026 Pin | Connection | ESP32 Pin | Description |
|---|---|---|---|
1 GND Required | GND | Ground | |
2 +V Required | 3.3V or 5V | Power supply | |
3 D0 Optional | GPIO17 | Digital input (any GPIO) | |
4 A0 Optional | GPIO36 | Analog input (ADC pin) |
**Digital Mode**: Use D0 for simple fire alarm (flame detected/not detected)
**Analog Mode**: Use A0 for flame intensity measurement and proximity estimation
**ADC Pins**: Use GPIO32-39 for analog input on ESP32
**Voltage**: 3.3V recommended for ESP32 ADC compatibility
**Adjustment**: Turn onboard potentiometer to set fire detection threshold
**IR Sensitivity**: Detects 760-1100nm wavelength (near-infrared range)
**False Positives**: May respond to sunlight, halogen lamps, or hot objects
**LED Indicators**: Power LED and detection status LED onboard
KY-026 Troubleshooting
Common issues and solutions to help you get your sensor working
Common Issues
Issue: The sensor does not provide any output when exposed to a flame.
Solutions:
- Verify all connections are secure and correctly placed.
- Ensure the module is receiving the appropriate voltage (3.3V or 5V).
- Adjust the potentiometer to set the correct sensitivity threshold.
- Test the sensor with a known flame source to confirm functionality.
Issue: The sensor triggers without the presence of a flame.
Solutions:
- Reduce the sensitivity by adjusting the potentiometer.
- Avoid exposing the sensor to direct sunlight or other strong light sources.
- Ensure there are no reflective surfaces causing stray light to reach the sensor.
Debugging Tips
Use the Serial Monitor to check for error messages and verify the sensor's output. Add debug prints in your code to track the sensor's state.
Use a multimeter to verify voltage levels and check for continuity in your connections. Ensure the power supply is stable and within the sensor's requirements.
Additional Resources
KY-026 Programming Examples
Ready-to-use code examples for different platforms and frameworks
// Declaration and initialization of the input pins
int analog_input = A0; // Analog output of the sensor
int digital_input = 3; // Digital output of the sensor
void setup() {
pinMode(analog_input, INPUT);
pinMode(digital_input, INPUT);
Serial.begin(9600); // Serial output with 9600 bps
Serial.println("KY-026 Flame detection");
}
void loop() {
float analog_value;
int digital_value;
// Current values are read out, converted to the voltage value...
analog_value = analogRead(analog_input) * (5.0 / 1023.0);
digital_value = digitalRead(digital_input);
//... and printed at this point
Serial.print("Analog voltage value: ");
Serial.print(analog_value, 4);
Serial.print(" V, Threshold value: ");
if (digital_value == 1) {
Serial.println("reached");
} else {
Serial.println("not yet reached");
}
Serial.println("----------------------------------------------------------------");
delay(1000);
}This Arduino code reads the analog voltage from the KY-026 sensor's analog output and checks the digital output to determine if the flame intensity has surpassed the set threshold. The results are printed to the serial monitor every second.
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/adc.h"
#include "driver/gpio.h"
#define FLAME_SENSOR_ANALOG_PIN ADC1_CHANNEL_0 // GPIO36
#define FLAME_SENSOR_DIGITAL_PIN GPIO_NUM_17
void app_main(void) {
adc1_config_width(ADC_WIDTH_BIT_12);
adc1_config_channel_atten(FLAME_SENSOR_ANALOG_PIN, ADC_ATTEN_DB_11);
gpio_set_direction(FLAME_SENSOR_DIGITAL_PIN, GPIO_MODE_INPUT);
printf("KY-026 Flame Detection\n");
while (1) {
int analog_value = adc1_get_raw(FLAME_SENSOR_ANALOG_PIN);
int digital_value = gpio_get_level(FLAME_SENSOR_DIGITAL_PIN);
printf("Analog Value: %d, Digital Threshold: %s\n", analog_value, digital_value ? "Flame Detected" : "No Flame");
vTaskDelay(pdMS_TO_TICKS(1000));
}
}This ESP-IDF code reads the analog value from the KY-026 sensor using ADC on GPIO36 and monitors the digital output on GPIO17 to determine if the flame intensity threshold is exceeded. The results are printed every second.
sensor:
- platform: adc
pin: GPIO36
name: "KY-026 Flame Intensity"
update_interval: 1s
binary_sensor:
- platform: gpio
pin:
number: GPIO17
mode: INPUT_PULLUP
name: "KY-026 Flame Detection"This ESPHome configuration reads the KY-026 sensor's analog output on GPIO36 and detects the flame threshold trigger using GPIO17 as a binary sensor. Updates are logged every second.
platformio.ini
[env:esp32]
platform = espressif32
board = esp32dev
framework = arduinomain.cpp
#include <Arduino.h>
#define FLAME_SENSOR_ANALOG_PIN A0
#define FLAME_SENSOR_DIGITAL_PIN 17
void setup() {
pinMode(FLAME_SENSOR_DIGITAL_PIN, INPUT);
Serial.begin(115200);
Serial.println("KY-026 Flame Sensor Test");
}
void loop() {
int analog_value = analogRead(FLAME_SENSOR_ANALOG_PIN);
int digital_value = digitalRead(FLAME_SENSOR_DIGITAL_PIN);
Serial.printf("Analog: %d, Digital: %s\n", analog_value, digital_value ? "Flame Detected" : "No Flame");
delay(1000);
}This PlatformIO code reads the KY-026 sensor's analog output and monitors the digital flame detection trigger. The values are printed every second.
import machine
import time
FLAME_SENSOR_ANALOG_PIN = machine.ADC(machine.Pin(36))
FLAME_SENSOR_ANALOG_PIN.atten(machine.ADC.ATTN_11DB)
FLAME_SENSOR_DIGITAL_PIN = machine.Pin(17, machine.Pin.IN, machine.Pin.PULL_UP)
while True:
analog_value = FLAME_SENSOR_ANALOG_PIN.read()
digital_value = FLAME_SENSOR_DIGITAL_PIN.value()
print("Analog:", analog_value, "Digital:", "Flame Detected" if digital_value else "No Flame")
time.sleep(1)This MicroPython script reads the KY-026 sensor's analog signal using ADC on GPIO36 and monitors the digital output on GPIO17. The readings are printed every second.
Wrapping Up KY-026
The ESP32 KY-026 Flame Sensor Module is a powerful KY-0xx module sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.
Best Practices
For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.
Safety First
Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.
Ready to Start Building?
Now that you have all the information you need, it's time to integrate the KY-026 into your ESP32 project and bring your ideas to life!
Explore Alternative Sensors
Looking for alternatives to the KY-026? Check out these similar sensors that might fit your project needs.

KY-009 RGB Full Color LED SMD Module
The KY-009 is an RGB LED module that allows for the creation of various colors by adjusting the brightness of its red, green, and blue LEDs...

KY-008 Laser Transmitter Module
The KY-008 is a laser transmitter module that emits a red laser beam at 650 nm with an output power of 5 mW. It is suitable for applications...

KY-039 Heartbeat Sensor Module
The KY-039 is a heartbeat sensor module that uses an infrared LED and a phototransistor to detect pulse signals. It provides an analog...





