AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

Troubleshooting

Proximity switch noise causes false counter counts

Sensors, encoders and machine vision on the machine Published 10 min read By AutomateDirectUSA engineering team

Short answer

False counts on a high-speed counter input are coupled current lifting an idle PNP signal line. Fit a bleed resistor from the signal wire to the channel's input common at the card: start at 10 kΩ, step to 2.2 kΩ on a 0.6 W part, then 1 kΩ on 1 W — all far inside a 200 mA output rating at 24 V — and verify the loaded high state still crosses the card's threshold.

On this page
  1. What the false counts actually are
  2. Where the coupled current enters
  3. Measure at the counter terminal before changing anything
  4. Sizing the bleed resistor for a 24 VDC PNP output at 10 kΩ, 2.2 kΩ and 1 kΩ
  5. Fit the bleed and prove the counting path
  6. When a capacitor or a channel filter is worth adding
  7. When the bursts track one machine event
  8. Questions asked

A PNP proximity switch feeding a high-speed counter card can switch cleanly at the sensor and still register counts that never happened: short coupled spikes, 10 to 15 V on the scope, arriving while no target is anywhere near. The spikes are interference current finding a high-impedance idle signal line and lifting it past the card's input threshold. The fix is a bleed resistor from the signal wire to that counter channel's input common, fitted at the card: it gives the coupled current a low-impedance return and holds the idle terminal near common. Start at 10 kΩ and step down through 2.2 kΩ to 1 kΩ as needed, size the part for its continuous dissipation, verify the loaded high state still crosses the card's threshold, and add a capacitor only within the sensor's permitted capacitive load. The arithmetic is worked below, then the fitting and proof steps.

What the false counts actually are #

The reported symptom at the card: bursts of 10 to 15 V on a line that should sit near common, each burst spending less than 20 µs above 5 V, and the counter incrementing as though the switch had fired. A high-speed counter input is more exposed to this than an ordinary digital input because its whole job is to resolve pulses a normal input would ignore — its channel settings, such as pulse input mode, counting speed and counter type, are configured per channel in the module for exactly that purpose. Before judging any scope capture, read the card's installation sheet: it states the nominal input levels the channel accepts (5, 12 or 24 V on cards that take direct sensor connections) and the switching thresholds those levels correspond to.

The second half of the mechanism is the sensor output itself. When a three-wire PNP output turns off, it stops driving and does not pull the line anywhere; the idle line is then held only by the card's input impedance, and the sensor's own off-state leakage is a datasheet figure in the microamp range for that output family. Any current coupled into the cable, magnetic or capacitive, therefore develops real voltage on the terminal. How a PNP output sits in the circuit and what the receiver sees from it is covered in wiring PNP proximity switches to optocoupler inputs.

Where the coupled current enters #

Work down this list before swapping any component; each item carries its own confirming check, cheapest first.

  • Interrupted or high-resistance return. The card's input current must get back to common; a corroded return terminal turns the whole run into a receiving antenna. Confirm with a continuity check from the sensor's 0 V conductor to the card's input common, panel locked out, then with the machine running measure the voltage between sensor common and card common — it should read in the millivolts.
  • Shield bonded against the installation sheet. Shielded cable only works when the shield lands where the sensor and card installation sheets say it lands. Confirm by following the drain wire at both ends and comparing with those sheets, not by adding bonds on suspicion.
  • Routing beside switching conductors. Drive output cables, contactor coils and brake coils couple into a parallel sensor run for its whole length. Confirm by cycling each suspect load with the sensor idle and watching the counter: a burst that follows one load is a routing fault with an address.
  • Loose terminals or damaged cable. Confirm by flexing the cable at the sensor and at the gland while watching the idle line on the scope.
  • The sensor's own output stage. Output families differ in off-state impedance and internal snubbing. Confirm by substitution — last, after the path is proven clean.

Measure at the counter terminal before changing anything #

The decisive measurement is the voltage between the counter's signal terminal and that channel's input common, because that is exactly the voltage the card evaluates. Ground the scope probe with the shortest possible connection at a common point beside the terminal: a long ground lead forms a loop that picks up the same interference and displays spikes the card never sees. Capture the same two points at the sensor end as well — a clean waveform at the sensor and a disturbed one at the card put the fault in the cable or the return, while disturbance at both ends points at the sensor, its supply, or a shared source. Trigger on the amplitude and note which machine event each burst coincides with; a correlation to one drive or contactor is the cheapest diagnostic this fault offers. One safety rule for the probing itself: never clip an earth-referenced probe ground onto a live potential, and fit components only with the panel locked out.

