NPN vs PNP: The Difference

NPN and PNP are the two types of bipolar junction transistors (BJTs). They look similar, carry similar specs, and do the same job — switching or amplifying electrical signals. But they are not interchangeable.

This guide covers what makes them different and how to choose the right one.

fig1 npn pnp symbols

What is an NPN transistor?

An NPN transistor is a BJT made from two N-type semiconductor layers separated by a thin P-type layer — Negative-Positive-Negative.

NPN transistors are the most widely used BJT type in electronic circuits. Their primary charge carriers — electrons — move faster than the holes used in PNP transistors, giving them faster switching speeds, higher efficiency, and lower manufacturing costs.

In industrial sensor applications, NPN outputs are called “sinking” outputs. This means that when the sensor detects a target, it connects the output to ground and “sinks” current from the load down to 0V. So the output signal goes low when the sensor is active.

What is a PNP transistor?

A PNP transistor is the opposite: two P-type semiconductor layers separated by a thin N-type layer — Positive-Negative-Positive.

PNP transistors use holes as the primary charge carriers, which makes them slightly slower than NPN types. But they have a distinct advantage — they are naturally suited for high-side switching, meaning they control the connection between the positive supply and the load.

In industrial sensor applications, PNP outputs are called “sourcing” outputs. When the sensor detects a target, it connects the output to the positive supply voltage and “sources” current to the load. The output signal goes high when the sensor is active. This is the standard in European automation and safety systems, because a positive signal for “active” aligns with standard positive logic conventions.

How do NPN and PNP transistors work?

Now that we know what NPN and PNP transistors are made of, let’s look at how they actually operate. Both types work on the same fundamental principle: a small current at the base controls a much larger current between the emitter and collector. The difference is the direction of that current and the polarity needed to turn the transistor on.

NPN transistor operation

fig2 npn working principle

To turn on an NPN transistor, you apply a small positive voltage (about +0.7V) between the base and emitter. This forward-biases the base-emitter junction.

Once the junction is forward-biased, electrons flow from the N-type emitter into the thin P-type base. Since the base is narrow and lightly doped, most of these electrons don’t stop there — they pass straight through and are collected by the collector terminal, which is held at a higher voltage.

The result is that a small base current (Ib) flowing into the base causes a much larger collector current (Ic) to flow from collector to emitter. The ratio between these two — Ic/Ib — is called the current gain (β or hFE), and it typically ranges from 50 to 800 depending on the transistor.

One thing that often confuses beginners: in circuit diagrams, current arrows show conventional current, which flows from positive to negative — that’s collector to emitter in an NPN transistor. But electrons actually move the opposite way, from emitter to collector. Both descriptions are correct; the conventional current convention is simply what you’ll see on every datasheet and schematic.

PNP transistor operation

fig3 pnp working principle

The PNP transistor works on the same principle, but with everything reversed.

Instead of applying a positive voltage to the base, you need the base to be at a lower voltage than the emitter — about −0.7V relative to the emitter. This causes a small current to flow out of the base rather than into it.

When this happens, holes flow from the P-type emitter through the thin N-type base into the P-type collector, producing a large emitter-to-collector current. Just like the NPN, this large current is controlled by the small base current — the same gain relationship applies.

So the key difference in operation is straightforward: NPN conducts when the base is more positive than the emitter (current flows into the base). PNP conducts when the base is more negative than the emitter (current flows out of the base). Everything else — the gain, the three operating modes, the switching behavior — is the same, just with reversed polarity.

Operating modes

Both transistor types can operate in three modes, and these apply identically to NPN and PNP.

In cutoff, the transistor is completely OFF. No current flows, and it behaves like an open switch. In saturation, the transistor is fully ON with maximum current and a minimal voltage drop (about 0.2V) — it behaves like a closed switch. In the active region, the transistor works as a proportional amplifier, where the output current scales linearly with the input — this is used in analog circuits like audio amplifiers.

