Flame Sensor Reference
An infrared flame sensor that detects light in the wavelength range emitted by fire, with both analog and threshold digital outputs.
Pin names
| Name | Description |
|---|---|
| VCC | Power (5V) |
| GND | Ground |
| DOUT | Digital Out — HIGH/LOW based on a threshold (adjustable via onboard trimmer on real hardware) |
| AOUT | Analog Out — voltage proportional to detected flame intensity |
Attributes
This component has no configurable attributes.
Usage
Connect VCC to 5V, GND to GND, and either AOUT to an analog input pin for a continuous reading, or DOUT to a digital input pin for a simple flame alarm.
const int FLAME_ANALOG_PIN = A0;
const int FLAME_DIGITAL_PIN = 2;
void setup() {
pinMode(FLAME_DIGITAL_PIN, INPUT);
Serial.begin(9600);
}
void loop() {
int intensity = analogRead(FLAME_ANALOG_PIN);
bool flameDetected = digitalRead(FLAME_DIGITAL_PIN) == LOW; // active LOW on most modules
Serial.print("Intensity: "); Serial.print(intensity);
Serial.print(" Flame: "); Serial.println(flameDetected ? "YES" : "no");
delay(300);
}
Examples
| Description | Attrs |
|---|---|
| Default flame sensor | {} |
See also
- Gas Sensor — same analog/digital pin pattern for gas/smoke detection
- PIR Motion Sensor — another simple hazard/presence digital sensor