Every fall, the same question shows up: "My pilot lights, but it goes out the second I let go of the button." This post walks through why that happens, then turns the checks into a tiny Python helper you can adapt. It's written by the HVAC Fitter team.

Gas safety first. Turn the gas control knob and the manual supply valve off before you touch the pilot assembly, and let it cool. If you smell gas, don't flip switches or use a phone indoors. Leave and call your gas company from outside. Never bypass a safety device.

Why the flame dies when you release the button

Holding the pilot button forces the gas port open by hand. While you hold it, the pilot flame heats a sensor. That heat makes a small voltage, and the voltage powers a magnet in the gas valve. When you let go, the magnet is supposed to take over and keep the valve open.

If the flame lights while you hold the button and dies when you let go, the valve isn't getting enough voltage. The usual cause is a weak, dirty or badly placed sensor.

Thermocouple or thermopile?

These are not interchangeable:

  • A thermocouple is a single heat sensor that makes a tiny voltage, often around 30 mV. Its only job is holding the pilot safety magnet open. It usually screws into the valve with a threaded nut.
  • A thermopile (or "pilot generator") is several thermocouples joined together. Many put out roughly 600 to 750 mV, enough to run a millivolt control circuit, like a wall thermostat on a unit with no house power. It often connects with spade terminals.

So the first question is always which one you have. The part number on the old sensor, or the model number on the appliance's rating plate, settles it.

Simple things to check before buying anything

  1. Flame contact. The pilot flame should wrap around the top part of the probe tip. A lazy or misaimed flame won't heat it enough.
  2. Soot or corrosion. Heavy buildup on the probe can block heat.
  3. The connection at the valve. A loose nut or terminal can drop the small voltage.
  4. Tube length and routing. A replacement must reach the valve without stretching or kinking.

Turning it into a helper script

Here's a small, dependency-free script that turns those observations into next steps. It doesn't diagnose anything on its own. It only puts the checks above in order.

"""Pilot-out triage helper: orders the checks for a pilot that won't stay lit. Not a substitute for a licensed technician. Gas off before any inspection.""" def pilot_triage(lights_while_held: bool, dies_on_release: bool, sensor_type: str, # "thermocouple", "thermopile" or "unknown" flame_hits_tip: bool, probe_dirty: bool, valve_connection_tight: bool) -> list[str]: steps = [] if not lights_while_held: steps.append("Pilot won't light at all: this isn't a sensor problem. " "Check gas supply and the pilot orifice, or call a pro.") return steps if not dies_on_release: steps.append("Pilot stays lit: the sensor is likely doing its job. Look elsewhere.") return steps if sensor_type == "unknown": steps.append("Identify the sensor first (part number on the old one, " "or the appliance model number). Thermocouples and " "thermopiles are not interchangeable.") if not flame_hits_tip: steps.append("Re-aim or clean the pilot so the flame wraps the probe tip.") if probe_dirty: steps.append("Clean soot or corrosion off the probe (gas off, cool).") if not valve_connection_tight: steps.append("Snug the connection at the gas valve: a loose fit drops voltage.") fixable = [x for x in steps if not x.startswith("Identify")] if not fixable: steps.append("If everything looks right, the sensor is probably worn. " "Replace it with the same type, connection and equal or longer length.") return steps if __name__ == "__main__": for s in pilot_triage(True, True, "thermocouple", True, False, True): print("-", s) 

Running it with "lights, dies on release, thermocouple, flame on tip, clean, tight" prints one line: the sensor is probably worn, so replace it like for like.

Matching a replacement

When you do replace it, match three things: the type (thermocouple vs thermopile), the connection style (threaded nut vs spade terminals), and a tube that's the same length or a bit longer. Our pilot light troubleshooting guide goes deeper on each, with example part specs. If your furnace uses a hot surface igniter instead of a standing pilot, the furnace won't ignite guide is the better starting point.

When to call a pro

Call a licensed technician if you smell gas at any point, if the pilot won't light at all, if a new sensor doesn't fix it, or if you're not comfortable working near gas. A gas valve that won't hold with a good sensor needs professional service.

HVAC Fitter team. Not professional advice; follow your appliance manual and local codes.