Understanding PNP and NPN in Electrical Design with Live Circuit Diagrams

Panel drawings and sensor catalogs keep repeating two labels: “NPN” and “PNP”. If you wire a machine while staying vague about what they mean, you run straight into trouble like “I turned the output ON but the lamp never lights” or “we swapped a sensor and now the PLC input stopped responding”. A large share of the stumbles at the entry point of electrical and control design begin with mixing up PNP and NPN ── in other words, mixing up the direction of sink and source.

This article is for anyone who wants to understand the difference between PNP and NPN. Whether you are learning this for the first time or re-organizing something you once studied, the focus is not on the internal semiconductor structure but on which direction the output drives current through your control wiring. The one-line version up front: NPN pulls current in toward the 0V (GND) side (it sinks), and PNP pushes current out from the +24V side (it sources). The heart of the difference is this direction of current. And you will not have to take that on faith: this site puts real effort into visual learning, and every circuit diagram in this article is interactive ── current actually moves when you press the buttons, so you can confirm the direction with your own eyes as you read.

💡 Tip

You can also play with the live diagrams first and come back to the text afterwards. Jump to “Watching a PLC transistor output in a live diagram” and you will land on the first interactive figure.

What this article covers

Here is how the questions you may have map to the sections that answer them.

Question Section
What do NPN / PNP, sink / source, and “common” actually mean? §1
What is the difference between PNP and NPN, in one line? §2
Which side of the circuit does the load go on? §2
What is really happening inside a PLC transistor output? §3 (live figures)
Which should I choose in practice, NPN or PNP? §4
How do NPN and PNP proximity sensors differ? §5 (live figures)
What goes wrong when pairing sensors with PLC inputs? §6
What changes between NPN and PNP when there is a short circuit? §7 (live figures)
How do I measure and verify all this in the field? §8 / FAQ

1. Aligning the vocabulary first ── the same “NPN” can describe a component or a wiring style

The biggest reason NPN / PNP feels confusing is that two different conversations use the same words: the semiconductor-physics story about transistor structure, and the control-wiring story about output types. The textbook sentence “an NPN transistor is an N-type / P-type / N-type junction…” and the panel-shop sentence “this output unit is the NPN type” share a word but point at different layers. This article is about the latter: which direction an output drives its load inside a control circuit.

Let’s line up the terms this article uses. You don’t need to memorize them right now ── the live figures below will bring you back to the same words again and again.

Term Meaning in this article In one phrase
NPN (output) When ON, it pulls the far end of the load down to the 0V (GND) side Sink = current flows in
PNP (output) When ON, it presents the +24V side voltage to the load Source = current is pushed out
Sink / source Field vocabulary for naming the direction of current In the output context, NPN ≒ sink, PNP ≒ source
Open collector A configuration where the output transistor’s collector is brought straight out to the terminal Very common on sensor outputs
Common The shared supply-side terminal that groups multiple I/O points (positive common / negative common) How the other device “gangs up” its terminals

The trick to remembering all this is not to memorize the letters N and P, but to attach each name to a direction: seen from the device terminal, does current flow in, or get pushed out? Sink means “flows in”; source means “pushed out”. Keep just those two words in hand and move on to the next section.

⚠️ Common Pitfall

Choosing equipment from impressions like “NPN is dangerous” or “PNP is the safe one” leads to bad decisions. What matters are two things: the input specification of whatever you are connecting to, and what tends to happen when something fails. Those two points are covered in §4 and §7 respectively.

2. The big picture ── the difference is which side of the supply the switch sits on

Every output circuit that switches a device ON and OFF has an element inside that plays the role of a switch. What differs between NPN and PNP is whether that switch sits on the 0V side of the supply or on the +24V side. Once the switch’s position is fixed, the load’s position and the direction of the current follow automatically.

NPN (sink) PNP (source)
Side the switch sits on 0V (GND) side +24V side
Typical load placement +24V → load → output terminal → 0V Output terminal → load → 0V
Current direction when ON From the load into the output terminal Pushed out of the output terminal into the load
Terminal voltage when ON Drops to near 0V Rises to near +24V
Terminal voltage when OFF (rule of thumb) Often floats up toward the supply voltage through the load Often sits near the 0V side

