Replacing PNP (3906) with NPN (3904)

Thread Starter

OldSkoolEffects

Joined Nov 18, 2009
68
I know this is probably beating a dead horse, but transistors are one of those simple things that I always confuse myself with.

I have a group of LEDs that are normally in an off state, and are turned on via an Arduino looking as switches and such. The initial design I have is using 2N3906s to switch on the positive side of the LED, such as this:



The circuit works, but after looking at it, it seems like if the LEDs are normally off, having the Arduino constantly putting out a HIGH signal to keep the 2N3906 off seems like a waste of power, and I don't like the idea of having too much constant current through the Arduino board. Because of this, I'd like to replace the PNP with NPN. Would the following work? The emitter and collector are swapped from where they were as PNP and the signal on the base is inverted.



I just wanted opinions before I break out the soldering iron. Because of physical limitations, the LEDs need to stay common ground.
 

#12

Joined Nov 30, 2010
18,224
If you can see which resistor has a voltage across it when a PNP transistor is turned off, you should use the NPN configuration, but don't do the emitter follower mistake (that everybody else makes). Put the LED on the collector side of the transistor.
 

Attachments

patricktoday

Joined Feb 12, 2013
157
If you can see which resistor has a voltage across it when a PNP transistor is turned off, you should use the NPN configuration
That is incredibly cryptic.

But I was just going to comment that, in your original circuit, when the output is HIGH the transistor is off and so there is actually no current flowing out of the pin. There should be a resistor though to the tune of 10k, though, to the base so you're not putting 5 volts between the base and emitter when the voltage is LOW. But the venerable 0x000C says to go with the NPN so I'm probably missing something :)
 

patricktoday

Joined Feb 12, 2013
157
I think that if you look really closely at the drawing I posted, the places where there is a voltage difference across a resistor will become apparent.
(Hint: There aren't any.)
Right, I noticed that part and therein lied the crypticness. It seemed like a potential non sequitur that one should switch to NPNs under these conditions. :D
 

WBahn

Joined Mar 31, 2012
30,072
One thing I would recommend to the OP is to start drawing your schematics in a more conventional way, namely with high supplies at the top, low supplies at the bottom, and current generally flowing from top to bottom. Not only will you communicate better with other people (because most people use that convention) but you will probably find yourself understanding things better (because there's a reason most people use that convention).
 

#12

Joined Nov 30, 2010
18,224
Right, I noticed that part and therein lied the crypticness. It seemed like a potential non sequitur that one should switch to NPNs under these conditions. :D
Must look up, "cryptic". (I seem to be missing something.)

OK. I get it. My statement contains a hidden meaning. The hidden meaning was that there is no resistor with a voltage across it.

Of course, I'm assuming that an MPU, presenting "high" on an output pin, will not only output Vcc, but it will not accept current from Vcc, even if it's available.
 
Last edited:

WBahn

Joined Mar 31, 2012
30,072
If you can see which resistor has a voltage across it when a PNP transistor is turned off, you should use the NPN configuration, but don't do the emitter follower mistake (that everybody else makes). Put the LED on the collector side of the transistor.
I found this confusing as well. I now understand what you are saying and why you said it this way, but it is easy to not catch the point being made and think that you are trying to make some other point entirely. It is that "other point" that appears cryptic, largely because there IS no other point to find (and hence why it is so hard to find it).
 

Thread Starter

OldSkoolEffects

Joined Nov 18, 2009
68
I just swapped 2N3904s in for 2N3906s and inverted the digital signals into the base and it works how I want it. I should have just done this first and I would have saved myself a boatload of time and effort.

I could have done with "You can directly replace them, as long as you invert your signal."

This thread can be locked.
 

#12

Joined Nov 30, 2010
18,224
I'll put this in a direct form: The pnp configuration does not use any current. You can reverse the polarity of the transistor and the logic of the processor if you want to, but it will not improve "wasted" current. A "high" output connected to Vcc, whether with a resistor, a transistor, or a piece of wire, will not accept current from Vcc because, 1) there is no voltage difference and, 2) the current sink internal to the MPU is not available when the output is in the high state.

I tried to provoke you to examine this yourself, to think and learn, but I failed. I apologize for wasting your time.

ps, This site does not lock finished threads. They are left open indefinitely. Locking finished threads would have the beneficial result of stopping beginners from mistakenly posting to threads that are months or years old, but this site doesn't do that. No reason, just "policy".
 

WBahn

Joined Mar 31, 2012
30,072
I just swapped 2N3904s in for 2N3906s and inverted the digital signals into the base and it works how I want it. I should have just done this first and I would have saved myself a boatload of time and effort.

I could have done with "You can directly replace them, as long as you invert your signal."

This thread can be locked.
Do you still not have a resistor between the Arduino output and the transistor base?

It sounds like you may now be running your output in a emitter-follower configuration, which is generally undesireable in an application in which it is desired that it act as a switch.

You will generally not get too many direct answers to questions that appear to be education-focused (whether it is an actual assignment or not) because most of the people here that respond to such posts are trying to help you find the solution largely on your own.
 

DickCappels

Joined Aug 21, 2008
10,185
The O/P found a solution. Of course in reality, its to use a diode instead of a transistor. He could do better by just omitting the transistor completely and shorting the 2N3904 base and collector pins together.

I hope the current drawn by the LED is not enough to hurt his controller.
 

WBahn

Joined Mar 31, 2012
30,072
The O/P found a solution. Of course in reality, its to use a diode instead of a transistor. He could do better by just omitting the transistor completely and shorting the 2N3904 base and collector pins together.

I hope the current drawn by the LED is not enough to hurt his controller.
I don't follow. The OP's solution, as near as I can tell, is to use the alternative he posted in his original post. That is an emitter-follower configuration.

Could you post a sketch or description of why you think is the solution that the OP found?

Besides, how can he omit the transistor completely and short the base and collector pins together? Seems like you could do one or the other, but not both.
 

ErnieM

Joined Apr 24, 2011
8,377
In this case there is nothing wrong with an emitter follower configuration. In fact, as it dumps the base current into the LED load it is actually more efficient.

The LED runs on a voltage lower then the power supply, so some voltage must get dumped somewhere. Doing so in both the BE junction and the series resistor, some here and the rest there, is fine.

#12: I notice the PNP version differs from the NPN version in that you put a resistor B to E in the PNP. I would submit this resistor is not required with a logic drive such as this: the base resistor is there to capture any collector leakage current and remove it from the base.
 

Ron H

Joined Apr 14, 2005
7,063
In this case there is nothing wrong with an emitter follower configuration. In fact, as it dumps the base current into the LED load it is actually more efficient.

The LED runs on a voltage lower then the power supply, so some voltage must get dumped somewhere. Doing so in both the BE junction and the series resistor, some here and the rest there, is fine.

#12: I notice the PNP version differs from the NPN version in that you put a resistor B to E in the PNP. I would submit this resistor is not required with a logic drive such as this: the base resistor is there to capture any collector leakage current and remove it from the base.
Very good points. I agree with both of them.
 
Top