For industrial sensor applications, only cutoff and saturation matter. The sensor’s transistor is either fully OFF (no target detected) or fully ON (target detected) — it never operates as an amplifier.

Load devices — PNP vs. NPN output

With the operating principles covered, the next question is practical: how do NPN and PNP transistors behave when connected to real devices?

The “load” is whatever the sensor drives — a PLC input, relay coil, indicator lamp, or solenoid valve. Both PNP and NPN sensors can drive the same types of loads. The difference is where the sensor’s transistor sits in the circuit relative to the load.

fig4 pnp sourcing vs npn sinking

PNP (sourcing): sensor sits between V+ and the load

In a PNP sourcing configuration, the sensor’s transistor connects the positive supply to the output pin. The load is wired between the output and ground.

When the sensor detects a target, the transistor turns on and connects V+ to the output. Current flows from the sensor, through the load, and down to ground. The output voltage goes high — approximately equal to V+.

When nothing is detected, the transistor stays off, the output floats, and no current flows through the load.

NPN (sinking): sensor sits between the load and ground

In an NPN sinking configuration, it’s the other way around. The sensor’s transistor connects the output pin to ground. The load is wired between V+ and the output.

When the sensor detects a target, the transistor turns on and connects the output to ground. Current flows from V+, through the load, and into the sensor output down to ground. The output voltage goes low — approximately 0V.

When nothing is detected, the transistor stays off, the output floats, and no current flows.

Why does this matter?

Notice that the same load carries the same current in both configurations — but the output signal is inverted. PNP gives a high signal when the sensor is active; NPN gives a low signal when active.

Your PLC input module is designed to expect one or the other. If you connect an NPN sensor to a PLC input that expects PNP, the PLC will read the signal backwards — it will think the sensor is active when nothing is there, and inactive when a target is actually present. This is one of the most common wiring mistakes in industrial automation.

Matching sensors to PLC inputs

This is where many engineers get confused: NPN sensors pair with sourcing input modules, and PNP sensors pair with sinking input modules.

It sounds counterintuitive, but think of it this way — the sensor provides one half of the current path, and the input module provides the other half. An NPN sensor provides the path to ground, so the input module needs to provide the path from V+ (sourcing). A PNP sensor provides the path from V+, so the input module needs to provide the path to ground (sinking). Together, they form a complete circuit.

Some modern PLC modules (such as the Allen-Bradley CompactLogix 1769-series) accept both types. Always check your module’s datasheet before ordering sensors.

NO/NC is a separate concept

It’s easy to confuse NPN/PNP with normally-open (NO) and normally-closed (NC), but they describe completely different things.

NPN/PNP describes the output transistor type — how the signal is delivered. NO/NC describes when the signal is delivered — whether the output is active or inactive by default. These are independent: an NPN sensor can be NO or NC, and so can a PNP sensor. When ordering, you need to specify both.

Push-pull outputs

Some sensors offer a third option: a push-pull output. This contains both an NPN and PNP transistor on the same output pin. The output actively drives high when the sensor is active and low when inactive — there’s no floating state.

Push-pull outputs work with both sourcing and sinking PLC inputs and eliminate the need for external pull-up or pull-down resistors. If you’re working in a mixed-standard environment or want maximum compatibility, push-pull is worth considering.

Differences between NPN and PNP transistors

At this point, you’ve seen the individual details. Here’s everything side by side. Every difference traces back to their reversed semiconductor structure — N-P-N versus P-N-P — which reverses the current direction and polarity of every signal.

FeatureNPNPNP
Semiconductor layersN-P-NP-N-P
Schematic symbol arrowPoints outward from emitterPoints inward to emitter
Majority charge carriersElectrons (faster)Holes (slower)
Current directionCollector → EmitterEmitter → Collector
Base current to turn ONFlows into the baseFlows out of the base
Turn-on voltageVbe ≈ +0.7VVbe ≈ −0.7V
DeactivationBase current removed or reducedBase becomes more positive
Switching positionLow-side (between load and ground)High-side (between V+ and load)
Sensor output when activeLow (≈ 0V) — sinkingHigh (≈ V+) — sourcing
Signal polarityActivated by positive voltageActivated by low/ground signal
PLC input pairingSourcing input modulesSinking input modules
Wire-break behaviorOutput may float undefinedOutput loses signal → PLC reads OFF
Switching speedFasterSlightly slower
Transition frequency (fT)Higher (20–30% above equivalent PNP)Lower
Cost and availabilityMore common, slightly lower costLess common, slightly higher cost

