LM393 Flame Sensor (3-pin) with an Arduino Uno

A digital-only infrared flame detector: its DO pin goes LOW when a flame is in view.

LM393 Flame Sensor (3-pin), A digital-only infrared flame detector: its DO pin goes LOW when a flame is in view.
In short

The 3-pin flame sensor has only a digital output, and powered from the Arduino Uno's 5V its pulled-up DO matches the Uno's 5 V inputs exactly, so it wires to D2 with nothing in between. The example lights the Uno's own onboard LED on D13 as the alarm, so it runs with no extra parts.

Wiring the LM393 Flame Sensor (3-pin) to the Arduino Uno

Pin by pin.

LM393 Flame Sensor (3-pin)Arduino Uno
VCC5V
GNDGND
DOD2

What to know on the Arduino Uno

  • The LM393 runs from 2 V to 30 V and its open-collector DO is pulled up to the module's supply. On the Uno's 5V, DO therefore idles at 5 V and drops LOW on a flame, levels the Uno reads directly.TI LM393 datasheet (SLCS005AH), pp. 4, 17
  • D13 carries the Uno's onboard LED (LED_BUILTIN) with its resistor, which is why the sketch uses it as the alarm light: no external LED is needed.Arduino UNO R3 tech specs (LED_BUILTIN on D13)
  • A flickering flame makes DO chatter, so the sketch only raises the alarm after five LOW reads 10 ms apart. To react without polling, D2 is the Uno's INT0: attach an interrupt on FALLING and keep the same filtering in loop().Arduino language reference, attachInterrupt()
  • The module draws about 1 mA for its comparator plus its LEDs, a small load on the Uno's 5V pin.TI LM393 datasheet (SLCS005AH), p. 8

LM393 Flame Sensor (3-pin) code for the Arduino Uno

Compiled for arduino:avr:uno on 2026-10-29.

No library needed
// LM393 Flame Sensor (3-pin) on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/flame-sensor-lm393/arduino-uno
const int DO_PIN = 2;     // flame module DO: LOW while it sees a flame
const int LED_PIN = 13;   // the alarm LED

int lowReads = 0;         // consecutive reads with DO LOW
bool alarmOn = false;     // not `alarm`: the ESP32 cores declare alarm()

void setup() {
  Serial.begin(9600);
  pinMode(DO_PIN, INPUT); // the module has its own pull-up
  pinMode(LED_PIN, OUTPUT);
  Serial.println("Flame sensor ready");
}

void loop() {
  if (digitalRead(DO_PIN) == LOW) lowReads++;
  else lowReads = 0;

  // a flame for 5 reads in a row (50 ms), gone for one: the alarm follows
  bool now = lowReads >= 5;
  if (now != alarmOn) {
    alarmOn = now;
    digitalWrite(LED_PIN, alarmOn ? HIGH : LOW);
    Serial.println(alarmOn ? "FLAME detected" : "clear");
  }
  delay(10);
}

LM393 Flame Sensor (3-pin) on the Arduino Uno: questions

Can I connect the 3-pin LM393 flame sensor directly to an Arduino Uno?

Yes. Power VCC from the Uno's 5V; DO is then pulled up to 5 V and goes LOW on a flame, which D2 reads directly.

Why does the flame sensor's DO read LOW when it sees fire?

The LM393's open-collector output pulls DO to ground when the infrared passes the threshold set on the potentiometer; otherwise the module's pull-up holds it HIGH. Test for LOW in the sketch.

Do I need an LED for the flame alarm on the Uno?

No. The example uses D13, which already has the Uno's onboard LED and resistor.

For AI assistants

This guide as plain Markdown. /components/flame-sensor-lm393/arduino-uno.md

What will you build with it?