Sizing the bleed resistor for a 24 VDC PNP output at 10 kΩ, 2.2 kΩ and 1 kΩ #

The inputs, each from its own source: the supply is 24 VDC, measured between +24 V and the channel's input common at the terminals; the sensor family datasheet gives a maximum output current of 200 mA at 24 V for the PNP version (100 mA at 12 V in the same DC family); the fitted trial is the bleed resistor already on this machine, which reduced the bursts but did not stop the false counts; the observed disturbance is the 10 to 15 V lift at the card; the card's own input current comes from its installation sheet.

Two rules set the size. On-state, with the PNP output conducting, the bleed sees the full supply: current I = V/R, dissipation P = V²/R, and the bleed current adds to the card's input current inside the sensor's output rating. Off-state, the induced spike voltage equals the coupled current multiplied by the bleed resistance, so each step down divides the spike by the same factor.

On-state arithmetic at 24 V: a 10 kΩ bleed draws 24 V / 10 000 Ω = 2.4 mA and dissipates (24 V)² / 10 000 Ω = 0.058 W, well inside a standard 0.25 W part. At 2.2 kΩ it draws 10.9 mA and dissipates 0.26 W — a 0.6 W part carries that with about 2.3 times margin. At 1 kΩ it draws 24 mA and dissipates 0.58 W — a 1 W part, about 1.7 times margin. The heaviest bleed therefore leaves 200 mA − 24 mA = 176 mA of the sensor's rating before the card's input current and any other load on that output.

Off-state arithmetic: the observed lift across the fitted trial means the coupled current is 10 V / 10 000 Ω = 1.0 mA up to 15 V / 10 000 Ω = 1.5 mA. The same 1.0 to 1.5 mA across 2.2 kΩ lifts the terminal 2.2 to 3.3 V; across the smallest value it lifts 1.0 to 1.5 V.

Bleed resistor On-state current at 24 V On-state dissipation at 24 V Smallest part rating
20 kΩ 1.2 mA 0.029 W 0.25 W
10 kΩ 2.4 mA 0.058 W 0.25 W
2.2 kΩ 10.9 mA 0.26 W 0.6 W
1 kΩ 24 mA 0.58 W 1 W

The top two rows are the trials this machine already ran; the second row reduced the bursts without stopping the counts. All rows are calculated at the same full-supply conditions for comparison.

Result: the smallest bleed divides the induced lift by a factor of ten against the fitted trial — from the observed 10 to 15 V down to 1.0 to 1.5 V — while costing 24 mA of continuous load, far inside the sensor's rating.

The decision: after the fitted trial has not stopped the counts, fit the next row down from the table, on the part rating that row states, between the signal terminal and the input common at the card; if bursts still count, fit the smallest row and stop there. The thresholds that close the case come from the card's installation sheet: with the bleed fitted, the measured high state must stay above the published on-threshold at the highest voltage the supply delivers, and the calculated induced lift must stay below it. If both margins hold and counts persist, the noise is not entering at this terminal — go back to the path.

Fit the bleed and prove the counting path #

  1. Record the starting point: the channel's configured input mode, counting speed and filter settings, the scope captures, and the count error reproduced against a known number of events.
  2. Lock out the panel, then fit the resistor directly across the signal terminal and that channel's input common at the card — at the receiver, where the counts are made, not at the sensor — secured and insulated as a permanent component rather than a dangling lead.
  3. Restore power and re-capture both pictures: the idle line while the machine's switching loads cycle, and the valid switch pulses at their fastest.
  4. Run the known-count test: pass a target past the sensor a known number of times at the machine's fastest counting condition and require the counter to show exactly that number. The same comparison of known events against counter increase underlies measuring RPM with a proximity switch on a pulley, and it is the only proof that counts.
  5. Check the resistor under sustained load: hold the output on through its longest realistic duty, confirm the part runs cool within its rating, and recalculate dissipation at the highest voltage the supply delivers — heating rises with the square of the voltage, so a supply trimmed 10 percent high heats the part about 21 percent more.
  6. Leave channel filter settings for last, after the hardware margins hold; the next section explains why.

A bleed repairs the terminal, not the path: it will not fix an interrupted return or a mis-bonded shield, and if the counts reappear whenever a cable is moved, the routing item earlier in this article is the real fault.

When a capacitor or a channel filter is worth adding #

The next hardware step is a 100 nF capacitor in parallel with the bleed, fitted at the card. It shunts fast bursts, but it also loads every legitimate rising edge: its charging current flows through the sensor's output transistor and adds to the cable capacitance already present. Check the sensor datasheet for a permitted capacitive load before fitting; if the output family documents no such figure, treat the capacitor as unverified and leave it out.

