Using a PNP over an NPN to activate a solenoid
It’s mostly about convenience.
Low-side drive like the NPN shown can be controlled directly by ordinary logic levels yet can manage a higher controlled voltage (like the +12V shown in the example.)
A PNP (or P-FET) can be used to switch on the high side, if the switch supply is the same or lower than the logic level.
Example:



simulate this circuit &ndash; Schematic created using CircuitLab
Otherwise, read on.
For higher-than-logic voltages like the example, a high-side drive PNP needs a level shifter (such as another NPN) to translate the voltage up. The shifter ensures that the PNP base is pulled up high enough to reliably turn off the device.
Example:



simulate this circuit
(Some notes. R3 isn't strictly necessary, it pulls the Q1 base up to +12 when Q2 is off to improve noise immunity. R2 should be sized based on the required Q1 saturation current.)
Same goes for MOSFETs: a low-side N-FET can be switched with logic; a high-side P-FET needs a level shifter if it's switching a voltage higher than the logic level.
And here's the high-side switch, with MOSFETs:



simulate this circuit
NPNs (and their N-FET cousins) offer somewhat better current handling capability than the P-type devices, but only slightly so given modern process technology.