Home » Blog » NPN PNP outputs: how to wire a switch or sensor to a PLC

NPN PNP outputs: how to wire a switch or sensor to a PLC

Numbered wires on terminal blocks inside a control panel, with labelled fuses and two lit indicators

NPN PNP describes the two ways a transistor switching output connects to its load. An NPN output sinks current to 0 V, while a PNP output sources current from the positive supply. This guide explains how each one wires to a PLC input card, what happens when they are mixed, and where two-wire switches fit.

The examples come from the Leitenberger pressure switches that PIC Engineering supplies, read from the maker’s datasheets. However, the same NPN PNP rules apply to any 24 V DC switch or sensor. Makers do not all label their terminals alike, so always check the device’s wiring diagram before you connect it.

NPN PNP: the short answer

  • A PNP output switches the positive supply onto the load. The load sits between the output and 0 V. This is a sourcing output.
  • An NPN output switches the load to 0 V. The load sits between the positive supply and the output. This is a sinking output.
  • A sourcing (PNP) device needs a sinking input, one whose common goes to 0 V. Likewise, a sinking (NPN) device needs a sourcing input, one whose common goes to the positive supply. Some PLC makers use the two input names the other way round, so go by the common, not the word.
  • If the two are mismatched, current cannot flow the way the input expects, so the input never switches.
  • A mechanical switch contact has no polarity and suits either input. A two-wire electronic sensor, however, always passes a small current, so the input type matters.
  • Among the Leitenberger electronic pressure switches on PIC’s pages, the DS models have PNP contacts, while the LDS 350-IO is switchable between PNP and NPN.

What PNP and NPN outputs do

An electronic switch has no moving contact. Instead, a transistor connects its output terminal to one side of the supply. A three-wire device therefore has three connections: supply positive, supply negative and the output.

PNP: the sourcing output

When a PNP output is on, it connects the output terminal to the positive supply. The load, for example a PLC input or a relay coil, sits between the output and 0 V. Current then flows out of the device, through the load and back to 0 V. Because the device supplies the current, it is called a sourcing output.

NPN: the sinking output

When an NPN output is on, it connects the output terminal to 0 V instead. Here, the load sits between the positive supply and the output. Current then flows from the supply, through the load and into the device. Because the device takes the current down to 0 V, it is called a sinking output.

The two names come from the type of transistor in the output stage. In addition, the transistor drops a little voltage. For its versions with a 4 to 20 mA output, for example, the Leitenberger DS 200 datasheet gives the switched voltage as the supply minus 2 V. On a 24 V supply, that leaves about 22 V at the load.

The table below sums up the NPN PNP difference.

Point PNP output NPN output
Also calledSourcingSinking
When on, the output connects toSupply positive0 V
The load sits betweenThe output and 0 VSupply positive and the output
Current at the output terminalFlows out of the deviceFlows into the device
PLC input it needsSinking input (common to 0 V)Sourcing input (common to supply positive)

Sinking and sourcing PLC inputs

The NPN PNP choice only makes sense together with the input card. A PLC input is the load, so it must complete the circuit that the device starts. Current enters at one terminal and leaves at another. Usually, a group of inputs shares the return terminal, which is called the common.

  • A sinking input provides a path to 0 V. Its common goes to the supply negative, and the field device switches the positive supply onto the input terminal. Siemens describes it the same way: the switch sits between 24 V DC and the module, and 24 V means logic 1.
  • A sourcing input provides a path to the positive supply. Its common goes to the supply positive, and the field device switches the input terminal to 0 V. In the Siemens table, the switch sits between the module and ground, and 0 V means logic 1.

Some cards are sink/source types, which let current flow in either direction. On those, the wiring of the common decides the type. However, every input that shares a common must be wired the same way.

IEC 61131-2 is the equipment standard for PLCs. According to a Siemens support note, it defines its three standard input types for current-sinking inputs. Moreover, the IEC lists negative logic digital inputs and outputs among the additions in the 2017 edition, IEC 61131-2:2017.

Makers do not use the words the same way

