claim
---

Pepperl+Fuchs Blog

How to Wire a Proximity Sensor to a PLC

Posted by Sam Horn on Tue, Sep 18, 2018

Connecting a proximity sensor to a PLC can be a daunting task at first glance. For one thing, there is no universal way to connect sensors. The process varies depending on the sensor and input module used in the configuration.

The Basics

The first step is understanding how PLC networks are set up. The four major components of a network include the following:

  1. Power supply
    • The power supply provides power to the CPU, I/O modules, and signal devices.
  2. CPU (sometimes called a processor or controller)
    • A CPU (central processing unit) is essentially the brains of the operation.
    • The CPU takes data from the I/O system and processes it according to what the programmer specifies.
  3. I/O system
    • I/O modules (sometimes referred to as I/O cards) can accept input signals, deliver output signals, or both
    • Input modules can accept digital or analog signals
  4. Signal devices
    • Signal devices can be push buttons, sensors, or switches. In this case, we will talk about sensors.

image-6

Sensors are wired to I/O modules, and I/O modules are wired back to the CPU. It is important to read the wiring diagram of an input module to understand its operation. The module’s operating voltage, input type, and terminal layout are a few of the parameters used to wire up the network. Terms like load, sinking, sourcing, positive or common, PNP, NPN, 2-, 3-, and 4-wire will be used throughout this discussion. To get familiar with some of these terms, read our blog post How to Read a Sensor Connection Diagram.

Input/Output Type

A sourcing (PNP) sensor must run into a sinking input card, while a sinking (NPN) sensor must run into a sourcing input card. This is true because the network can be modeled as a simple circuit, and in order to complete the circuit, current must flow in a complete loop. Some modules can accept both PNP and NPN inputs and are noted on the module’s wiring diagram.

Voltage Polarity (+/-)

The term common refers to a (+/-) reference polarity of a PNP or NPN configuration. A common wire is used to reduce the number of terminal connections made between sensors and a PLC. This wire is noted on the I/O module’s wiring diagram.

PNP sensor outputs switch in a positive (+) fashion. This means that multiple sensors can be connected to an input card with all sensor negative wires to one common (-) wire.

NPN sensor outputs switch in a negative (-) fashion. This means that multiple sensors can be connected to an input card with all sensor positive wires to one common (+) wire.

Hardwire Connections

Input cards do not know the difference between 2-, 3-, or 4-wire sensors, but input cards for 2-wire sensors must be rated to accept the sensor’s voltage drop and off-state current level (noted on datasheets.) Sensors with 3 and 4 wires have dedicated output wires. These output wires are run straight to a module’s input.

Normally open or normally closed sensor logic does not affect physical connections between a sensor and a PLC.

Internal Loads

Sourcing cards have an internal resistive load connected between V+ and its inputs. Sinking cards have an internal resistive load connected between its inputs and V- (also called ground or 0 VDC.) Why is this true? A PNP (sourcing) sensor switches to (+), while the sinking card already has a connection to DC ground. An NPN (sinking) sensor switches to (-), while the sourcing card already has a connection to V+.

 

System Layout

Sensor datasheets show the following:

  • Output type
    • PNP or NPN
  • Output signal
    • Digital or analog; if analog, is it an analog voltage or analog current signal?
    • A digital sensor output must run into a digital input card, and an analog sensor output must run into an analog input card
  • Connection type
    • 2-, 3-, or 4-wire

The input card’s datasheet shows the following:

  • Sinking or sourcing
    • Some cards can accept both PNP and NPN inputs
  • I/O connection
    • Some cards have only input terminals, some have only output terminals, and some have both
    • Sourcing cards generally have only common and input terminals, while sinking cards generally only have V+ and input Cards that can sink and source may have common, input, and V+ terminals
  • Power operation
    • AC, DC

PNP & NPN: Why Does This Matter?

In a PNP configuration, the sensor output is internally connected to the positive voltage polarity. To make a complete circuit, the load (PLC input) must be externally connected to a negative (common) voltage polarity. In an NPN configuration, the sensor output is internally connected to the negative voltage polarity. To make a complete circuit, the load must be externally wired to a positive (common) voltage polarity:

Powering the Sensor and Input Module

