Swapping transistors

I'm re-trying to teach myself basic electronics to use with an Aarduino.
And I'm starting with transistors. Yay :slight_smile:

I think I can use this circuit to turn on an LED with an Arduino pin going HIGH.

If I wanted to do the same but with the Arduino pin going LOW, is it simply a case of switching the NPN transistor for the equvalent PNP? eg swapping a BC327 with a BC337? Or do I need to think about the resistor valuse all over again?

You need to mirror the circuit, so emitter to positive, LED and its resistor in the collector to ground. Resistor values are fine.

++Karma; // For a correctly presented, well thought out question on your first post.

when you swap PNP for NPN you are swapping the signs of all the charge carriers, so you have to swap
positive <-> negative everywhere in the circuit, as Perry said "mirroring" the circuit.

fenghuang:
If I wanted to do the same but with the Arduino pin going LOW,

But why would you? :roll_eyes:

That's the problem - since the code is always mutable, there is no need to adapt the circuit to the code, it always works the other way around.

Unless the circuit itself required a "high side switch" where the load must be connected to ground or has other control connections to it. But there are programming concerns with initialising high side switches.

You'd switch in order to have high-side switching, allowing a common ground to be permanently connected
(this is how its done in vehicles, for instance, which use chassis as ground-return).

Thanks.
So this is right?

pnp-npn.jpg

I assume it makes no difference whether the resistor comes before the LED in theoretical terms. Are there any real world implications?

pnp-npn.jpg

So this is right?

Yes.

Are there any real world implications?

No.

fenghuang:
I assume it makes no difference whether the resistor comes before the LED in theoretical terms. Are there any real world implications?

Only that if the LED is other than on your PCB, you will generally want the resistor on the driving transistor side so that the negative lead to the LED is ground where it can be commoned with other grounds and if the anode lead were to accidentally be grounded, the resistor would provide protection to the driving transistor.

FYI