With NPN, the load hangs from the +24V side; when the output turns ON, the bottom end of the circuit drops to 0V and current flows through the load into the output terminal. With PNP, the load sits on the 0V side; when the output turns ON, +24V is pushed out and current flows from the output terminal through the load down to 0V. The same operation, “ON”, means the terminal voltage falls for NPN and rises for PNP. That symmetry is exactly what will matter later when we talk about multimeter checks.

💡 Tip

If you ever get lost, come back to one single row of the table above: “Current direction when ON”. Every figure from here on exists so you can verify that one row with your own eyes.

3. Watching a PLC transistor output in a live diagram

Transistor output units of a PLC (programmable logic controller) come in two broad flavors: NPN (sink) and PNP (source). Unlike relay-contact outputs they are semiconductor switches, fast and long-lived ── but the direction they can carry current is fixed. Get the direction wrong, and the load will not move even though nothing is broken.

The figures below model two program-side output bits (Logic Y0 / Logic Y1) driving external relays through the PLC’s output unit. The “indicator lamp” in the diagram corresponds to the status LED on the output unit or a panel lamp in the field. How to read the drawing: greenish wires carry positive voltage, gray wires sit near 0V, and the moving dots show the direction and speed of current.

3-1. NPN (sink) output ── current flows from the field into the PLC

In the figure below, turn “Logic Y0” ON: the output transistor conducts and the Y00 terminal drops toward 0V. The path +24V → external relay → Y00 terminal → inside the PLC → 0V closes, and current flows through the relay and the indicator lamp. Because current flows into the PLC terminal from the field side, this is called sinking.

Loading simulator…

ch1 (Logic Y0)

C1 = —

ch2 (Logic Y1)

C2 = —

Built with: CircuitJS1 (Paul Falstad / Iain Sharp et al., GPL) · falstad.com/circuit

Try operating ch1 and ch2 independently. You can feel that inside the output unit there is a separate switch (transistor) for every channel. Only the channel you turned ON has its terminal voltage (C1 / C2) drop toward 0V, and only that channel’s relay is energized.

💡 Tip

To check an NPN output with a multimeter, measure between the output terminal and 0V. ON pulls it close to 0V, OFF lets it return to a high reading ── if you can see that swing, the output device is doing its job.

3-2. PNP (source) output ── current is pushed from the PLC out to the field

Now the same two-channel arrangement as a PNP unit. Turn “Logic Y0” ON and the output transistor conducts on the +24V side, so +24V appears at the Y00 terminal. Current is pushed out of the PLC terminal, through the external relay, down to 0V. That is sourcing.

Loading simulator…

ch1 (Logic Y0)

C1 = —

ch2 (Logic Y1)

C2 = —

Built with: CircuitJS1 (Paul Falstad / Iain Sharp et al., GPL) · falstad.com/circuit

Compare this with the NPN figure and you can see that the same “ON” means exactly opposite things for the terminal voltage. With NPN, ON pulls C1 down toward 0V; with PNP, ON pushes C1 up toward +24V. The relay energizes the same way in both, so a voltage number alone cannot tell you whether the load is running. Always read the number together with the direction information: is this output a sink, or a source?

⚠️ Common Pitfall

The assumption “there’s voltage on it, so it must be working” is especially dangerous with NPN outputs, where the terminal reads a higher voltage while OFF. Before interpreting any multimeter reading, confirm which output type you are looking at.

4. How to choose between NPN and PNP ── match the other side’s common, not your preference

The practical answer to “so which one should I use?” is: match the input specification of whatever you are connecting to. PLC input units and relay circuits group multiple signals onto a shared supply-side terminal called the common, and whether that common is positive or negative largely decides which output type connects naturally.

Common on the receiving side Output that pairs naturally What it looks like in the field
Positive common (+ shared) NPN (sink) output +24V on the input common terminal; a signal is detected when its line is pulled down toward 0V
Negative common (− shared) PNP (source) output 0V on the input common terminal; a signal is detected when +24V arrives on its line

This mapping is a tendency, not a law ── some input units accept both polarities. The design order still does not change: for new equipment, the specification and the connected devices’ datasheets come first; for additions to existing equipment, the way the existing panel’s commons are grouped has the highest priority. Choosing by personal habit invites rework later, when an added sensor or expansion unit refuses to fit.

You will also find regional and industry biases ── “this plant is standardized on NPN”, “this industry runs PNP everywhere”. The biases have reasons behind them (historical standards, safety-design philosophy, ease of procurement), but they are not laws of nature. For the project in front of you, the datasheet of the device you are connecting to outranks any custom.