How the sensor is connected to a power source depends on whether the sensor has a PNP or NPN output type. A PNP sensor is typically referred to as a sourcing sensor, which means the sensor can be thought of as sourcing (or giving) signal input power to the I/O card. An NPN sensor is typically referred to as a sinking sensor, which means the sensor can be thought of as sinking (or receiving) signal input power from the I/O card.

Which wire goes where?

Recall that a sourcing (PNP) sensor sends power and signal to a sinking module, while a sinking (NPN) sensor receives power and signal from a sourcing module. PNP sensors switch to (+), while NPN sensors switch to (-).

Sinking input cards have a load internally connected between its inputs and a DC ground terminal. To complete the circuit, the PNP sensor switches to (+). Sourcing input cards have a load internally connected between its inputs and a +VDC terminal. To complete the circuit, the NPN sensor switches to (-).

Pulling It All Together

  • Step 1: Identify the Network Parameters
    • Output type
    • Output signal
    • Connection type
    • Sinking/sourcing
    • I/O connection
    • Power operation
  • Step 2: Connect Sensor Output(s) to PLC Input(s)
    • 2-wire configurations
      • PNP sensor (load externally wired to negative terminal)
        • Sensor (-) wire is run straight to PLC input
      • NPN sensor (load externally wired to positive terminal)
        • Sensor (+) wire is run straight to PLC input
      • 3-wire configurations
        • PNP sensor
          • Sensor output wire is run straight to PLC input
        • NPN sensor
          • Sensor output wire is run straight to PLC input
        • 4-wire configurations
          • PNP sensor
            • Sensor output wires are run to separate PLC inputs
          • NPN sensor
            • Sensor output wires are run to separate PLC inputs
  • Step 3: Connect Sensor and Input Module to Power
    • 2-wire configurations
      • PNP sensor
        • Sensor (-) wire is run straight to PLC input
        • Sensor (+) wire is run to +VDC
      • NPN sensor
        • Sensor (+) wire is run straight to PLC input
        • Sensor (-) wire is run to 0 VDC (negative terminal) on the power supply
      • 3-wire configurations
        • PNP sensor
          • Sensor (+) wire is run to +VDC power supply
          • Sensor (-) wire is run to common (0 VDC) on the input card
        • NPN sensor
          • Sensor (+) wire is run to +VDC on the input card
          • Sensor (-) wire is run to common (0 VDC) power supply

In Practice: A Brief Overlook

An Allen-Bradley ControlLogix 1756-IB16D Input Module is used in this example. From the catalog found on Rockwell Automation’s website, it can be seen that this is a Digital Sinking Input module. Input devices (sensors, switches, push buttons) are connected at the right, and common (ground) wires for the devices and power supply are connected at the left. The power supply is depicted at the bottom of the diagram.

                                                                                                                                                                 How is a sensor wired to this module?

Thinking of the circuit in terms of current flow, red arrows on the diagram above depict the direction of current flow to show that current flows out of the power source at the positive terminal and into the sensor. When the PNP sensor detects a target, it will switch to positive and close the circuit to send a signal through the output wire into the input card. The input card is sinking, which means its internal load is connected between its input terminals and ground. It must complete the circuit by connecting a common (-) polarity wire to the negative terminal of the power source.

An Allen-Bradley ControlLogix 1746-IV16 Input Module is used in this example. From the catalog found on Rockwell Automation’s website, it can be seen that this is a Digital Sourcing Input module. Only sinking (PNP) sensors can be connected to this module. How does this circuit operate?

Current flows out of the positive terminal of the power supply into the input module. In this case, the input module is sourcing power to the sensor. Current flows out of the input module from the V+ terminal (where the input card’s internal load is connected between V+ and its input terminals) into the sensor to power the sensor. The NPN sensor switches to (-) and sinks power back to the power supply to complete the circuit.

 

The Importance of Terminology

In industry, most PLC manufacturers do not model PLC Networks in terms of current. For simplicity of this discussion, the setup is modeled as a circuit with current flow to help distinguish PNP- and NPN-type circuits.

2-wire DC PNP, 2-wire DC NPN, 3-wire DC PNP, and 3-wire DC NPN cases have been covered in this discussion. Connecting a 4-wire DC sensor is the same as a 3-wire sensor, but each output wire is connected to a different input on the input card. Examples used in this discussion are common setups in modern industry but vary depending on the application.

Topics: PLC, proximity sensors

Subscribe to Email Updates

Recent Posts

Search our blog!

Loading Google Custom Search.....

Follow Me