How can I use a PNP Transistor as a switch?

I got a V5 circuit that I want to turn on/off with a V3.3 microcontroller.
I want to use a PNP transistor so that when the load is off, it has no voltage compared to GND.
The reason is safety in case someone accidentally touches the load while grounded. The load is a pressure sensor, so it would only be on a couple of milliseconds at a time. (I know V5 will likely not do much harm, but I am trying to learn if it can be done with a PNP transistor).
I came up with this:


I tested it out, and it seemed to work flawlessly for me. But I am not an electrical engineer. Does anyone know if this circuit makes sense/has any pitfalls I should watch out for? Or is there a better way?

R6 is too high. It cannot steer Q3 in saturation.
At high load Q3 will get hot and your load will not receive 5V.
I would add a base resistor for Q4.

Suggest you use a common emitter circuit for the NPN.

You might look into using MOSFETs as they are todays components.

Hi @build_1971,

Do you mean Q3 won't saturate? (switching on/off the load) It does seem to work when I wired the circuit.

Would adding a resistor between the load and GND help fix that?

Good call!

Adding those suggested changes would something like this be better:

Hi @LarryD,

By common emitter circuit, do you mean this:

I'm trying to no have the load be connected to V+ while the transistor is not saturated that's why I am trying to learn if it can be done with a PNP transistor.

Does if the Load is on the source or drain side for MOSFETs?

That is what I meant. If load is a motor or relay, it is important to saturate the transistor. If it is a digital pin or a voltmeter it will work like it is now without trouble.

[quote="philw_01, post:4, topic:1087533"]
Would adding a resistor between the load and GND help fix that?[/quote]

No. A resistor may reduce the heat produced in the transistor, but your load will now see 5V - voltage drop over transistor - voltage drop over resistor

R12 is 100 kOhm..
That is way too high.

Yes.

The NPN collector goes a base resistor to the base of your PNP. Your R5 is still used.


For MOSFETs something like this:

1 Like

Hi,
Something like this;


Adjust R1, R2, R3 to suit.

Tom... :smiley: :+1: :coffee: :australia:

2 Likes

:+1:

Good schematic.
Depending on load, a lower R2 might be better.

Hi @TomGeorge, Thank you!
It looks like LarryD and build_1971 also approve of this. I will use this in my project!

Would this still be an issue, or was that just because of the high resistors/placement I used?

Hi @LarryD,

Thank you for this MOSFET version of the same thing diagram. I will also use this! Do you know why

MOSFETs are today's components? I am guessing they must have some advantages?

1 kohm is still too high for larger currents through load...
So depends on load...
Try measure and adjust.
Usually values are above 100 ohm...

Advantages: very low resistance when 'on'.
Low losses, low heat production.
Almost complete decoupling of arduino and motor circuit (resistance of gate is very very high).

MOSFETs are voltage controlled devices, i.e. they take no current from the Arduino output pin.

The turn on resistance Rds(on) is very low, often less than 45 milli ohms. This means the saturation voltage Vds will be low, hence the package power dissipation is very low, lower than that of the BJT.

These are the MOSFETs I routinely use:

Do you mean this?
image
The BD140 is a PNP transistor, so it will be ON when the base terminal is connected to the ground, and it will be off when a positive voltage is applied to the base terminal of the transistor. The base current of this transistor is less than 10mA.

Why is the transistor on the right upside down?

That graphic is wrong, for a PNP to work the collector has to be negative with respect to the emitter, in the right diag that is wrong.
In fact the right diag should have an NPN symbol.

The left graphic will only work if the voltage to the base resistor goes up to Vcc, if Vcc is higher that the HIGH output of the controller, the PNP BJT will not turn OFF.

Tom... :smiley: :+1: :coffee: :australia:
PS. @crystallin where did that graphic come from?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.