Installing and Troubleshooting Sensors

Mounting and alignment, protection, noise and shielding, calibration and a fault-finding flowchart with a symptom table.

Planning an installation

Most “sensor problems” turn out to be installation problems: a bracket that flexes, a cable that rubs, a connector that was never fully tightened, a lens that fogs. Time spent in planning pays back many times. Before mounting a sensor decide:

  • What exactly must be detected and with what margin: the worst-case target (smallest, darkest, farthest, fastest, in the dirtiest condition).
  • Where the target will actually be, allowing for tolerances and wear, not where the drawing puts it.
  • Access: can a technician reach the sensor, see its LED and replace it without removing half the machine?
  • What will hit it, spray it, heat it or shake it, and how the cable is routed away from those things.
  • How it is wired and where it is tested: a spare connector or a test point saves hours later (see Sensor Outputs and Wiring).
  • Spares and standardization: use as few types as you can; label each sensor with its tag, the same as on the drawing.

Mounting and alignment

  • Rigid and adjustable. Use a stiff bracket (a thin flat bar vibrates and shifts the switching point) with slotted holes to adjust, and lock the position with a lock washer or thread-locking compound. Mark the final position with paint.
  • Keep an operating margin. Design to get the reliable (assured) range, not the nominal one: if the target should be sensed at 4 mm with a sensor of Sn = 8 mm that is 50 percent of its nominal distance, leaving a comfortable reserve for temperature, wear and tolerance (see Proximity Sensors).
  • Protect the sensing face. A sensor that is hit by a moving part is destroyed and may not be noticed: put a guard or a stop in front, or mount it so that the target passes beside it rather than towards it.
  • Respect free zones and spacing in the data sheet (flush, non-flush, side by side), and keep metal parts away from non-flush and capacitive faces.
  • Align optical sensors carefully: through-beam pairs on the same line (use the alignment indicator, or a laser pointer), retro-reflective sensors perpendicular to the reflector (but tilt a polarized sensor slightly for shiny objects), diffuse sensors at a slight angle to shiny objects (see Photoelectric and Vision Sensors).
  • Avoid direct sunlight, welding flash and glare into the receiver; a hood or a different position helps.
  • Cable strain relief and bend radius: a minimum bend of about 5 to 10 times the cable diameter (more for moving cables), a clamp near the sensor, and a drip loop so that water runs off the cable and not into the connector.
  • Torque the connector and the nut to the data-sheet value: M12 connectors hand-tight plus a little; a loose one lets in water, an over-tight one cracks.
  • Do not use the sensor as a mechanical part: no stops, no supports, no stepping on it.

Protection: IP ratings and the environment

IP codeProtectionTypical use
IP65Dust-tight; low-pressure water jetsGeneral indoor machinery, light washdown
IP67Dust-tight; immersion to 1 m for 30 minutesMost industrial sensors; temporary submersion
IP68Dust-tight; continuous immersion to a stated depthSubmersible sensors, tank probes
IP69KDust-tight; high-pressure, high-temperature wash (80 °C, 80 to 100 bar)Food, beverage, vehicle washdown
  • Temperature: operate within the stated range. A sensor mounted near a motor, oven or in the sun can be well above the ambient air. High temperatures shorten the life of electronics and LEDs, and lower the sensing range of inductive sensors.
  • Chemicals and cleaning agents: check the housing material (stainless steel, nickel-plated brass, PBT, PTFE) and the cable jacket (PVC, PUR, PTFE) against oils, coolants and disinfectants. Coolants and cutting oil can destroy a PVC cable in weeks.
  • Weld spatter: use sensors with a PTFE coating or a spatter-resistant face, and weld-field-immune types near resistance welders.
  • Vibration and shock: check the data-sheet rating (IEC 60068-2-6 and -27); use lock washers and potted sensors; avoid mounting on a thin sheet that resonates.
  • Moisture and condensation: a connector on the underside, a drip loop and a breather or a sealed sensor prevent condensate in the housing.
  • Explosive atmospheres: use certified sensors (ATEX, IECEx, Class I Division 1/2) with the right barriers, and follow the installation code.

Noise, shielding and grounding

A sensor signal is small and the plant is noisy: variable-frequency drives, contactors, relays and welders all radiate and conduct interference. Most noise problems are fixed by good cabling practice, not by changing the sensor (see also Cabling, Grounding and Noise).

PracticeWhy
Separate signal cables from power cables (motor, drive and mains) in different trays or at least 30 cm apart; cross at 90°Noise couples capacitively and inductively over parallel runs; distance and crossing at right angles reduce it
Use shielded, twisted-pair cable for analog and pulse signalsTwisting cancels magnetic pickup; the shield blocks electric fields
Ground the shield at one end (the controller) for analog low-frequency signals; at both ends (with a good bond) for high-frequency or very noisy installationsOne end avoids a ground loop current that drives noise through the shield; both ends give better screening against radio-frequency noise
Terminate the shield 360° in a clamp, not as a “pigtail”A pigtail adds inductance and loses the screening at high frequency
Suppress inductive loads (relay and solenoid coils, contactors) with a diode, RC snubber or varistor at the coilThe switching spike is the commonest source of false pulses (see Inductors, Transformers and Relays)
Put a ferrite or filter on a noisy cable; use a drive output filter and a shielded motor cableReduces common-mode currents
Use a good, short earth and bond the cabinet and the machine frameGives noise currents a safe path away from the signal ground
Prefer current (4-20 mA) or digital (IO-Link) signals over voltage for long cablesFar more immune to noise and cable resistance

Worked example: a ground loop through the shield

A 100 m cable has a shield resistance of 20 Ω per km, i.e. 2.0 Ω in total. If the shield is grounded at both ends and the two ground points differ by 2.0 V (common near large drives and welders), a current of about 2.0 ÷ (2.0 + a 1 Ω ground path) = 0.67 A would flow through the shield. That current can induce volts in the signal wires and corrupt a millivolt or analog signal. Grounding the shield at one end only, or using an isolator, removes the loop.

Commissioning and setting up

  • Check before power: wiring against the drawing, polarity, the supply voltage at the sensor, the connector seating, and the sensor’s type (NPN or PNP, NO or NC) against the input.
  • Power up and look at the indicator: most sensors have an LED for power and for the output. Check that the output follows the target.
  • Set the sensitivity (teach). For photoelectric and capacitive sensors set the threshold midway between the signal with and without the target (a teach button does this), using the worst-case targets (the darkest, smallest, with the dirtiest background).
  • Verify the margin: check detection at the edges of the allowed position and the worst case; check that it releases properly.
  • Check the PLC side: the input lights up in the program, the address and scaling are right, and the filter time suits the speed (see Sensor Outputs and Wiring).
  • Test the failure mode: disconnect the sensor and a wire and confirm that the machine goes to a safe state and shows an alarm.
  • Record the settings and the sensor’s position (photograph and note), and save an IO-Link or fieldbus device’s parameters.

Maintenance

  • Clean optical lenses and reflectors on a schedule (the dirtiest places weekly): most photoelectric faults are dirt. Use a soft cloth and a mild cleaner, not abrasives that scratch the lens.
  • Check the mounting and the connectors at regular intervals: tight, dry and undamaged. Replace cracked cables and worn glands.
  • Test the sensor during planned stops: put a target in front and see the output; for safety devices follow the required test schedule.
  • Track the failures (which sensor, how often, what environment) and fix the cause: a bracket, a cable, a cooling problem, a wrong sensor type.
  • Keep spares of the critical sensors, and the connectors and cordsets that fail most.
  • Recalibrate analog sensors at the interval in your quality system, and compare the sensor with a reference (see Sensor Basics and Selection).

A fault-finding flowchart