💡 Tip

Never decide from the “NPN / PNP” text in a catalog alone ── always open the example connection diagram. Even if you misread the letters, comparing the vendor’s example diagram against this article’s live figures will expose a mismatch in current direction.

5. Sensor outputs read the same way ── it is still about direction

Proximity sensors, photoelectric sensors and other 3-wire sensors are also labeled NPN or PNP. Two of the three wires (+24V and 0V) power the sensor, and the remaining output wire is switched ON / OFF by a transistor inside. The role differs from a PLC output, but the sink / source way of thinking about direction is exactly the same. Rather than memorizing PLCs and sensors as separate topics, line them up under the same vocabulary of direction ── it is the shortcut.

5-1. NPN sensor ── the output drops toward 0V on detection

The “Detect” button in the figure reproduces a workpiece (detection target) coming close to the sensor. When detection turns ON, the internal NPN transistor conducts, the output wire drops toward 0V, and current flows in from the relay coil that hangs on the +24V side. It is the same “flowing in” skeleton as the PLC output in §3-1.

Loading simulator…

Detect

C = —

Built with: CircuitJS1 (Paul Falstad / Iain Sharp et al., GPL) · falstad.com/circuit

5-2. PNP sensor ── the output presents +24V on detection

In a PNP sensor, detection turns the internal PNP transistor on at the +24V side, and +24V appears on the output wire. Current is pushed out of the output wire, through the relay coil, down to 0V ── the same “pushing out” skeleton as the PLC output in §3-2.

Loading simulator…

Detect

C = —

Built with: CircuitJS1 (Paul Falstad / Iain Sharp et al., GPL) · falstad.com/circuit

Go back and forth between the two PLC figures and the two sensor figures, and a pattern emerges: no matter the device, there are only two shapes ── “flowing in” and “pushing out”. Once you can see the shape, you can read the connection diagram of any device you meet for the first time in terms of current direction.

💡 Tip

Before putting a multimeter on a sensor, state your hypothesis first: “NPN, so the output should drop on detection ── PNP, so it should rise.” If the sensor’s own detection LED lights but the PLC does not respond, suspect the pairing problem in the next section before suspecting a broken sensor.

6. Sensor-to-PLC pairings simply do not work when the polarity mismatches

A sensor that is fine on its own, a PLC that is fine on its own ── wired together, and the input never comes on. This is one of the most common failures in the field, and most of the time nothing is broken: the output type and the input common do not match. The basic pairs are NPN sensor → positive-common input, and PNP sensor → negative-common input; in the reversed combinations, a path for the current simply never exists.

The key to understanding this compatibility at the voltage level is the idea of pull-up and pull-down. An open-collector output on its own can only do one thing: connect the signal line to one potential (0V for NPN, +24V for PNP). Creating the opposite potential is the job of a resistor on the receiving side ── a pull-up that lifts the signal line toward +24V, or a pull-down that holds it at 0V. The figure below shows both: NPN open collector + pull-up on top, PNP open collector + pull-down underneath.

Loading simulator…

NPN + pull-up

Signal 1 = —

PNP + pull-down

Signal 2 = —

Built with: CircuitJS1 (Paul Falstad / Iain Sharp et al., GPL) · falstad.com/circuit

On the NPN side, the pull-up resistor keeps the signal line at +24V (H) while OFF, and turning ON drags it down to 0V (L). The PNP side is the mirror image: the pull-down resistor keeps the line at 0V (L) while OFF, and turning ON brings up +24V (H). Without the proper resistor on the receiving side, the signal line settles at neither potential while OFF ── the symptoms are “we wired it up but the voltage never changes” or erratic, floating behavior. Positive-common inputs contain circuitry equivalent to this pull-up, negative-common inputs the equivalent pull-down ── seen that way, this figure and the compatibility table of §4 are the same story.

A checklist for verifying a pairing. Work from the top and the cause almost always turns up somewhere on the list.

  1. Confirm the sensor’s output type (NPN or PNP) from its nameplate and datasheet
  2. Confirm how the PLC input unit’s common is grouped (+ or −) and its ratings
  3. Check the vendor’s example connection diagram against the actual wiring
  4. Trigger a detection and measure whether the signal-line voltage moves the expected way (down / up)
  5. Watch whether the PLC input indication (input LED or monitor) follows as expected
