A limit switch is a mechanical switch that detects when a moving part reaches a defined position. In CNC machines and 3D printers, limit switches serve as end stops — they tell the controller where the physical boundaries of each axis are, preventing the machine from crashing into its own frame.
How a Limit Switch Works
A limit switch has an actuator (lever, roller, or plunger) that extends from the body. When a moving part pushes against the actuator, the internal contacts change state. Most limit switches have three terminals: Common (C), Normally Open (NO), and Normally Closed (NC).
When the actuator is not pressed, C connects to NC. When pressed, C connects to NO. This dual-contact arrangement gives you flexibility in wiring — you can choose whether the switch triggers on contact (NO) or on release (NC).
Types of Limit Switches
- Lever type — A straight or bent lever extends from the body. Most common for CNC and 3D printers. Provides a wide activation area.
- Roller lever — A roller at the end of the lever reduces friction when parts slide along the switch. Used in conveyor systems.
- Plunger type — A short push-button style actuator for precise position detection. Less activation range but higher accuracy.
- Micro switch — A compact snap-action switch often used as a generic term for small limit switches. The internal snap-action mechanism provides a crisp switching point.
Limit Switches in 3D Printers
Every 3D printer needs end stops on at least the X, Y, and Z axes for homing. During the homing sequence, the printer moves each axis towards its end stop until the switch triggers, then backs off slightly. This establishes the zero position (home) for each axis.
Min vs Max end stops: Most printers only use minimum end stops (at the 0,0,0 position). Maximum end stops are optional and prevent the carriage from overshooting, but firmware soft limits usually handle this.
In India, mechanical limit switches remain the most popular choice for budget 3D printer kits like the Ender 3 and Prusa i3 clones. They cost about ₹15–30 each and are readily available.
Wiring for GRBL and Marlin
For GRBL (CNC machines)
GRBL expects normally open switches. Connect one terminal of the limit switch to the end stop input pin and the other to GND. Enable internal pull-ups in GRBL configuration ($5=0 for normal, $5=1 for inverted).
For Marlin (3D printers)
Marlin supports both NO and NC switches. In Configuration.h:
// Use NC switches (recommended for noise immunity)
#define X_MIN_ENDSTOP_INVERTING true
#define Y_MIN_ENDSTOP_INVERTING true
#define Z_MIN_ENDSTOP_INVERTING true
Pro tip: NC wiring is preferred because a broken wire is immediately detected as a triggered end stop, which is safer than the machine not stopping at all.
Troubleshooting End Stop Issues
- False triggers during printing — Electrical noise from stepper motors can cause false end stop signals. Add a 100 nF capacitor between the signal pin and GND, and use shielded wires.
- End stop not triggering — Check wiring with a multimeter in continuity mode. Verify the switch type (NO/NC) matches your firmware configuration.
- Inconsistent homing position — Ensure the switch actuator is firmly mounted and the mechanical part contacts it consistently. Check for loose mounting screws.
- End stop triggered but not at physical limit — The switch might be mounted too close to the travel path. Adjust the mounting position so it triggers just before the mechanical limit.
Recommended Products from Zbotic
Tactile Push Button Switch 6x6x5mm (Pack of 10)
5A 3 Pin SPDT Toggle Switch
10CM Male To Male Breadboard Jumper Wires
Frequently Asked Questions
Can I use optical end stops instead of mechanical limit switches?
Yes. Optical end stops use an infrared LED and phototransistor pair with a slotted wheel or flag. They are more precise and have no mechanical wear, but cost more (₹50–100 vs ₹15–30).
How do I test a limit switch without a multimeter?
In Marlin firmware, use the M119 G-code command to report end stop status. Press the switch manually and run M119 again — the status should change from “open” to “triggered”.
What is the rated lifespan of a mechanical limit switch?
Most micro-style limit switches are rated for 1 to 10 million mechanical operations. For a 3D printer that homes 3 times per print, this translates to hundreds of thousands of prints.
Should I use NC or NO wiring for end stops?
NC (normally closed) is recommended for safety. If a wire breaks or comes loose, the controller reads it as the end stop being triggered, which stops motion. With NO wiring, a broken wire means the end stop will never trigger.
Upgrade Your CNC or 3D Printer
Find limit switches, endstops, and motion components at Zbotic.in!
Add comment