Here two genuine sources disagree, so both are given. AutomationDirect and Siemens name an input by what the input itself does. Under that naming, a sinking input takes current in, so it pairs with a PNP device. Mitsubishi’s FX3S hardware manual, by contrast, lists its sink input for NPN open collector sensors and its source input for PNP ones. As a result, one maker’s sink input is another maker’s source input. Therefore, never order or wire by the word alone. Instead, find the card’s wiring diagram and see where its common terminal goes.

How to wire NPN PNP outputs to a PLC input card

These steps assume a 24 V DC three-wire device and the naming used by Siemens and AutomationDirect. In every case, check the device’s wiring diagram and the card’s manual first.

PNP output to a sinking input

  1. Connect the supply positive to the device’s supply positive.
  2. Next, take 0 V to the device’s supply negative and to the input card’s common.
  3. Finally, wire the device’s output to the input terminal.

When the switch operates, current flows from the supply positive, through the device’s output and into the input. It then leaves through the common and returns to 0 V.

NPN output to a sourcing input

  1. Connect the supply positive to the device’s supply positive and to the input card’s common.
  2. Next, take 0 V to the device’s supply negative.
  3. Finally, wire the device’s output to the input terminal.

When the switch operates, current flows from the supply positive into the common and through the input circuit. It then leaves by the input terminal, enters the device’s output and returns to 0 V.

Pins, wire colours and current

For a three-wire DC sensor with a normally open output, Pepperl+Fuchs gives the EN 60947-5-2 layout: brown on pin 1 for positive, blue on pin 3 for negative and black on pin 4 for the output. The M12 plug of the Leitenberger LDS 350-IO uses the same pins. Its datasheet gives pin 1 as supply positive, pin 3 as supply negative, pin 4 as output 1 and pin 2 as output 2.

Even so, mixing up PNP and NPN is not the only trap, so do not wire by habit. For its cable version, the DS 200 datasheet lists white as supply positive, brown as supply negative and grey as contact 1. Consequently, a technician who assumes that brown is positive would connect it backwards. The datasheet says that reverse polarity does no damage, but the switch does not work.

Finally, check the current. Every transistor output has a maximum switching current. For instance, the LDS 350-IO datasheet gives 150 mA. The DS 200 sheet gives 125 mA for standard versions with a 4 to 20 mA output, and 70 mA for the intrinsically safe version. A PLC input needs only a few milliamps, so either drives it easily. A relay coil or a solenoid, however, needs checking against that limit.

What happens when NPN and PNP are mixed

Sinking and sourcing points conduct in one direction only. Suppose a PNP device is wired to a sourcing input. Both sides then offer a path to the positive supply, and neither offers a path to 0 V. As a result, no current flows, and the input stays off whatever the pressure does. Similarly, an NPN device on a sinking input leaves both sides tied to 0 V, with the same result.

After a mismatch between PNP and NPN, nothing looks broken, which is the real hazard. The switch’s own status LED may still change, yet the PLC never sees the signal. For an alarm or a trip, that is a hidden failure. Therefore, prove every input during commissioning by operating the switch and watching the input.

There are three ways out of a mismatch:

  • Change the output type. Choose a device with the right output, or one with an NPN PNP selectable output, and set it to suit the card.
  • Rewire a sink/source card. Move the common of that input group, and keep every input on the group the same type.
  • Add an interposing relay. The transistor output drives the relay coil as its load. The relay’s contact, which has no polarity, then feeds the input.

Two-wire and three-wire switches

Mechanical contacts

A mechanical pressure switch is the simplest two-wire device. Its micro switch is a plain contact with no polarity. It can therefore sit between 24 V and a sinking input, or between a sourcing input and 0 V. When it is open, no current flows. Leitenberger’s diaphragm and Bourdon tube switches work this way, as our guide to mechanical pressure switches explains.

Two-wire electronic sensors

A two-wire electronic sensor, such as a two-wire proximity switch, is different. It sits in series with the load and takes its own power through the same two wires. As a result, it is never fully open and never fully closed:

  • When off, a small residual current still flows. According to Pepperl+Fuchs, it is generally below 1 mA. Even so, on a high-impedance input it can build enough voltage to look like an on signal.
  • When on, the sensor drops several volts. On a low supply voltage, the input may then see too little voltage to register the signal.

