How do NPN and PNP sensors convert to each other?

2025-08-22 11:53:00

The conversion between NPN and PNP sensors isn't done with a physical "converter" but rather by understanding the difference and using an external component to interface them.

How do NPN and PNP sensors convert to each other?-1

First, let's establish the core difference, as this is the key to the solution.

The Core Difference: Sourcing vs. Sinking

Think of electrical current like water. It always flows from a point of high pressure (positive voltage, e.g., +24V) to a point of low pressure (0V, or Ground).

  • An NPN Sensor is a Sinking Sensor. When it's activated (ON), it provides a path to Ground (0V). It sinks the current into itself to complete the circuit.

  • PNP Sensor is a Sourcing Sensor. When it's activated (ON), it provides the Positive Voltage (e.g., +24V). It sources the current from itself to complete the circuit.

This fundamental difference means you cannot simply wire one in place of the other. Their wiring is opposites.

Here’s a visual breakdown of how they work:

 
 
How do NPN and PNP sensors convert to each other?-2

How to "Convert" or Interface Them

Since you can't change the sensor's internal electronics, you use an external component to "translate" the signal. The most common, robust, and recommended method is using a Relay.

Method 1: Using a Relay (The Best & Most Universal Solution)

A relay is an electrically operated switch. It isolates the sensor's circuit from the PLC's/controller's circuit, making it a safe and versatile solution.

Scenario 1: You have an NPN Sensor but need a PNP-style signal (24V when active).

  • Goal: When the NPN sensor turns ON, you want a wire to output +24V.

  • Solution: Wire the NPN sensor to activate the relay coil. The relay's separate switch contacts will then provide a PNP-style signal.

Wiring Diagram for NPN to PNP conversion:

text
 
      +24V DC ---+-----------------------------+
                 |                             |
                 |  (To emulate a PNP output)  |
                 |                             |
                 +-----+  [Relay Coil]  +-----+---(Signal Output to PLC Input)
                 |     |               |     |
                 |     +-----[NPN]-----+     |
                 |                           |
     0V DC ------+---------------------------+
                 |
          [NPN Sensor]          [Relay]
          Brown: +24V       Coil: Between +24V and NPN output
          Blue: 0V          Common (COM): Connect to +24V
          Black: Output     Normally Open (NO): Use as your new "PNP" Output
  • How it works: When the NPN sensor is active, it sinks current, allowing power to flow through the relay coil, activating it. This closes the relay's switch (NO contact). Because you've connected the relay's common (COM) terminal to +24V, the NO terminal now outputs +24V—exactly what a PNP sensor would do.

Scenario 2: You have a PNP Sensor but need an NPN-style signal (0V when active).

  • Goal: When the PNP sensor turns ON, you want a wire to output 0V (Ground).

  • Solution: Similarly, use the PNP sensor to power the relay coil. The relay's contacts will then provide an NPN-style signal.

Wiring Diagram for PNP to NPN conversion:

text
 
      +24V DC ---+-----------------------------+
                 |                             |
                 |                             |
                 +-----------+[PNP]+-----------+
                 |           |     |           |
                 |           +-----+           |
                 |                             |
                 +-----+  [Relay Coil]  +-----+---(Signal Output to PLC Input)
                 |     |               |     |
                 |     +------[0V]-----+     |
                 |                           |
     0V DC ------+---------------------------+
                 |
          [PNP Sensor]          [Relay]
          Brown: +24V       Coil: Between PNP output and 0V
          Blue: 0V          Common (COM): Connect to 0V (Ground)
          Black: Output     Normally Open (NO): Use as your new "NPN" Output
  • How it works: When the PNP sensor is active, it sources +24V to power the relay coil. The other side of the coil is connected to 0V. This activates the relay, closing the switch. Because you've connected the relay's common (COM) terminal to 0V, the NO terminal now outputs 0V (Ground)—exactly what an NPN sensor would do.


Method 2: Using a Pull-Up / Pull-Down Resistor (For Experts)

This is a electronic hack, not always recommended for industrial environments due to potential noise issues and lack of isolation.

  • NPN to "PNP-like": You add a "pull-up" resistor from the sensor's output wire to +24V. When the NPN is OFF, the resistor pulls the signal wire high to +24V. When the NPN is ON, it sinks the output to 0V, overpowering the resistor.

    • Result: You get a signal that is +24V when inactive and 0V when active. This is the inverse of a true PNP signal and might need to be inverted in the PLC logic.

  • PNP to "NPN-like": You add a "pull-down" resistor from the sensor's output wire to 0V. When the PNP is OFF, the resistor pulls the signal wire low to 0V. When the PNP is ON, it sources +24V to the output, overpowering the resistor.

    • Result: You get a signal that is 0V when inactive and +24V when active. This is the inverse of a true NPN signal and might need to be inverted in the PLC logic.

Use relays. They are simpler to understand, more reliable, and provide safe electrical isolation.

Summary Table & Quick Guide

Your Situation You Need to Buy / Use How it Works
I have an NPN sensor but my PLC input only accepts PNP (sourcing). Relay Let the NPN sensor activate the relay. Wire the relay's switch to source +24V when closed.
I have a PNP sensor but my PLC input only accepts NPN (sinking). Relay Let the PNP sensor activate the relay. Wire the relay's switch to sink to 0V when closed.
I need to connect an NPN and PNP sensor to the same PLC input. Relay Convert one of them to match the other using one of the methods above. Using a relay for each is the cleanest method.

Pro Tip: Many modern PLCs have "universal" or "sourcing/sinking" inputs that can be wired to accept either NPN or PNP signals by simply changing the wiring of the PLC's common terminal (connecting it to 0V for PNP or to +24V for NPN). Always check your PLC manual first before buying extra components—you might not need to convert anything at all!

 
 
 
 
Harendra Kumar
Harendra Kumar
Harendra Kumar holds a Ph.D. in Electrical Engineering with a specialization in power electronics. His academic expertise and years of experience allow him to break down complex concepts into clear, actionable information for his audience. Through his work, he aims to bridge the gap between advanced technology and its real-world applications. Harendra is an accomplished writer who specializes in creating high-quality, long-form technical articles on power electronics for B2B electronics platforms. His content combines deep technical knowledge with practical insights, making it a valuable resource for professionals in the electronics industry.