Filament Runout Not Detecting / Sensor Not Triggering
Marlin 3D Printer Firmware
Severity:What Does This Error Mean?
A Marlin filament runout sensor that does not trigger is usually caused by the FILAMENT_RUNOUT_SENSOR option not being enabled in Configuration.h, or the sensor wired to the wrong pin. Enable the feature in firmware and verify the pin assignment matches your board wiring.
Affected Models
- Any Marlin-based 3D printer with a filament runout or motion sensor
Common Causes
- FILAMENT_RUNOUT_SENSOR not enabled in Configuration.h
- Sensor wired to the wrong pin — pin number in Configuration.h does not match physical board connector
- Sensor logic inverted — FIL_RUNOUT_STATE set wrong for the sensor's active-high or active-low output
- Sensor physically not detecting filament — dirty optical sensor or misaligned mechanical switch
- M412 command (runout enable) not sent — feature disabled at runtime even if compiled in
How to Fix It
-
Enable FILAMENT_RUNOUT_SENSOR in Configuration.h.
Open Configuration.h and find the line //#define FILAMENT_RUNOUT_SENSOR. Remove the two slashes to uncomment it, enabling the feature. Recompile and flash the firmware — the sensor will not work at all if this line remains commented out.
-
Verify the sensor pin assignment.
The FIL_RUNOUT_PIN in Configuration.h must match the physical pin on the control board where the sensor is wired. Check your board's pinout diagram and confirm the pin number. An incorrect pin number causes the firmware to monitor the wrong input and never detect the sensor state.
-
Check FIL_RUNOUT_STATE logic.
The FIL_RUNOUT_STATE value (HIGH or LOW) defines what state the pin is in when filament is absent. Most optical and switch sensors go LOW when triggered (filament absent). If the sensor triggers instantly at boot with filament loaded, the state is inverted — change HIGH to LOW or vice versa.
-
Test the sensor with M119.
Send M119 to the printer while filament is loaded — the runout sensor should show a status of TRIGGERED or OPEN depending on your configuration. Remove the filament and send M119 again — the status should change. If the status never changes, the sensor is not wired correctly or is physically faulty.
-
Send M412 S1 to enable runout detection at runtime.
Even with the sensor compiled in, runout detection can be disabled at runtime. Send M412 S1 to enable it and M500 to save the state. Add M412 S1 to your slicer start G-code so runout detection is always active at the start of every print.
When to Call a Professional
If the sensor hardware is confirmed working and the firmware is correctly configured but the printer still ignores the sensor, the control board's input pin may be damaged. Test the pin with a multimeter.