# Flame sensor module is always on or always off: set the trimmer and check the sunlight

> Tune a flame sensor: use the trimmer to set the trip point, shield it from sunlight and room lights and read the analog output if there is one.

Canonical: https://roboticsengineering.in/fix/flame-sensor-module-always-high-or-low-adjust-trimmer/ | Published: 2026-11-03 | Updated: 2026-11-04

**Set the trip point with the trimmer, away from strong light.**

## What the message means

The sensor responds to infrared light, and sunlight and bulbs also give it. The trimmer sets the comparator level.

## Fix it in this order

1. Test indoors in dim light first.
2. Turn the trimmer until the output changes at your wanted level.
3. Read the analog pin for a better range if the module has one.
4. Shield the sensor from direct sun and lamps.
5. Test with a small safe source such as a lighter at a safe distance.
6. Do not rely on it as a fire alarm.

## Why it happens

A flame sensor module uses an infrared receiver and a comparator. The small trimmer sets the switching threshold, so a wrongly set trimmer leaves the digital output always high or always low. Sunlight and other infrared sources can also trigger it.

Turn the trimmer slowly while watching the output LED until it changes state near your flame distance. Keep the sensor out of direct sunlight, and read the analog pin if you need a graded value.

## If you see this, do this

| You see | Do this |
| --- | --- |
| Always triggered | Trimmer or ambient light. |
| Never triggers | Trimmer too far or wrong wiring. |

## Related

[IR sensor always on](https://roboticsengineering.in/fix/ir-obstacle-sensor-always-detects-or-never/), [analog reading](https://roboticsengineering.in/fix/ldr-analog-readings-voltage-divider/).

Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.

## Why this happens

A flame sensor module has an infrared-sensitive photodiode or phototransistor and a comparator, usually an LM393. The analogue output follows the infrared level. The digital output goes through the comparator, which flips when the signal crosses a level set by the trimmer. Flames emit infrared, but so do sunlight, halogen lamps and heaters, so a module in a bright room can sit permanently on one side of the threshold.

If the trimmer is set at an extreme, the output never changes. Many modules also work active-low, with the LED lit and the output at 0 V when a flame is seen, so check the behaviour of yours before concluding it is stuck.

## How to confirm the cause

- Print both the analogue and digital pins and watch them while you cover and uncover the sensor.
- Test in a dim room away from windows to see a baseline.
- Turn the trimmer slowly and note the readings at which the digital pin flips.
- Hold a small flame, such as a candle or lighter, at arm’s length on a safe surface, and see whether the analogue value changes.

## Worked example

Print both outputs and note the values in each situation: dark room, normal light and near a flame. The direction of the analogue change varies, so record it for your module.

```
const int DO_PIN = 2;
const int AO_PIN = A0;

void setup() { Serial.begin(115200); }

void loop() {
  int a = analogRead(AO_PIN);
  int d = digitalRead(DO_PIN);
  Serial.print(a); Serial.print(' '); Serial.println(d);
  delay(200);
}
```

## Common mistakes

- Adjusting the trimmer in direct sunlight.
- Assuming high means flame on every module.
- Using the module as a fire alarm.
- Forgetting the trimmer is a multi-turn type that stops with no click at the end.

## If this did not fix it

- Check wiring of VCC, GND, and the right output pin.
- Check the sensor angle; it sees a cone in front, not behind.
- Check other infrared sources near the sensor.
- Check for a damaged sensor if the analogue value never changes.