A few questions that come up often when looking at this table:

Are NPN and PNP interchangeable?

No. They have opposite current flow directions and reversed biasing requirements. If you put an NPN where a PNP should go and apply the same signals, the transistor either won’t turn on at all, or the output will be inverted. You must match the transistor type to the circuit design.

Which is better?

Neither is inherently better — they serve different roles. NPN is the default for most circuits because of its speed and compatibility with negative-ground systems. PNP is the right choice for high-side switching and applications where a sourcing output provides fail-safe behavior — a broken wire causes the PLC to read “no detection” rather than leaving the input in an undefined floating state. The correct choice depends on your circuit, PLC input type, and wiring standards.

Can you convert PNP to NPN?

You can add an external transistor as a signal inverter to flip the output polarity. But this adds a component, a potential failure point, and complexity to the wiring. In most cases, ordering the correct sensor type is simpler and more reliable. If you’re in a mixed-standard environment and want to avoid the issue entirely, consider sensors with push-pull outputs.

Choosing between NPN and PNP transistors

With all the differences laid out, here’s a practical framework for making the decision.

Start with your PLC input module. This is the single most important factor. Sinking input modules need PNP sensors to provide the positive voltage. Sourcing input modules need NPN sensors to provide the ground path. Universal modules accept both — check the datasheet.

Follow your wiring standard. European factories expect PNP sourcing — it’s the default across Siemens, Beckhoff, and B&R systems. Asian markets (China, Japan, Korea) use NPN sinking — most Mitsubishi, Omron, and Keyence PLCs are configured for it. North American facilities use both, so check the specific platform.

Consider fail-safe behavior. In a PNP sourcing circuit, if the output wire breaks, the PLC input loses its positive signal and reads as OFF — a clean “no detection” state. In an NPN sinking circuit, a broken wire may leave the PLC input floating, which some modules might read as a false detection. For safety-critical applications, this makes PNP the safer default.

Consider circuit topology. Outside of industrial sensors, the choice depends on where the transistor sits in the circuit. Low-side switching — where the transistor sits between the load and ground — calls for NPN. High-side switching — where the transistor sits between V+ and the load — calls for PNP. Push-pull and complementary stages, like Class B amplifiers and H-bridge motor drivers, use one of each as a matched pair.

Verify electrical ratings. Max collector current (Ic) must exceed your load’s current draw — otherwise the transistor overheats. Breakdown voltage (Vceo) must exceed your supply voltage with margin. Current gain (hFE) determines how much base current you need — a lower gain means more drive current required. Transition frequency (fT) matters for high-speed switching applications, where NPN typically outperforms PNP by 20–30%.

Common NPN and PNP transistors

Finally, here are the most widely used general-purpose BJTs for quick reference.

TransistorTypeMax IcMax VceoTypical hFEPackage
2N2222ANPN800mA40V100–300TO-18 / TO-92
2N3904NPN200mA40V100–300TO-92
BC547NPN100mA45V110–800TO-92
TIP120NPN Darlington5A60V1000TO-220
2N2907APNP600mA60V100–300TO-18 / TO-92
2N3906PNP200mA40V100–300TO-92
BC557PNP100mA45V110–800TO-92
TIP125PNP Darlington5A60V1000TO-220

The 2N2222/2N2907 and 2N3904/2N3906 are classic complementary pairs — matched NPN and PNP transistors designed to work together in push-pull stages, H-bridge motor drivers, and other complementary configurations.

滚动至顶部