AutomateDirectUSAMotion LibraryIndustrial monitors & PCs

How-to

Wiring a Proximity Switch to Trigger a Robot Gripper and Conveyor

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

Short answer

Wire the sensor's positive and 0 V supply wires to the 24 V DC source and the switched output wire to a robot digital input, taking all three terminal assignments from the sensor datasheet rather than wire color. Confirm the input changes state at Menu > I/O > Digital, then prove the 3-second conveyor run lands the part in the next slot over many cycles, because a timed index only matches the slot pitch while travel stays repeatable.

On this page
  1. Identify the three wires from the datasheet
  2. Wire the switch to the robot input
  3. Configure the digital input on the teach pendant
  4. Program the pick-and-place sequence
  5. Checking a 3-second index against a 260 mm slot pitch
  6. When to index by distance instead of time
  7. Questions asked

The electrical part is three connections: the sensor's supply-positive terminal to the source's positive, its 0 V terminal to the source's return, and its switched output to one digital input on the robot controller — with every assignment taken from the sensor datasheet, never from wire color. On the teach pendant, open Menu > I/O > Digital, set that channel as an input, and confirm its state changes as a target comes and goes. The functional half deserves the same care: a 3-second conveyor command moves exactly one slot pitch only while the conveyor repeats its travel, so the sequence is finished when parts seat in their slots cycle after cycle, not when the wiring works.

Identify the three wires from the datasheet #

A three-wire DC proximity switch carries two supply connections and one switched output. The datasheet names which wire or pin serves each function, and it is the only authority; treat wire color as a hint to verify, not as a fact.

The output type is the decision that matters:

  • PNP (sourcing) applies +24 V to the load when it detects; the load returns to 0 V.
  • NPN (sinking) pulls the load down to 0 V when it detects; the load returns to the positive rail.

Most robot and PLC input circuits at this DC level are built for PNP sourcing sensors, so a PNP output is the right call unless your controller's I/O manual says otherwise — and that manual, not convention, is what the wiring must satisfy. Why an optocoupled input cares about sourcing versus sinking is covered in wiring PNP proximity switches to optocoupler inputs.

Close the electrical check with two ratings: the sensor's supply voltage range and maximum load current from its datasheet, and the input's rated voltage and current draw from the robot I/O manual. An optocoupled input draws only milliamps, so a standard sensor-to-input pairing at this voltage passes by inspection; the check earns its keep the day someone substitutes a sensor with a different supply range or hangs a relay coil on the same output.

Wire the switch to the robot input #

Land these wires with the supply off and the conveyor drive locked out, and run the first live tests with hands out of the envelope at the reduced speed your machine's risk assessment allows; robot system integration is the subject of ISO 10218, and your risk assessment sets the test conditions.

  1. Write down the sensor's three terminal functions from its datasheet: supply positive, supply return, switched output.
  2. Connect the two supply wires to DC distribution that shares its 0 V reference with the robot I/O common. A separate supply is acceptable only if its negative is bonded to that common.
  3. Connect the switched output to the digital input channel you chose on the robot's I/O board.
  4. Restore power and present a metal target at the sensing face. The sensor's LED must light with the target and drop without it; no LED means supply polarity or a wrong terminal, so re-read the datasheet before moving any wire.
  5. Leave the robot logic alone during this test — the goal is to prove the sensor on its own.

Configure the digital input on the teach pendant #

  1. Navigate to Menu > I/O > Digital on the pendant.
  2. Set the connected channel as a digital input and give it the signal name your sequence will reference.
  3. Present and remove a target and watch that channel on the screen: ON with the target present, OFF without it, no flicker while the target sits still.
  4. If the controller offers an input filter, enable a short one. Speed is not a constraint: one widely used sensor line documents a 50 Hz maximum switching frequency for its DC three-wire models, and part presentation never approaches that.

Program the pick-and-place sequence #

Keep the sensor input, the gripper command and the conveyor command as separate states you can observe on the pendant, so a stop shows which stage failed:

  1. WAIT_PART: idle until the proximity input turns ON.
  2. CLOSE_GRIPPER: command the gripper closed and wait for confirmation — on a pneumatic gripper, its magnetic piston sensor, or failing that a fixed grip delay longer than the cylinder's worst-case stroke time.
  3. MOVE_TO_PLACE: carry the part over the next slot and open the gripper.
  4. INDEX_CONVEYOR: run the conveyor for the 3-second command, then stop.
  5. Return to WAIT_PART.

Add a part-present timeout — a sensor stuck ON or OFF far longer than one cycle takes stops the sequence with an alarm — and a cycle counter for the verification runs below.

Checking a 3-second index against a 260 mm slot pitch #

The 3-second command is the application's value; the pitch and the travel are this example's measurements, taken the way you would take them on your own conveyor.

Inputs:

  • Conveyor run command: 3 s.
  • Slot pitch: 260 mm, measured center-to-center along the belt.
  • Travel per command: 248 mm, from marking the belt at the stop position, running one commanded index, and measuring between the marks.

Rule in words: a timed index is acceptable only when the travel per command equals the slot pitch, because any error accumulates — each stop becomes the next start.

Arithmetic:

  • Shortfall per cycle: 260 mm − 248 mm = 12 mm.
  • Corrected command: 3 s × (260 mm ÷ 248 mm) = 3 s × 1.048 = 3.145 s, so set 3.15 s.
  • Check: 248 mm × (3.15 s ÷ 3 s) = 260.4 mm, within 0.4 mm of the pitch.

Measure the travel instead of computing it from belt speed: the drive spends part of every 3-second command ramping up and down, so average speed sits below the set speed, and belt stretch and load add more. The mark-and-measure method captures all of it in one number.

Decision: set the command to 3.15 s, then run 20 consecutive cycles at production speed and check where the 20th part sits in its slot. If the landing error stays inside half the clearance between the part and the slot walls, timed indexing holds on this machine. If the travel varies cycle to cycle by more than that, no timer value is stable — index by distance.

When to index by distance instead of time #

Two standard fixes remove the timer's dependence on ramp time and load:

Questions asked

Can I go by wire color, brown, blue and black?

Only as a hint to verify. The common DC convention is brown for positive, blue for 0 V and black for the switched output, but the sensor's datasheet is the only authority, and conventions vary across connector types. Two minutes with the datasheet before energizing anything is cheaper than a reversed output into an input card.

Does the robot input need a PNP or an NPN sensor?

Match the sensor to the input circuit, not the other way round. Most robot and PLC inputs at this DC level are designed for PNP sourcing sensors: the sensor switches the positive rail into the input and the current returns through the common. Your controller's I/O manual states the requirement. An NPN sensor on a PNP-style input never pulls it ON without added hardware, which is the classic no-signal fault.

The wiring checks out at the pendant, so why do parts miss slots after a few cycles?

Because the error in a timed index accumulates: each stop becomes the next start, so the example's 12 mm shortfall gets 12 mm worse every cycle. Measure the travel of one commanded index against the slot pitch, rescale the timer by the ratio, and verify over 20 cycles. If travel still varies by more than half the part-to-slot clearance, switch to distance-based indexing.

How many cycles prove the sequence before I call it done?

Run at least 20 complete cycles at production speed with the normal load on the belt, and check where the last part seats. Ramp behavior, belt stretch and load effects only appear loaded and warmed up. A sequence proved only empty and slow has not been verified; one that seats the 20th part squarely has.

Where do I watch the input change state before writing any program logic?

Under Menu > I/O > Digital on the teach pendant: the channel reads ON with a target at the sensing face and OFF without it, changing exactly with the target. If the state flickers while the target is stationary, shorten the sensing gap or enable the controller's input filter before touching the logic.

Keep reading

  • How-to

    Wiring PNP proximity switches to optocoupler inputs

    Give every PNP three-wire proximity switch its own optocoupler input, and combine after isolation when one axis has two endpoint switches. Size each series resistor as R = (Vsupply - Vdrop - VF) / IF from worst-case datasheet values: at 24 V with a 0.5 V sensor drop and a 1.2 V LED that gives 2.2 k ohm at 10 mA. Never copy a resistor from another board, and never series the sensor outputs.

    Sensors, encoders and machine vision on the machine

  • How-to

    Robot Conveyor Tracking: Wire the Encoder to the Controller

    Yes, a PC application can feed part data to a tracked conveyor pick, but it must never own position. Terminate the quadrature encoder and the part-detect proximity switch on the robot controller's conveyor tracking input so the switch edge latches the count in hardware; the PC sends only class, offsets and grip choice. Live coordinates streamed through a PC arrive stale by the round trip, and at 300 mm/s every 10 ms costs 3 mm at the gripper.

    Sensors, encoders and machine vision on the machine

  • 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