How-to
Replacing a mechanical limit switch with a proximity sensor
Short answer
Yes — an inductive proximity sensor on a 24 V DC supply, switching a mechanical interface relay whose contact reproduces the original circuit logic, replaces a worn mechanical limit switch. Verify first whether the normally closed contact is truly closed at rest or held open by the cam. Keep two-wire sensors away from solid-state relays: their off-state leakage can hold the relay on.
On this page
Yes — replace the worn mechanical limit switch with an inductive proximity sensor on a 24 V DC supply, switching a small mechanical interface relay whose contact reproduces the original circuit logic. Two checks decide whether the swap works: what the "normally closed" contact actually does in the machine's normal state, and what off-state leakage does if you drive a solid-state relay without the interface relay. Get those right and the cam wear is gone for good: no physical contact, no magnet, and a bounce-free solid-state output. The steps below cover the sensor choice, the logic check, the wiring, and setting the trip point with the fine-adjust screw.
Pick the sensing technology #
Use an inductive proximity sensor. It detects a ferrous-metal target without touching it, needs no magnet fastened to the moving part, and its solid-state output has no contact bounce. A magnetic reed switch still requires a magnet and remains an electromechanical device; a new mechanical switch simply rebuilds the wear problem you are removing.
| Option | Actuator | Verdict for this conversion |
|---|---|---|
| Inductive proximity sensor | Ferrous-metal target | Use it: no contact, no magnet, bounce-free output |
| Magnetic reed switch | Permanent magnet | Skip: electromechanical and slower |
| New mechanical limit switch | Physical cam | Skip: restores the wear problem |
For the format, a shielded sensor in a threaded barrel — 16 mm is a common field choice — mounts flush in metal because the threads run right to the sensing face, at the cost of a shorter sensing range. For a fine-adjust stop that trade is worth taking: the shorter range gives a tighter switching zone. An unshielded sensor reaches farther but must stand clear of surrounding metal. Take the rated sensing distance for your exact part from its datasheet.
Establish the real contact logic first #
"Normally closed" on the switch body does not tell you the machine state. A normally closed contact can sit held open by the cam all day, so the controller's normal input is an open circuit. Get this wrong and the new circuit runs backwards, or fails in the wrong direction. Before unwiring anything:
- Lock out the machine and confirm zero stored energy at the mechanism.
- Put a multimeter across the old switch terminals and record the continuity reading with the machine in its normal rest position.
- Move the mechanism to the trip position and record the reading again.
- Write down which controller state corresponds to a closed circuit. That sequence is the specification the new circuit must reproduce.
Wire the replacement circuit #
Build the standard arrangement: three-wire DC sensor, 24 V DC supply, mechanical interface relay, and a relay contact chosen to match the recorded logic.
- Power the sensor from the 24 V DC supply. On the usual three-wire DC convention, brown is +24 V, blue is 0 V and black is the output; confirm against the wiring diagram that ships with the sensor — the load symbol in that diagram is your relay coil.
- Wire the black output through the relay coil to 0 V for a PNP sensor, and check the coil current against the sensor's maximum load rating.
- Choose the contact: a normally open relay contact closes when the target is present, a normally closed contact closes when it is absent. Pick whichever reproduces the recorded sequence.
- Only if the design demands a solid-state relay driven directly, with no relay contact available to invert the logic, specify the sensor's own output configuration — a normally closed output where the circuit needs one — before ordering.
Leave two-wire sensors out of this circuit. A two-wire sensor powers itself through the load, so current flows even when it is off, and the common precautions published for solid-state relays note leakage through the snubber circuit even with no input applied. Sensor off-state leakage on top of the relay's own leakage can hold the input above its release threshold, so the output never truly switches off.
Worked example: checking the trip window of a 5 mm rated inductive sensor at 25 °C #
This example is illustrative; substitute the rated distance from the datasheet of the sensor you actually buy.
Inputs:
- Rated sensing distance Sn = 5 mm, from the sensor datasheet (illustrative value for a sensor of this class).
- Acceptance rule: the actual sensing distance of an inductive sensor should be within 10% of the rated distance at 25 °C, per Rockwell Automation's guidance on inductive proximity sensing distance.
- Measured trip distance and spread: taken on your machine with a gauge and a ferrous target.
Rule in words: the acceptable trip window is the rated distance plus or minus 10%.
- 10% of 5 mm = 0.5 mm
- Lower limit: 5 mm − 0.5 mm = 4.5 mm
- Upper limit: 5 mm + 0.5 mm = 5.5 mm
Failure case: a sensor that consistently trips at 8 mm against its 5 mm rating, with ±1 mm spread — the failure illustrated in sensing-distance guides. Offset = 8 mm − 5 mm = 3 mm, which is 3 ÷ 5 = 60% of rating, far outside the ±10% window. The ±1 mm spread alone means the trip point wanders 2 mm peak to peak, and the fine-adjust screw cancels offset, never scatter.
Result: the acceptance window is 4.5 mm to 5.5 mm at 25 °C. Decision: accept the sensor only if the mean measured trip distance lands inside that window, and re-check at operating temperature because the window is a 25 °C figure. Set the static target gap near half the rated distance — about 2.5 mm here — as a rule of thumb, so drift and target variation stay inside the window.
Set and verify the final trip point #
- Mount the sensor and its ferrous target on rigid brackets, with the fine-adjust screw on the sensor bracket.
- Set the gap near half the rated distance; the target must never strike the sensing face.
- Cycle the mechanism through the trip point at working speed — ten passes is a practical minimum — and record the switching point each pass. The spread you measure is this machine's repeatability; the datasheet figure describes the sensor on a bench, not on your bracket.
- Set the final stop against a measured result on the part the machine produces, not against any indicated distance.
- Lock the adjustment, recheck after a full cycle, and recheck again once the machine is warm.
When the old switch is a safety function #
If the switch you are removing stops a ram, guards an opening or feeds an interlock, this conversion is a safety modification, not a spare-parts swap. General-purpose proximity sensors and interface relays carry no safety rating. ISO 13849-1 requires every safety function to be specified, built from components with documented safety performance, and validated before the machine runs. Keep the original circuit in place until that work is done under the machine's risk assessment; this article is not a safety validation.
Questions asked
Why does the new sensor circuit run backwards compared with the old limit switch?
Because the old switch was probably a normally closed device held open by the cam in the machine's normal state, so the controller was used to seeing an open circuit at rest. Your sensor and relay produced the opposite sequence. Swap to the other relay contact — normally open instead of normally closed, or vice versa — and the sequence matches the original. That is why you record the old switch's continuity in both machine states before unwiring anything.
Can a two-wire proximity sensor drive a solid-state relay?
Not reliably. A two-wire sensor powers itself through the load, so it passes current even when off, and solid-state relays leak through their snubber circuits with no input. The combined off-state current can sit above the relay's turn-on threshold, so the output never truly switches off. Use a three-wire sensor with a mechanical interface relay, or a sensor with the required normally closed output. A shunt resistor across the relay input can bleed leakage below the threshold — size it from the two datasheets.
How far from the sensing face should the target run?
As a rule of thumb, set the static gap near half the rated sensing distance — a 5 mm rated sensor sits about 2.5 mm from the target. That keeps the trip point inside the switching window with room for drift and mechanical variation, and the target must never strike the sensing face. Take the rated distance from the datasheet of the exact sensor you bought, not from a similar part.
Is a proximity sensor more accurate than the mechanical switch it replaces?
It is more repeatable, which is what matters here. Accuracy — triggering at exactly the rated distance — counts for less, because you calibrate the stop position with the fine-adjust screw and cancel any offset. What the screw cannot cancel is scatter: if the trip point wanders, the finished position wanders with it. Accept the conversion on the measured spread over repeated trips on the machine, not on a datasheet accuracy figure.
Can a proximity sensor replace a switch that stops the press ram?
Not as a like-for-like swap. If the old switch performs a stopping, guarding or interlocking function, converting it is a safety modification: general-purpose proximity sensors and interface relays carry no safety rating, and ISO 13849-1 requires the safety function to be specified, implemented with safety-rated components and validated. Keep the original safety circuit in place until that work is done under the machine's risk assessment.