Component guide · Beginner · 3 min read
Limit Switches and Micro Switches
Wiring and Uses
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
A micro switch (snap-action switch) changes state with a small, precise movement of its lever. Limit switches use one to detect when a moving part reaches the end of travel, such as a 3D printer axis or a gate. It has three terminals: common (COM), normally open (NO) and normally closed (NC). Wiring endstops as normally closed is safer, because a broken wire reads as triggered and stops the machine.
Key specs at a glance
- Terminals
- COM, NO (closes when pressed), NC (opens when pressed)
- Actuators
- Plain button, lever, roller lever
- Contact rating
- Often 3 to 5 A at 125 or 250 VAC for full-size; less for miniature
- Travel
- Small: under 1 mm operating travel on many
- Endstop modules
- Switch plus LED, pull-up and 3-pin connector for printer boards
- Alternatives
- Hall sensors and optical endstops for no-contact sensing
Wiring to a microcontroller
For a simple input, connect COM to GND and NO to a digital pin set to INPUT_PULLUP. The pin reads HIGH normally and LOW when the lever is pressed.
For endstops, use NC instead: COM to GND, NC to the pin with a pull-up. The pin reads LOW in normal operation and goes HIGH when pressed, and also goes HIGH if a wire breaks or a connector falls off, so the firmware stops the axis instead of crashing it. Most 3D printer and CNC firmware lets you invert the endstop logic to suit either wiring.
Mechanical contacts bounce for a few milliseconds; debounce in software or with a small capacitor (see push buttons).
Typical uses
- 3D printer and CNC homing switches on each axis.
- Stopping a linear actuator or motorised slider at each end.
- Detecting a door or lid closed in a machine, as a safety interlock.
- Robot bumpers: a lever switch at the front tells the robot it has hit something.
- Counting objects on a conveyor.
Mount the switch so the moving part presses the lever without driving past its over-travel limit, and use the roller version where the part slides past.
Switching loads directly
A micro switch can cut power to a small DC motor directly at the end of travel, with a diode across it so the motor can still reverse away from the stop. Check the DC rating, which is much lower than the AC rating because DC arcs do not self-extinguish. For larger loads, let the switch signal a microcontroller or a relay instead.
Try it: RC time constant calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Wiring endstops normally open, so a broken wire goes unnoticed.
- Using the AC contact rating for a DC motor load.
- Forgetting the pull-up resistor.
- Mounting so the actuator crushes the switch past its over-travel.
- Not debouncing, so one press counts several times.
Frequently asked questions
What is the difference between NO and NC?
NO (normally open) connects to COM only when pressed. NC (normally closed) is connected to COM until pressed.
Should endstops be wired NO or NC?
NC is safer: a broken wire looks like a triggered switch, so the machine stops rather than crashing.
Does a limit switch need a resistor?
It needs a pull-up or pull-down so the input is never floating. Microcontroller internal pull-ups are fine.
Can a micro switch switch mains?
Full-size micro switches are often rated for 250 VAC at a few amps, but mains wiring must be enclosed and done safely.
What is the difference between a limit switch and a micro switch?
A micro switch is the snap-action switch type; a limit switch is its job, often a micro switch with a lever or roller.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 1 step-by-step build in our project library uses parts from this guide.
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.