For an idealized falling edge, with the sensor fully off and the bleed the only discharge path, the time constant is τ = R × C: the smallest bleed in the table with 100 nF gives about 100 µs, the middle value about 220 µs. Those are slow edges, and the card must still resolve them cleanly at the machine's counting speed.

The cheaper first step is often the card's own channel filter. Counter modules set pulse input mode, counting speed and filtering per channel, and a filter long enough to reject a burst shorter than 20 µs will also reject any valid pulse of similar width. For a worked walk-through of the channel setup, configuring a CP1H high-speed counter for an encoder input shows the input-mode and counting-speed settings on one PLC family. The other side of the trade-off, qualifying the shortest pulse a channel still resolves, is laid out in why a PLC misses short input pulses and how to catch them. Decide from two numbers you measure yourself: the shortest valid interval the machine must count and the longest burst it must reject. If they overlap, no filter value exists and the hardware fix above is the route.

When the bursts track one machine event #

If the correlation test tied the bursts to one servo axis or one contactor, use that lead. Reroute the sensor cable away from that drive's output conductors — crossing at right angles beats running parallel — restore the shield bond the installation sheets specify, and recheck the return at both ends. A burst that appears only when a specific axis accelerates is coupling, not counting, and no resistor value repairs a cable run that shares its length with a drive output. If the path is proven clean and the disturbance still reaches the card, the sensor's output stage is the remaining suspect: output families differ in off-state impedance and internal snubbing, so substitute a sensor from a different family and repeat the known-count test before closing the job. Whatever changes — resistor, capacitor, routing, filter, sensor — the known-count test is the gate at the end.

Questions asked

Why does the bleed resistor go to the input common and not to earth?

The card decides high or low from the voltage between the signal terminal and that channel's input common, so the bleed must return the coupled current to exactly that point. Protective earth is a different reference: tying the signal line to it injects ground-potential differences into the measurement and can make the counting worse. Keep them separate unless the machine's drawings join them deliberately.

Should the bleed go below the smallest value in the table?

No. Below it, the continuous bleed current and the resistor's heating keep climbing whenever the output is held on, while the induced spike from this fault's coupled current is already down near the card's noise floor. If false counts persist at the smallest value with both threshold margins verified, the noise is entering through the cable or the return path, and a smaller resistor cannot reach either.

Does the same fix apply to an NPN proximity switch?

Mirror it. An NPN output pulls the line to common when active and leaves it floating when idle, so the vulnerable state is the idle high line. Fit a pull-up resistor from the signal wire to the card's positive input terminal instead, sized with the same current and dissipation arithmetic against the sensor's rated sink current, and confirm the loaded low state still sits below the card's published off-threshold.

Can I fit the bleed resistor at the sensor end instead of at the card?

You can, but the card end is where it pays. The counts are made at the card's input pair, so a bleed at the receiver holds down exactly the voltage the card evaluates. At the sensor end, cable impedance sits between the shunt and the counted point, and coupled current can still lift the terminal. If layout forces the sensor end, re-run the known-count test and confirm the burst amplitude at the card actually fell.

Keep reading

  • How-to

    Measuring RPM With a Proximity Switch on a Pulley

    One bolt pass per revolution at 6,000 RPM is a 100 Hz signal any standard inductive proximity switch can produce and a scanned PLC input cannot reliably count, so route it to a high-speed input and verify the ON pulse clears the input's documented minimum — 100 µs on the DL05's X0–X2 inputs — with a scope at full speed.

    Sensors, encoders and machine vision on the machine

  • Selection guide

    Where to Mount a Proximity Switch for Induction Motor Speed Feedback

    Mount the inductive proximity switch on the motor's own shaft, rear stub if there is one, otherwise the drive-end stretch, sensing a single metal flag whenever the number you need is motor RPM. One flag keeps the pulse rate near 29 Hz at 1750 RPM, far inside a 200 Hz sensor. Use the VFD's estimate when the drive already runs the motor and an estimate suffices; use an encoder when speed is critical to control.

    Sensors, encoders and machine vision on the machine

  • How-to

    Sizing a Spindle Encoder Input for Servo Feed Control

    A 2000 PPR quadrature encoder on a 250 RPM spindle produces 33,333 counts/s, which fits a 50 kHz counter but overruns a 10 kHz variant; the most resolution that counter family allows is 3000 PPR. Scale feed per revolution to motor RPM through screw lead and gear ratio, then keep command pulses per revolution low enough that rapid speed stays under the 100 kHz pulse-output ceiling.

    Sensors, encoders and machine vision on the machine