⚠️ Common Pitfall

Stopping at “it somehow works, good enough” will cost you later. Wiring that only works by way of leakage current or an unintended path becomes unstable with noise, temperature, or a device swap. After it works, confirm that you can explain in one sentence which path the current takes, and in which direction.

7. What happens on a short circuit also differs between NPN and PNP

The NPN / PNP difference is not only about healthy wiring. When a pinched cable or failed insulation lets the output line touch 0V ── a ground fault ── what tends to happen next depends on whether the output is NPN or PNP. Below we create the same fault at the same place and compare the two behaviors. This is not about declaring one type absolutely safe; it is about knowing the tendencies so you can use them in protection design and troubleshooting.

7-1. Ground fault on NPN ── the output device survives, but the load turns itself on

The “Short” button in the figure below reproduces the wiring between the external relay and the Y00 terminal touching 0V. Trigger the short while Logic Y0 is still OFF. The PLC is outputting nothing, yet the path +24V → external relay → fault point → 0V closes on its own and the external relay energizes by mistake. Worse, the current bypasses the PLC entirely, so the indicator lamp stays dark. Almost no current passes through the output transistor, so the device itself tends to survive.

Loading simulator…

Controls

Status

C1 = —

Built with: CircuitJS1 (Paul Falstad / Iain Sharp et al., GPL) · falstad.com/circuit

This failure mode ── “the device is healthy, but the logic is wrong” ── is what makes root-cause hunting hard. No fuse has blown, the output unit’s self-diagnostics report everything normal, and yet a machine in the field moves on its own. When you see those symptoms, put a ground fault on the sink-side wiring onto your suspect list.

7-2. Ground fault on PNP ── no false ON, but excessive current through the output device

Now the same fault, on the PNP output. While Logic Y0 is OFF, nothing happens ── the device that would supply +24V is closed. In other words, for this kind of ground fault a PNP output is unlikely to false-ON the load. The problem starts the moment you turn the output ON: current flows from the output device straight into the fault point, bypassing the load, and keeps flowing. In the figure below, against roughly 15 mA in normal operation, about 30 times that current crosses the output device during the short ── in real hardware, the territory of device damage or a protection trip.

Loading simulator…

Controls

Status

C1 = —

Built with: CircuitJS1 (Paul Falstad / Iain Sharp et al., GPL) · falstad.com/circuit

Putting the two demos side by side, the tendencies look like this.

Output line grounds to 0V NPN (sink) PNP (source)
False ON of the load Likely (the load energizes even with the output OFF) Unlikely (with the output OFF there is nothing supplying current)
Stress on the output device Tends to be small (the fault current bypasses the device) Tends to be large (excessive current crosses the device the moment it turns ON)
Symptoms seen in the field Fuses and devices all healthy, yet a machine moves on its own A single channel dies, or a protection circuit shuts things down
What to keep in mind at design time Fail-safe measures for loads that must never false-ON Presence of short-circuit protection, physical wire protection, rating margins

This ground-fault behavior is one of the reasons PNP (sourcing) is preferred in many regions outside Japan. Ground the 0V side of the control circuit and switch only the +24V side, and a ground fault shows up as the safe symptom “protection trips and things stop” rather than “a machine starts moving on its own”. Standards for the electrical equipment of machines (such as IEC 60204-1) express the same idea: earth one side of the control circuit and switch the other, so a ground fault cannot start an unintended operation. That said, fail-safe circuits can be designed with NPN too, and output devices with built-in short-circuit protection are common now. More useful than memorizing types is the habit of asking, once per design: “if this particular wire grounds out, what happens?”

⚠️ Caution

These short-circuit demos are simplified teaching models. Real equipment behaves differently because of protection circuits, fuses, and wiring resistance. Never create a deliberate short in a real panel, not even “just to check”. For anything safety-related, follow the manufacturer’s documentation.

8. Checking it in the field ── turning the figures into multimeter steps

Once the live figures have given you a feel for direction, translate it into a measuring routine. When an output does not work, this order is efficient.

  1. Verify supply ── measure that +24V and 0V are actually present. Without supply, nothing after this step means anything
  2. Verify the common ── check that the common terminal grouping (+ or −) matches the drawing
  3. Take an OFF baseline ── with the output OFF, measure the output terminal voltage as your reference point
  4. Watch the direction on ON ── turn the output ON (or trigger detection) and watch whether the voltage moves the expected way: down for NPN, up for PNP
  5. Watch the load follow ── confirm relays, lamps, input LEDs track the voltage change
  6. Compare with a neighbor channel ── measure a known-good channel the same way and look for the difference