The residual current must therefore stay below the input’s switching threshold. For that reason, the input type matters. The Siemens note summarises the three IEC 61131-2 types as follows, with the limits for 24 V DC taken from EN 61131-2:2003. That edition is older than the 2017 one, so treat the figures as a guide and take the real limits from the card’s manual.

Input type Meant for Signal 1 voltage Signal 1 current
Type 1Mechanical contacts, and three-wire semiconductor sensors. Not for two-wire semiconductor sensors15 to 30 V2 to 15 mA
Type 2Two-wire semiconductor sensors; higher power consumption11 to 30 V6 to 30 mA
Type 3Two-wire and three-wire semiconductor sensors; lower power consumption11 to 30 V2 to 15 mA

Between the on and off ranges, the standard also defines a transition range. The card’s manual gives the figure to compare with the sensor. Mitsubishi’s FX3S manual, for example, states an OFF input sensitivity current of 1.5 mA or less. A two-wire sensor’s residual current must stay below such a figure, or the input may never switch off.

Three-wire electronic switches

A three-wire switch has its own supply connection, so its residual current is negligible. This is where the NPN PNP choice applies. The DS 200 and the LDS 350-IO, for example, have separate supply and contact terminals, so their contacts connect in this way. Note that on the DS datasheets, 2-wire and 3-wire describe the analogue output, not the contact.

NPN PNP on Leitenberger pressure switches

The electronic rows below come from Leitenberger’s own datasheets, read on 23 November 2026. The mechanical row rests on the 03.30 datasheet and on PIC’s category page. Together, they cover the pressure switches named on PIC’s pages. Makers revise their products, though, so confirm the output type against the current datasheet when you order.

Switch Contacts Output type
DS 200, DS 201, DS 202, DS 210, DS 214, DS 200 P, DS 201 P1 as standard; 2 or 4 independent contacts as optionsPNP
DS 400, DS 401, DS 400 P1 as standard; 2 independent contacts as an optionPNP
DS 230, DS 41 as standard; 2 as an optionPNP
LDS 350-IOOutput 1: IO-Link or a contact. Output 2: a contact or an analogue signalPNP or NPN, switchable
03.10, 03.27, 03.30, 03.40 and 03.45 (mechanical)SPDT micro switchesPlain contact, no polarity

None of the DS datasheets read lists an NPN version. For a sourcing input card, the choice is therefore the LDS 350-IO pressure switch, a mechanical switch or an interposing relay. The DS 200, DS 400 and DS 202 are on our DS universal pressure switch page.

On the LDS 350-IO, pin 4 carries either IO-Link or, in SIO mode, a switching contact. Pin 2 carries a second contact, a 4 to 20 mA signal or a 0 to 10 V signal. Both contacts are switchable between PNP and NPN, according to the LDS 350-IO datasheet. One switch can therefore suit either kind of input card. What the IO-Link side adds is covered in our article on IO-Link sensors.

A checklist before you wire

This checklist sums up the steps above for PNP and NPN outputs.

  1. Read the input card’s diagram. Find where the common goes: 0 V for a sinking input, supply positive for a sourcing input, under the naming used here.
  2. Read the device’s diagram. Confirm PNP or NPN, the pins or wire colours, and whether the output is normally open or normally closed.
  3. Match them. PNP goes to an input whose common is on 0 V, and NPN goes to an input whose common is on supply positive.
  4. Check the current. Compare the load with the output’s maximum switching current.
  5. For a two-wire sensor, compare its residual current and voltage drop with the input’s thresholds.
  6. Test it. Operate the switch and watch the input change, in both directions.

How PIC can help

PIC Engineering supplies Leitenberger electronic and mechanical pressure switches from Shah Alam. Our calibration services also check the switching point of a pressure switch against references traceable to NMIM-SIRIM or another national metrology institute. For a question on PNP or NPN outputs on a pressure switch, send us the pressure range, the set point and your input card’s wiring diagram on WhatsApp, and an engineer will suggest a switch with a matching output.

Related reading


Disclaimer: This article is general engineering guidance from PIC Engineering, not a specification or a safety recommendation for any particular installation. Confirm every figure against the instrument’s current datasheet and your plant’s procedures, and involve a qualified engineer for safety-related decisions. Information current as at November 2026.

Measuring something like this?

Tell an engineer your process conditions. Response within one working day.