Short Answer: Use NPN for switching the low side (between load and ground). Use PNP for switching the high side (between power and load).
Detailed: The choice depends on where you place the load relative to the transistor.
NPN (Low-side switch)
VCC ────[LOAD]──── Collector
│
NPN
│
Emitter ──── GND
Base ─────── Control signal (2–5V)Advantage: Easy to drive (control signal referenced to ground)
Use when: Load connects to VCC, transistor connects load to ground
PNP (High-side switch)
VCC ──── Emitter
│
PNP
│
Collector ────[LOAD]──── GND
Base ─────────────────── Control signal (needs pull-up)Advantage: Load is grounded on one side (safer for some applications)
Disadvantage: Control signal must be near VCC to turn OFF (0V to turn ON)
Quick decision chart:
| If you want to switch... | Use | Control signal | Example |
|---|---|---|---|
| Load to ground | NPN | HIGH (2–5V) turns ON | LED, relay, motor |
| Load to VCC (grounded load) | PNP | LOW (0V) turns ON | Common-anode LED, some sensors |
| Both sides floating | Relay or optocoupler | Isolated | AC loads, different voltage domains |
Pro tip: For microcontrollers (3.3V or 5V), NPN is easier because a GPIO HIGH directly turns it on. PNP requires the GPIO to go LOW to turn on — fine, but you need a pull-up resistor to keep it OFF by default.

Comments
Post a Comment