Troubleshooting
Why a Proximity Switch Turns On and Off Intermittently
Short answer
An intermittent proximity switch that ran for years is usually a changed target-to-sensor interface, not dead electronics. Clean the sensing face, measure the actual clearance through full travel against the rated sensing distance and hysteresis, then trace supply, output and cable to the receiving input while the fault is happening. Several switches failing together points at a shared supply or a shifted bracket, not individual sensors.

On this page
A proximity switch that worked for four years and now flips on and off is almost always a changed target-to-sensor interface or an intermittent connection, not sudden electronic failure. Clean the sensing face, re-measure the actual target clearance through the full travel against the sensor's rated sensing distance with hysteresis margin, and only then trace supply, output and cable to the receiving input while the dropout is happening. If several switches misbehave together, suspect the shared supply, a common conductor, or a bracket that has shifted, before replacing any single sensor.
What should you check before replacing the switch? #
Work from the target inward: face, clearance, then wiring, in that order, because the first two cost minutes and the symptom pattern tells you where to go next. Use this list and stop when an observation decides the case.
- Clean the sensing face and the target area first. A film of dirt or metal dust can bias an inductive sensor's switching point or hold it on. If operation changes after cleaning while nothing else did, contamination was loading the sensing condition.
- Check mounting and target clearance. Look for a loose bracket, rub marks showing the target has moved, and measure clearance through full travel. If switching follows a small position change or a hand-push on the bracket, the mechanical interface is the fault.
- Record which switches drop out and whether they do it together. Several at once means the shared supply, a common conductor or common mechanical movement, not individual sensors.
- Measure supply and output at the sensor terminals during a dropout. Supply sagging means a source or wiring problem; supply correct but output wrong with a fixed target means the sensor or its local connection.
- Substitute a matched sensor only after the above. The fault must follow the sensor under the same mounting and wiring to prove the sensor itself failed.
Change one condition at a time, so a temporary recovery tells you something instead of confusing the diagnosis.
Why does target clearance cause intermittent switching? #
An inductive sensor turns on at one distance and turns off at a slightly larger distance, and the gap between those two switch points is the hysteresis. If the target only barely reaches the operating point, vibration, runout or a bracket that has crept a millimeter will carry it back across the release point, and the switch chatters on and off. Manufacturers document this: insufficient hysteresis margin makes a proximity sensor chatter continuously when the target or sensor vibrates, and the effective operating distance of an individual sensor sits at roughly 70 to 80 percent of the rated sensing distance at rated voltage near room temperature.
So clearance is not a judgement call; it is a number from the datasheet of the exact sensor. Worked example, calculated for illustration:
- Rated sensing distance, from the datasheet: 8 mm.
- Expected actual operating point: 0.7 to 0.8 of rated, so 5.6 mm to 6.4 mm.
- Datasheet hysteresis for this example: 1 mm, so the release point sits around 7.4 mm at most.
- Measured closest target approach through full travel: 6.0 mm, but with the axis fully loaded it drifts to 7.2 mm.
At 7.2 mm the target sits inside the hysteresis band, between the operate and release points, so any vibration flips the output. The fix is to move the sensor or the target stop so the closest approach stays near or below 6 mm, well inside the operate point, with the whole hysteresis band left as reserve. Measure the closest and farthest target positions through the real travel, under real load, not with the mechanism parked.
Contamination shifts these points too, which is why cleaning comes first: a conductive film can make a sensor indicate a target that is not there, and a clean face does not compensate for clearance that was never adequate.
Where does the signal stop between sensor and input? #
Once the target position is repeatable, follow the electrical path stage by stage and take each measurement during the dropout, not while everything works. A broken conductor inside a flexing cable or a loose terminal can look fine at rest.
| What you observe during the dropout | What it means | Next check |
|---|---|---|
| Several switches change together | Shared supply, common return or connector, or a moved common bracket | Measure the supply at the distribution point under load |
| Supply at the sensor terminals sags | Voltage loss along the wiring or a weak source | Compare with the supply at its source |
| Supply correct, output wrong, target fixed | Sensor interface or its local connection | Inspect the connector, then substitute a matched sensor |
| Output correct at the sensor, wrong at the input terminal | Cable, connectors or terminal blocks between them | Wiggle-test the cable route section by section |
| Signal correct at the input terminals, program state wrong | Input diagnostics, configuration or logic | Work on the receiving side, not the field sensor |
Interpret the sensor's LED from its documentation: on some sensors it shows power, on others switching state, and it is a clue, never a substitute for measuring the output. Also match the test to the wiring type. A two-wire sensor passes a small leakage current through the load even when off; that is normal, but it can hold a sensitive relay or high-impedance input in an uncertain state. A bleed resistor across the load shunts that current away, with one reported fix starting around 2 kilo-ohms and adjusting from there until the off state pulled down cleanly; treat that as a starting point, not a universal value. For polarity and input-type questions, see why a PNP proximity switch does not fit an active-low input and wiring PNP proximity switches to optocoupler inputs.
How do you run the checks in order without making it worse? #
Follow this numbered sequence; it protects you and produces a recorded baseline.
- Record the failure pattern: which sensors, together or alone, and whether the event follows motion, vibration or cable flexing.
- Isolate motion and stored energy before touching targets, brackets or cables; do energized measurements only under your site's electrical work procedure.
- Document the installation as found: sensor identification, connections, clearance and bracket position.
- Clean and inspect: remove deposits without scratching the face, and look for a damaged face, loose hardware, displaced brackets and rub marks from the target.
- Restore the intended clearance using the datasheet operating distance and hysteresis, then check full travel for collisions.
- Inspect the full cable route: terminations, connector engagement, strain relief, flex points and abrasion, torquing terminals to the specified value rather than by feel.
- Measure during the fault. If a handheld meter misses the event, use a meter or recorder with a min/max or capture function sized to the dropout duration.
How do you prove the fix without fooling yourself? #
Test under normal operating conditions: a target held against the sensing face with the machine stopped does not reproduce the clearance, vibration and cable movement of production. Watch the target, the sensor indication and the receiving input together over repeated complete cycles. A continuity check on a cable at rest can miss a flex-dependent break, and a voltage reading taken only while the switch works cannot explain the failed state; capture the transition instead. Related reading: if your inputs only misbehave during a homing sequence, the cause may be different, as covered in why proximity switch inputs fault only during homing, and if the counts are wrong rather than the switching, see proximity switch noise causes false counter counts.
The decision, case by case: if operation changes after cleaning, the face was the problem; if switching follows bracket movement, re-shim the clearance to the datasheet operating distance with hysteresis margin; if several switches drop out together, fix the shared supply or common path; if supply is correct, the target is repeatable and the output at the sensor is still wrong, replace the sensor with one matched in sensing principle, output type and supply; if the signal is right at the input terminals but wrong in the program, stop replacing field hardware and check the input configuration.
One safety note: never reach into the machine to clean a face or re-shim a bracket while the axis can move; isolate it first and follow the machine's lockout practice and your site's electrical work procedure.
Questions asked
Can a dirty sensing face make an inductive proximity switch stay on?
Yes. A conductive film or metal dust buildup on the face can look like a target to an inductive sensor and hold the output on, or bias the switching point so vibration tips it on and off. Clean the face with a method that will not scratch it, then recheck the switching behavior with the target at its normal operating clearance before concluding the sensor is faulty.
How much clearance should a target have from a proximity switch?
Design for detection at about 70 to 80 percent of the rated sensing distance, which is where the actual operating point of an individual sensor sits under rated conditions. So an 8 mm rated sensor should see the target at roughly 5.6 to 6.4 mm or closer, with the datasheet hysteresis distance added as margin so vibration cannot carry the target back across the release point.
Why do two-wire proximity sensors leak current when off?
A two-wire sensor needs a small standby current to power its electronics, so a few milliamperes flow through the load even in the off state. That is normally harmless, but it can hold a high-impedance input or a sensitive relay in an uncertain state. A bleed resistor across the load shunts that current; one reported fix started at about 2 kilo-ohms and was adjusted until the off state pulled down cleanly.
Should I replace the proximity switch right away?
Not first. Cleaning, clearance and wiring checks take minutes and the symptom pattern often points elsewhere: several switches misbehaving together indicates a shared supply, common conductor or a moved bracket. Replace only after the output is proven wrong at the sensor terminals with the supply correct and the target at a repeatable position.