💡 Tip

In practice, the causes of “it won’t turn on” tend to rank in this order: the program-side output never turned ON, a common wire came off, the load circuit is broken, the output type was mixed up. Checking supply and commons before suspecting anything deeper in the circuit saves real time.

Summary ── PNP and NPN come down to direction

  • NPN is a sink (current flows in). On ON, the terminal drops toward 0V and current flows from the load into the terminal.
  • PNP is a source (current is pushed out). On ON, +24V appears at the terminal and current is pushed out into the load.
  • The essence is which side of the supply the switch sits on. Remember the direction, not the letters.
  • PLC outputs and sensor outputs both read with the same sink / source vocabulary.
  • Selection is not preference: match the other device’s common and input spec. For additions, the existing panel rules.
  • With a multimeter, don’t judge by how big the voltage is ── watch which way it moves on ON.
  • Mismatched pairings outnumber genuine device failures. Check nameplate, common, example diagram ── in that order.
  • Ground-fault tendencies: NPN risks a false-ON of the load, PNP risks excessive current through the device. Know this before doing protection design.

If you ever have to explain the difference to someone, start with: “the switch is on the 0V side for NPN so current flows in; it is on the +24V side for PNP so current is pushed out.” For everything beyond that, the figures in this article are always here to come back to.

FAQ

Q1. What is the shortest possible statement of the PNP / NPN difference?

A. In the output context: NPN sinks current toward the 0V side, PNP sources current from the +24V side. Saying “the internal switch sits on one side of the supply or the other” is the same statement.

Q2. Which should I pick, NPN or PNP?

A. As a rule, match the input specification of the device you are connecting to (positive or negative common). For additions to existing equipment, match the existing panel. Situations where raw preference or single-device performance decides it are rare in practice.

Q3. Can I just memorize sink = NPN, source = PNP?

A. In the output context that mapping mostly holds. But “sink / source” flips meaning depending on whether you speak from the device’s side or the receiving (input-module) side, and manufacturers genuinely disagree in their definitions ── take extra care with translated datasheets. When you need to be unambiguous, rely on the NPN / PNP labels and the example connection diagram.

Q4. Wired everything, the load still won’t move ── where do I start?

A. In this order: supply (+24V and 0V) → common grouping → terminal voltage while OFF → which way the voltage moves on ON. Expected: down for NPN, up for PNP. The full routine is in §8.

Q5. Are sensor NPN / PNP and PLC-output NPN / PNP different things?

A. The roles differ, but the current-direction (sink / source) thinking is identical. Treat a sensor output as a small output circuit that drives a PLC input, and the same diagram reads both.

Q6. Is it true that Japan runs mostly NPN and other regions mostly PNP?

A. As a tendency, yes. Japanese equipment has historically used NPN widely, while new installations in Europe and North America are almost standardized on PNP. Behind it is the ground-fault reasoning covered in §7. It is not an absolute rule though ── industries and devices mix. For export equipment or foreign devices especially, confirm against the datasheet, not the custom.

Q7. If I use relay-contact outputs, can I stop caring about NPN / PNP?

A. Contact outputs are far less polarity-constrained, so they dodge much of this problem. They bring their own constraints instead ── response speed, lifetime, contact rating ── and mixing them with transistor outputs invites confusion at maintenance time. Keep the drawings explicit about which is which.

Q8. My outputs have short-circuit protection ── can I ignore ground faults?

A. Protection reduces damage; it does not legitimize miswiring or faults. And as §7-1 showed, the NPN false-ON caused by a ground fault is not something device protection can prevent. Physical protection and inspection of the wiring stay necessary either way.

Q9. Should I go back and study N-type / P-type semiconductor physics first?

A. If your goal is control wiring, learning “current direction as seen from the terminal” first is faster and transfers further. The semiconductor physics can come later, driven by curiosity.

Q10. How do the live figures differ from real hardware?

A. Real hardware adds wiring resistance, input impedance, leakage current, noise, temperature effects, and protection circuits; the figures strip those away to show the skeleton of the principle. Use the figures to understand the principle ── use datasheets and standards for actual design numbers.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *