How to Wire a Limit Switch to an Arduino Board

KW11-3Z micro limit switch 10-pack with roller and lever actuators

How to Wire a Limit Switch to an Arduino Board

Wire a limit switch to an Arduino board with COM to ground and NO to a digital pin with a pull-up. The pin reads high when the switch is open and low when the lever presses. A KW11-3Z switch costs $6.99 for a 10-pack and is rated 5 A at 250 VAC. Reed and touch modules cost $2.99 each.

KW11-3Z micro limit switch 10-pack with roller and lever actuators
KW11-3Z micro limit switch 10-pack: snap-action switches rated 5 A at 250 VAC, with NO and NC terminals.

Quick facts

Fact Value
KW11-3Z limit switch 5 A 250 VAC, NO/NC, 10-pack, $6.99
Switch life 1,000,000 cycles or more
Contact resistance 50 mOhm or less
KY-025 reed switch 3.3 V to 5 V, digital and analog out, $2.99
TTP223 touch key 2.5 V to 5.5 V, 15 by 11 mm, $2.99
Wiring COM to ground, NO to digital pin with pull-up

What is a limit switch and where does it fit?

A limit switch is a snap-action switch that trips when a lever or roller moves.

It marks the end of travel on a 3D printer axis, a CNC machine, or a robot arm.

The KW11-3Z is the standard 3D-printer endstop switch, rated 5 A at 250 VAC.

Its life is rated at 1,000,000 cycles or more, with contact resistance of 50 mOhm or less.

How do you wire a limit switch to an Arduino board?

Connect the COM terminal to ground and the NO terminal to a digital pin.

Set the pin as an input with the internal pull-up turned on.

The pin reads high while the switch is open and low when the lever presses.

Use the NC terminal instead of NO when you want the pin to read low while the switch is open.

How do you use a limit switch as a 3D printer endstop?

Mount the switch where the moving axis presses the lever at the end of travel.

The KW11-3Z comes with roller lever, arc lever, straight lever, and push button styles.

Pick the actuator that meets the moving part squarely at the end of its travel.

Test the endstop by hand before a print, and confirm the printer stops at the switch.

When do a reed switch or touch key fit instead?

A reed switch trips on a magnet, so it fits doors and lids with no physical contact.

The KY-025 reed module costs $2.99 and runs on 3.3 V to 5 V with digital and analog outputs.

A touch key fits panels where a finger press should act as the trigger.

The TTP223 touch module costs $2.99, measures 15 by 11 mm, and runs on 2.5 V to 5.5 V.

What did we check on the bench?

We matched every price in this guide to the live store price on November 20, 2026.

We checked the KW11-3Z listing states a 5 A 250 VAC rating, NO/NC terminals, and a 10-pack.

We checked the KY-025 listing states a 4-pin module with digital and analog outputs at 3.3 V to 5 V.

We checked the TTP223 listing states self-locking and momentary modes at 2.5 V to 5.5 V.

How the options compare

Item Trigger Voltage Price
KW11-3Z limit switch, 10-pack Lever or roller press 5 A 250 VAC rating $6.99
KY-025 reed switch module Magnetic field 3.3 V to 5 V $2.99
TTP223 touch key module Finger touch 2.5 V to 5.5 V $2.99

How do you wire a limit switch in 6 steps?

  1. Pick the actuator style that meets the moving part: roller, arc lever, straight lever, or push button.
  2. Mount the switch where the axis presses the lever at the end of travel.
  3. Connect COM to ground and NO to a digital pin on the board.
  4. Set the pin as an input with the internal pull-up turned on.
  5. Press the lever by hand and confirm the pin reads low.
  6. Run the axis slowly toward the switch and confirm it stops at the end of travel.

Parts that fit this guide

In-stock parts ship from the New York, USA warehouse in 1-2 business days. Prices below are the live store prices we verified on November 20, 2026.

KW11-3Z Micro Limit Switch, 5A 250VAC, Roller / Lever, 10-Pack ($6.99)

KW11-3Z Micro Limit Switch, 10-Pack at $6.99. Snap-action switches rated 5 A at 250 VAC, with NO/NC terminals and roller, arc lever, straight lever, and push button styles.

KY-025 Reed Switch Magnetic Sensor Module, 4-Pin ($2.99)

KY-025 Reed Switch Magnetic Sensor Module at $2.99. A dry reed switch triggers on magnetic field changes, with digital and analog outputs at 3.3 V to 5 V.

TTP223 Capacitive Touch Sensor Module, Self-Locking and Momentary, 2.5V to 5.5V ($2.99)

TTP223 Capacitive Touch Sensor Module at $2.99. A single-channel touch key, 15 by 11 mm, with self-locking and momentary modes at 2.5 V to 5.5 V.

Shop the full range: Switches & Buttons at Quality RC Parts. See also: Related guide.

Frequently asked questions

Should I wire a limit switch NO or NC?

Wire NO for most Arduino projects, with COM to ground and a pull-up on the pin. Use NC when you want a broken wire to read as triggered, which is safer on a printer.

Do I need a resistor with a limit switch?

No extra resistor is needed when you use the internal pull-up. Set the pin as INPUT_PULLUP and the pin reads high until the switch pulls it low.

Can a limit switch handle mains voltage?

The KW11-3Z is rated 5 A at 250 VAC, but mains wiring needs proper enclosures and local code. Keep Arduino projects on low voltage.

What is the difference between a limit switch and a reed switch?

A limit switch trips on physical press, while a reed switch trips on a magnet with no contact. Use a reed switch on doors and lids where nothing should touch.

Sources

Last updated: November 20, 2026.