Limit Switch Explained: How It Works and How to Wire It to a PLC
A limit switch explained — how the snap-action contacts work, the types, NO vs NC for fail-safe logic, and how to wire one to a PLC discrete input.
A limit switch is an electromechanical device that detects the physical presence or position of an object by mechanical contact, then opens or closes an electrical circuit in response. When a moving part — a conveyor pallet, a press ram, a door — reaches a predetermined point and pushes the actuator, the switch's internal snap-action mechanism changes the state of its contacts instantly and reliably.
Limit switches have been on the plant floor for over a century. They remain the first choice for end-of-travel detection because they are rugged, accurate to within a fraction of a millimetre, unaffected by target material, and cost a fraction of contactless alternatives. Understanding how the contacts work and how to wire one correctly to a PLC discrete input is foundational knowledge for any automation engineer.
What Is a Limit Switch?
A limit switch is a position-sensing device that converts a mechanical event (an actuator being depressed, rotated, or struck) into an electrical signal. The name comes from the original application: marking the physical limit of travel for a moving machine element — a crane hoist at its upper limit, a conveyor at its end stop, a gate at fully open.
The IEC symbol for a limit switch is a normally open or normally closed contact with a small diagonal line at the actuator side, indicating mechanical operation rather than manual or electromagnetic operation. In the United States, NEMA standards govern the environmental ratings; IEC 60947-5-1 governs the global contact performance requirements.
A limit switch has four key functional parts:
- Actuator / operator — the external arm, plunger, roller, or lever that the target object touches
- Operating head — the housing that transmits motion from the actuator to the contact mechanism; typically adjustable or interchangeable
- Contact block — the electrical heart of the switch; houses the COM, NO, and NC contacts
- Body / enclosure — the IP/NEMA-rated housing that protects the mechanism from the environment
How a Limit Switch Works: Snap Action, COM, NO, and NC
The defining feature of a limit switch contact mechanism is snap action — also called over-centre or bi-stable action. A spring-loaded plunger inside the contact block is pre-loaded against an over-centre pivot. As the actuator depresses slowly, the spring stores energy. At a precise travel point called the operating point (OP), the spring releases across the pivot in a rapid, irreversible snap that drives the moving contact from one position to the other in under one millisecond.
This matters because slow, hesitant contact motion causes contact bounce and arcing, which destroys contacts rapidly. Snap action means the contacts move fast regardless of how slowly the target object creeps up on the actuator — the electrical transition is always clean and fast.
The Three Terminals: COM, NO, NC
Every standard limit switch contact block has three terminals:
| Terminal | Name | At-rest state |
|---|---|---|
| COM | Common | — (reference point, always connected) |
| NO | Normally Open | Open — no continuity between NO and COM |
| NC | Normally Closed | Closed — continuity between NC and COM |
When the actuator is not actuated (at rest, no target present):
- NC–COM path: closed, current flows
- NO–COM path: open, current does not flow
When the actuator is actuated (target has pressed the arm):
- NC–COM path: opens (NC contact moves away from COM)
- NO–COM path: closes (NO contact bridges to COM)
This changeover action happens simultaneously at the snap point. The switch is called a single-pole double-throw (SPDT) device. You can use NO alone, NC alone, or both — switching different circuits at the same moment.
For a deeper comparison of NO and NC behaviour across all contact types, see Normally Open vs Normally Closed.
Types of Limit Switches
Limit switches come in many actuator styles. The operating head is usually interchangeable on a given body family, so the contact block remains the same while the actuator changes for the application.
Roller Lever
The roller lever is the most common type on the plant floor. A pivoting arm with a small roller at its tip contacts a cam, dog, or ramp on the moving part. The roller reduces friction and wear on the actuator, making it suitable for high-cycle applications. Adjustable-lever versions let you set the precise trip point without moving the switch body.
Plunger / Button
A spring-loaded plunger or button requires direct axial force. It is commonly used where a door, guard, or slide makes face-on contact with the switch. Plunger types are compact and highly precise because there is no lever amplification of play or flex.
Micro / Snap-Action Switch
Micro switches — the tiny rectangular bodies used in mice, appliances, and light machinery — are snap-action limit switches scaled down to miniature size. They require very low actuation force (as little as 25 g) and are extremely low cost. In industrial panels they are used for door interlocks; on PCBs for end-stop detection on stepper-driven axes.
Rotary Shaft
A rotary limit switch mounts on a shaft and fires at a pre-set angle of rotation. The shaft can be driven directly by the machine's own rotating axis or through a reduction drive to detect multiple turns. Common in crane hoist upper/lower limits and valve open/close detection.
Whisker / Cat's Whisker
A whisker actuator is a thin, flexible wire probe radiating from the switch body. It detects contact from almost any direction and is sensitive to very light force. Used to detect small parts on a conveyor, sheet labels, and jam conditions where standard rollers would crush fragile objects.
Compare how these contact-based sensors differ from non-contact alternatives in Types of Industrial Sensors.
How to Choose a Limit Switch
Actuator Style and Travel Requirements
Match the actuator to the motion:
- Cam or ramp on moving part → roller lever
- Door / guard / linear push → plunger
- Rotating shaft or valve → rotary
- Delicate or multi-direction contact → whisker
Check the pre-travel (distance from free position to operating point) and differential travel (gap between operating point and reset point). Tight repeatability requirements need a switch with low differential.
IP / NEMA Environmental Rating
| Rating | Typical environment |
|---|---|
| IP54 / NEMA 3 | Protected against dust and splashing water; outdoor enclosures |
| IP65 / NEMA 4 | Washdown; food production, light chemical splash |
| IP67 | Temporary immersion; wet conveyors, tank areas |
| IP69K | High-pressure steam cleaning; meat processing, dairy |
For corrosive environments, specify stainless steel or GRP bodies rather than standard zinc-alloy housing.
Electrical Ratings
Key parameters on the data sheet:
- Rated operational current (Ie) — maximum current the contacts carry continuously at rated voltage
- Making and breaking capacity — higher than Ie; the momentary surge the contacts can switch
- Mechanical life — typically 10–30 million operations for industrial grades; micro switches may rate 1 million
- Electrical life — lower than mechanical life; resistive vs. inductive loads affect this significantly
For inductive DC loads (motor contactors, solenoids), always derate or specify a switch with an arc suppression circuit, or use an interposing relay.
Limit Switch Applications
Limit switches appear in virtually every area of industrial machinery:
- End-of-travel interlock — stops an axis before it reaches a hard mechanical stop
- Home position detection — confirms an axis has returned to its reference position at startup
- Guard / safety door interlock — prevents machine motion when an access panel is open
- Part presence detection — confirms a workpiece is correctly seated in a fixture before a press or weld cycle starts
- Conveyor divert gate — detects that a diverter blade has reached its commanded position
- Valve position feedback — confirms a ball valve or gate valve is fully open or fully closed
- Overtravel protection — a second switch beyond the normal limit trips the drive's hardware enable if the primary limit is missed
For applications where contact wear is unacceptable or the target cannot physically touch the sensor, compare to proximity sensors and photoelectric sensors.
Wiring a Limit Switch to a PLC Discrete Input
This is the section that most guides skip. Wiring a limit switch mechanically is straightforward — but wiring it correctly to a PLC discrete input card, choosing the right contact (NO vs NC), and handling debounce in the program are where engineers make mistakes that cause intermittent faults.
Sinking vs Sourcing Discrete Input Cards
Before wiring, identify whether your PLC input card is sinking (negative common, current flows into the input terminal) or sourcing (positive common, current flows out). A limit switch is a passive dry contact — it does not source or sink current itself — so it is compatible with both types. What changes is which supply terminal you connect to COM and which you connect to the input terminal.
For 24 VDC sinking input cards (the most common type in North America and most Allen-Bradley systems):
- Connect +24 VDC to the COM of the limit switch
- Connect the NO or NC output terminal of the limit switch to the input channel terminal
- Connect the input card's common to 0 VDC (DC common / negative rail)
For sourcing input cards (common in Siemens PNP sensor wiring environments):
- Connect 0 VDC to the limit switch COM
- Connect the NO or NC output to the input channel
- Connect the input card's common to +24 VDC
For a full breakdown of sinking and sourcing wiring see Sinking vs Sourcing (NPN vs PNP).
NO vs NC: Why NC Is the Fail-Safe Choice
This is the most important decision when wiring a limit switch to a PLC:
- Wiring the NC contact means 24 V is present at the input during normal operation (limit not reached). If the wire breaks, the terminal sees 0 V, the PLC bit goes false, and any interlock logic based on that bit triggers a fault — exactly what you want.
- Wiring the NO contact means 24 V appears at the input only when the limit is tripped. If the wire breaks, the input stays at 0 V and the PLC cannot distinguish "limit not reached" from "broken wire." The machine continues running with no protection.
The rule: use NC contacts and XIO (examine-if-open) instructions for all safety-relevant limits. A broken wire should always cause a safe state (motor stops, axis de-energises). This is the same principle that makes E-stop circuits use NC contacts.
See Normally Open vs Normally Closed for the full treatment of this fail-safe logic.
Debounce
Limit switches can exhibit contact bounce — a rapid make/break oscillation lasting 1–5 ms as the contacts first touch. In high-speed scan PLC programs (scan times under 5 ms), a single physical trip of the switch may register as multiple transitions. Debounce strategies include:
- Hardware RC filter — a small resistor-capacitor network across the input slows the voltage rise time past the input's switching threshold. Many input cards include this internally (check the specification for "input filter time" — typically 4–12 ms).
- Software timer filter — latch the input state change only after a one-shot timer confirms the new state has been stable for at least 8 ms. This is the preferred approach when using field-bus I/O with configurable filter times.
- Rising/falling edge detection — in IEC 61131-3 Structured Text, use
R_TRIGandF_TRIGfunction blocks rather than polling the raw bit. Edge detection inherently ignores re-asserted states on the same scan.
Ladder Logic End-of-Travel Interlock with Structured Text Equivalent
The following example implements a simple end-of-travel interlock for a linear axis. The axis drives forward until the forward limit switch trips; the PLC stops the forward output and may reverse.
Ladder Logic (Allen-Bradley / IEC-compatible)
| LS_EOT_FWD_NC CMD_FWD | MOTOR_FWD |
|---[ / ]----------[ ]------------|----( )------|
| I:0.4 B3:0/0 | |
| | |
| LS_EOT_FWD_NC | EOT_FAULT |
|---[/]---------------------------|----( )------|
| I:0.4 | |
Reading the rung:
LS_EOT_FWD_NCis tagged to input bitI:0.4, wired NC. When the limit is not tripped, 24 V is present → bit = 1. The XIO instruction (examine-if-open) istruewhen the bit is 0 — so in normal (not tripped) operation the XIO passes.- Wait — this looks backwards. Let's clarify: NC contact wired → bit = 1 when NOT tripped. Use XIC (
[ ]) on the forward command; use XIO ([/]) on the limit bit to block forward motion when the limit IS tripped (bit = 0 → XIO false... actually bit = 0 means limit tripped with NC wiring, so XIC = false, blocking output).
Revised, correct ladder convention for NC-wired limit switch:
| LS_EOT_FWD CMD_FWD | MOTOR_FWD |
|---[ ]----------[ ]-------------|----( )------|
| I:0.4 B3:0/0 | |
LS_EOT_FWD is the tag for input I:0.4, which is wired via the NC contact. When limit NOT tripped: NC closed → 24 V → bit = 1 → XIC passes. When limit IS tripped: NC opens → 0 V → bit = 0 → XIC false → output drops.
IEC 61131-3 Structured Text Equivalent
(* End-of-travel interlock — Structured Text *)
(* LS_EOT_FWD: BOOL input tag, wired NC — TRUE = limit not reached *)
VAR
LS_EOT_FWD : BOOL; (* DI, NC wired — I:0.4 *)
CMD_FWD : BOOL; (* Command from HMI or sequencer *)
MOTOR_FWD : BOOL; (* DO to motor forward contactor *)
EOT_FAULT : BOOL; (* Fault bit for alarm *)
END_VAR
(* Only drive forward if limit not tripped AND command is active *)
MOTOR_FWD := CMD_FWD AND LS_EOT_FWD;
(* Raise a fault when the limit is tripped *)
EOT_FAULT := NOT LS_EOT_FWD;
The logic is identical to the ladder rung but expressed procedurally. The key insight: because the input is wired NC, LS_EOT_FWD = TRUE means normal operation (not tripped), and = FALSE means tripped or broken wire — both of which correctly stop the drive and set the fault bit.
For more complex axes, extend this pattern with a reversal timer and a second reverse-limit switch to create a complete axis interlock. Combine with proximity sensor inputs for part-presence confirmation — see Types of Industrial Sensors for how limit switches compare to inductive and capacitive sensing.
Frequently Asked Questions
What is a limit switch?
A limit switch is a position-sensing electromechanical device that changes the state of its electrical contacts when a moving machine element physically contacts its actuator. It converts a mechanical position event — such as an axis reaching its end of travel — into an electrical signal that a PLC or control circuit can act on. Limit switches are defined by their snap-action contact mechanism, which ensures fast, clean contact transitions regardless of how slowly the target approaches.
How does a limit switch work?
A limit switch works through a snap-action mechanism inside the contact block. As the actuator (lever, plunger, or roller) is depressed by a moving target, a spring-loaded element stores energy against an over-centre pivot. At a precise travel point called the operating point, the spring snaps the moving contact from one position to the other in under one millisecond. This simultaneously opens the NC (normally closed) contact path and closes the NO (normally open) contact path between the common (COM) terminal and the respective output terminals. The snap action keeps contact transition fast regardless of actuator speed, preventing arcing and contact welding.
Should a limit switch be NO or NC?
For any safety-relevant interlock — end-of-travel stop, guard door, overtravel protection — the limit switch should be wired using its NC (normally closed) contact to the PLC input. This means 24 V is present at the input during normal operation (limit not tripped). When the limit is tripped, or when a wire breaks or a terminal loosens, the voltage drops to 0 V and the PLC input goes false, stopping the drive. Using the NO contact leaves the machine running unprotected if the wire breaks, because a broken-wire condition looks identical to the "limit not reached" state.
How do you wire a limit switch to a PLC?
To wire a limit switch to a PLC 24 VDC sinking discrete input:
- Connect +24 VDC from the control panel power supply to the COM terminal on the limit switch.
- Connect the NC terminal of the limit switch to the input channel terminal on the PLC input card (for example, IN 4).
- Connect the 0 VDC (DC common) rail to the PLC input card's common (C/COM) terminal.
- In the PLC program, create a tag for the input bit and use an XIC (examine-if-closed / normally open instruction) — because when the limit is not tripped the NC contact is closed and 24 V is present, making the bit TRUE and the XIC instruction true.
- Wire this tag in series with the axis drive output coil. When the limit trips (bit goes FALSE), the rung goes false and the output de-energises.
Verify the wiring by checking the input LED on the card: it should illuminate during normal (non-tripped) operation and extinguish when the limit switch actuator is depressed.
Related reading:
- Types of Industrial Sensors — where limit switches fit in the full sensor landscape
- Sinking vs Sourcing (NPN vs PNP) — choosing the right discrete input card for your wiring
- Normally Open vs Normally Closed — the fail-safe rule applied across all contact types
- Proximity Sensor vs Photoelectric Sensor — when to switch from contact-based to non-contact sensing


