Skip to main content

Limit Switch Related

This page explains the wiring, configuration, and status check methods for common limit switch types. Before the first homing, please complete the limit switch status check to confirm the trigger logic is correct.

Safety Reminder
  • Limit switch wiring operations must be performed with the power disconnected.
  • Before homing, move the print head to the middle of the machine and prepare an emergency stop or power cut-off.
  • Do not execute G28 if the limit switch status is incorrect, as this may cause a crash.

Micro Switch Limit

Three-Wire Micro Switch Limit Precautions

Danger

FLY motherboard users please note: Three-wire micro switch limit switches cannot be directly connected to FLY motherboards. The motherboard limit switch interface provides 5V power. If the three-wire micro switch is wired incorrectly, it may cause a 5V short circuit, damaging the motherboard, host computer, or drivers.

Solution:

  • Cut the 5V wire, usually the red wire, corresponding to the XH2.54 connector on the three-wire limit switch. Refer to the actual wire order if necessary.
  • After cutting, wrap the exposed end with insulating tape or heat shrink tubing to prevent short circuits.
Loading...

Micro Switch Limit Wiring Method

Caution

The use of the Normally Closed (NC) contact is strongly recommended. The NC wiring method makes it easier to detect faults when wires break, reducing the risk of a crash.

Motherboard TerminalFunctionConnection Requirement
5VPowerLeave unconnected
GNDGroundMust be connected
SSignalMust be connected

Testing Steps:

  1. Set the multimeter to the continuity test mode.
  2. Test the Normally Closed terminal and the common terminal of the micro switch.
  3. It should be conductive, and the buzzer should sound, when the switch is not pressed.
  4. It should be non-conductive, with no buzzer sound, when the switch is pressed.
  5. If the results are reversed, check if you have mistakenly used the Normally Open (NO) terminal or if there is a poor contact issue.
Loading...

Micro Switch Limit Reference Configuration

Most limit switches require the pull-up resistor to be enabled, hence the ^ symbol before the pin. When using a Normally Closed (NC) limit switch, the ! symbol is usually also added to invert the state.

printer.cfg
[stepper_x]
endstop_pin: ^!PD9

TAP

Wiring Instructions

Danger
  • This tutorial uses the BL-Touch interface on the FLY-SHT36 V2 as an example.
  • Some TAPs support 12V or 24V, but it is recommended to use 5V power first.
  • The middle signal pin of the BL-Touch interface cannot be used as a limit switch pin.
Motherboard TerminalFunctionConnection Requirement
5VPowerMust be connected
GNDGroundMust be connected
SSignalMust be connected
Loading...

TAP Reference Configuration

printer.cfg
[stepper_z]
endstop_pin: probe:z_virtual_endstop
# position_endstop: -0.5

[probe]
pin: ^sht36:PC15
x_offset: 0
y_offset: 0
# z_offset: 0
speed: 3.0
lift_speed: 5
samples: 3
samples_result: median
sample_retract_dist: 3.0
samples_tolerance: 0.075
samples_tolerance_retries: 3
activate_gcode:
{% set PROBE_TEMP = 150 %}
{% set MAX_TEMP = PROBE_TEMP + 5 %}
{% set ACTUAL_TEMP = printer.extruder.temperature %}
{% set TARGET_TEMP = printer.extruder.target %}

{% if TARGET_TEMP > PROBE_TEMP %}
{ action_respond_info('Extruder temperature target of %.1fC is too high, lowering to %.1fC' % (TARGET_TEMP, PROBE_TEMP)) }
M106 S255
M109 S{ PROBE_TEMP }
M106 S26
{% else %}
{% if ACTUAL_TEMP > MAX_TEMP %}
{ action_respond_info('Extruder temperature %.1fC is still too high, waiting until below %.1fC' % (ACTUAL_TEMP, MAX_TEMP)) }
TEMPERATURE_WAIT SENSOR=extruder MAXIMUM={ MAX_TEMP }
{% endif %}
{% endif %}

Photoelectric Limit Switch

Danger
  • This tutorial uses the EE-SX670WR as an example.
  • The sensor type is an NPN Normally Closed switch.
  • The photoelectric switch is powered with 5V.
  • If you need to use 12V or 24V power, please refer to the proximity switch wiring method below.

Wiring Instructions

Motherboard TerminalFunctionConnection Requirement
5VPowerMust be connected
GNDGroundMust be connected
SSignalMust be connected

EE-SX670WR Wiring Recommendations:

Photoelectric Switch WireFunctionConnection Requirement
BrownPowerMust be connected
BlueGroundMust be connected
BlackSignalMust be connected
PinkNormally ClosedConnect to GND to use the Normally Closed function
Loading...

Photoelectric Limit Switch Reference Configuration

printer.cfg
[stepper_x]
endstop_pin: ^PD9

Proximity Switch

Danger

Using the Omron proximity switch TL-Q5MC2-Z as an example, please note before operating:

  • The sensor type is an NPN Normally Closed switch.
  • You need to provide your own BAT85 diode.
  • Exposed wire ends must be properly insulated to prevent short circuits.

Wiring Steps

  1. Connect the black end of the diode, which is the cathode, to the sensor signal wire.
  2. Connect the other end of the diode, which is the anode, to the motherboard signal interface.
  3. Wrap the exposed wire ends with heat shrink tubing or electrical tape.
Loading...

Proximity Switch Reference Configuration

printer.cfg
[probe]
pin: ^PC0
x_offset: 0
y_offset: 25.0
z_offset: 0

Limit Switch Status Check

Preparation

  1. With the power off, manually move the print head to the middle of the machine.
  2. Power on the machine and open the web console.
  3. Enter the following command to check the limit switch status:
QUERY_ENDSTOPS

When the wiring and configuration are correct, untriggered limit switches should show as open.

Loading...

Trigger Test

Press and hold one of the limit switches, without releasing it, and execute the command again:

QUERY_ENDSTOPS

The status of the pressed limit switch should change to TRIGGERED. For example, when the Y limit switch is pressed, the Y status should change from OPEN to TRIGGERED.

Loading...

Result Evaluation

SymptomSolution
Status does not changeCheck the limit switch wiring and the pin configuration
Triggering is not sensitiveCheck if the pull-up symbol ^ is added before the pin, e.g., ^PC0
Status is reversedCheck if the inversion symbol ! needs to be added or removed before the pin

When the status is reversed:

  • If it is currently ^!PD9, try changing it to ^PD9.
  • If it is currently ^PD9, try changing it to ^!PD9.
Extended Features

If the printer does not use physical limit switches, please refer to the Guide for Systems without Limit Switches.

Loading...