A sensor does not detect: work from the supply to the program1.Is there 10 to 30 V between the sensor’s +Vand 0 V, measured at the sensor with itconnected?NoCheck the fuse, the supply, the connectorand the cable; look for a short or a voltagedrop.Yes2.Does the sensor’s LED light up and followthe target?NoThe sensor, its range or the target is theproblem: check the type, the distance andthe sensitivity.Yes3.Is the target within the assured range, of theright material, size and color?NoRe-position the sensor, use the correctionfactor, or choose another type (see theproximity and photoelectric pages).Yes4.Does the output voltage at the sensor changewhen the target is present (NO or NC asexpected)?NoWrong output type or a damaged output: checkNO or NC, PNP or NPN, and the load current.Yes5.Does the same voltage arrive at the PLC inputterminal, with the right sink or source?NoA broken wire, a wrong common orPNP-versus-NPN mismatch: check the cable andthe card.Yes6.Does the input bit in the PLC change with thesensor?NoThe input address, the filter or the moduleconfiguration: check the I/O configurationand the force table.Yes7.Does the program use the bit correctly (NO andNC, scaling, timers)?NoA logic error: trace the rung, check scalingand engineering units.YesThe sensor works: record the fault and thecause, and check for a pattern (dirt,vibration, noise).
A seven-step fault-finding sequence for a sensor from the supply to the program.

Symptom table

SymptomLikely causeFix
Works for a while, then failsTemperature, a bad connection that heats up, a dirty lens building upCheck the temperature at the sensor; clean; re-terminate; allow warm-up
Works at the bench, not on the machineVibration, noise, ambient light, a different supplyBracket, shielding, a hood, a clean supply
Random false triggersNoise from a nearby coil or drive, a ground loop, sunlightSuppress the coil, separate the cables, ground the shield at one end, shield the sensor
Misses fast targetsThe sensor is too slow, or the input filter or scan time is too longA faster sensor, a high-speed input, a shorter filter time
Detection point driftsTemperature, a loose bracket, dirt build-upRigid bracket, cleaning, a margin in the setting
Dead after a washdownWater in the connector or housing, the wrong IP ratingIP69K sensors, sealed connectors, a drip loop
Sensor damagedHit by a part, a short circuit, over-voltage, chemical attackA guard, a fuse, protection, a different material
A new sensor behaves differentlyA different type, NO and NC swapped, a different rangeCompare the data sheets; set the same parameters

Working safely

  • Lock out and de-energize before replacing a sensor on moving equipment; a sensor failing in the wrong state can start a machine.
  • Do not bypass a safety sensor to “test” anything: a jumper on an interlock switch has killed people. Safety devices are covered in Safety Sensors and Devices.
  • Be careful testing live: a meter on a 24 V DC supply is usually safe, but a cabinet also carries mains. Use the right category of meter and probes.
  • Check laser and UV sensors and their class before looking into the beam.
  • Remove pressure, temperature and flow before taking out a process sensor.

Related

FAQ

What is the quickest way to find out whether the sensor or the PLC is at fault?

Measure the output of the sensor at the sensor with a meter while the target moves. If the voltage changes correctly the sensor is fine; follow the cable to the input terminal, then look at the PLC program.

How do I choose between grounding the shield at one end or both?

For analog and low-frequency signals ground at one end (the controller). For high-frequency noise and in installations with an equipotential bonding system, grounding at both ends is better. When in doubt follow the manufacturer’s instructions and the plant’s grounding plan.

Should I use an air purge?

In dusty, steamy or misty conditions a gentle stream of clean air across a lens or a ultrasonic face keeps it clean and cuts maintenance greatly. Use clean, dry, oil-free air.

How often should I replace sensors?

There is no fixed interval for solid-state switching sensors: replace on failure, and review the failure pattern. Replace analog sensors by drift or the calibration schedule, and safety devices strictly by the maker’s mission time.

References

  • IEC 60529, Degrees of protection provided by enclosures (IP code); IEC 60947-5-2 (proximity switches).
  • IEC 61000-5-2, Earthing and cabling (EMC installation guidelines); Siemens and Rockwell, Wiring and grounding guidelines.
  • Manufacturer installation guides (Pepperl+Fuchs, Sick, Balluff, Banner, Omron) for mounting, spacing and cleaning.

Last reviewed: October 2026. Distances and torques are typical; follow the manufacturer’s installation instructions.