Electrical – PNP vs NPN input to LM7805 VR

voltage-regulator

Can I use the output of an NPN proximity switch as the input to an LM7805 (positive input) voltage regulator? I'm a little confused on PNP vs NPN, but I'm reading as fast as I can. Also I see that they make an LM79xx series of VR's that, I think, accept a negative voltage as the input, would this negative voltage come from an NPN style device?
Thanks, Jim G.

Best Answer

You want a PNP type. That type sources current.

If you need to use an existing NPN type you can add a high side switch, but at that point you'd perhaps be be better off using a regulator with an enable input as @Ignatio suggests.

Here is one way to do the former:

schematic

simulate this circuit – Schematic created using CircuitLab

The proper choice of R1/R2/Q2 depends on the current you intend to draw from U1.