# High side NPN

So I was working on redesigning the controller board for my 8x8x8 LED cube (common cathode) to make it brighter when I noticed something odd. I could find lots of examples on the net of why npn transistors can't be used for high side switching which illustrate the point using a schematic with a 5V signal controlling a 9V or 12V load. Something I couldn't find was an example of using an npn for the high-side switching of a lower voltage source. If I dropped the voltage supplied to the LEDs to something like 4V, couldn't an NPN be used in that case? I ask because although adding pnp transistors would allow me to make the LEDs brighter with a simple software change to invert the logic, soldering 8 darlington arrays is a LOT more appealing than 64 sot23 or to-92 packages. Of course this is assuming that the forward voltages don't add up to more than 4V, in which case the PNPs are the only way to go...

See the pictures below - even with a "saturated" 2222 transistor the max current you can press through the 2 LEDs (Vf=2.1+2.1=4.2V) is about 5mA.
That is because you need MUCH higher driving voltage than 5V.
On the third picture we use 6V driving voltage in the same setup - the current through the LEDs is 50mA.
On the 4th picture you may see the circuit with IRF530 - nchannel FET. As you can see in order to get 50mA current through the LEDs you need 8.5V input driving voltage (with 5V driving voltage the current is 0mA).
We discussed this topic already, don't we? pito:
See the pictures below - even with a "saturated" 2222 transistor the max current you can press through the 2 LEDs (Vf=2.1+2.1=4.2V) is about 5mA.
That is because you need MUCH higher driving voltage than 5V.
On the third picture we use 6V driving voltage in the same setup - the current through the LEDs is 50mA.
On the 4th picture you may see the circuit with IRF530 - nchannel FET. As you can see in order to get 50mA current through the LEDs you need 8.5V input driving voltage.
We discussed this topic already, don't we? As I mentioned in the first post, I've seen lots of examples of why a 5v signal can't be used to control a 12v source using an npn in a high-side switching configuration. But following your examples, what happens when there's 5v on the base and 4v on the collector? I guess what I'm getting at is... How much higher does the driving voltage have to be in order to control 4V? How about 3V? Where's the cutoff point where an NPN will work?

How much higher does the driving voltage have to be in order to control 4V?

There will be a 0.7V drop between the voltage on the emitter and the voltage on the base. So for 5V on the emitter you will get 4.3V on the base.
However you will then have the transistor dropping the remaining voltage from the 12V which is 12-4.3 volts. Multiply that by the current to get the power dissipation in the transistor. In other words they will get hot used like this.

Of course this is assuming that the forward voltages don't add up to more than 4V,

It depends on how many LEDs you have and what colour they are.

How much higher does the driving voltage have to be in order to control 4V? How about 3V? Where's the cutoff point where an NPN will work?

The NPN bipolar transistor is current driven device. Talking voltage is a simplification.

Long time back I showed you the equation for nchannel mosfet (ie IRF530) - that is a a device which is voltage driven.

Vdriving = Vthreshold_nfet + Vfd1 + Vfd2 + Idiodes*R3

For example (for above schematics):

Vdriving = 4V + 2.1V + 2.1V + 0.05A*10ohm = 8.2 + 0.5 = 8.7 Volt (similar to the above simulation result, btw)..

For NPN transistor in above schematics:

1. hfe = 100, Ic=100mA, Ib=1mA
2. Rbase = (5V - (0.7 + Vfd1 + Vfd2 + Idiodes*R3)) / Ib = (5-0.7-2.1-2.1-0.5)/1mA=-0.4V/1mA = -400ohm
The above gives a nonsense for 5V, you have to use 6V for example. That is a big simplification of course, but it works.

So in order to use the high side NPN in such schematics the (0.7 + Vfd1 + Vfd2 + Idiodes*R3) should be, let say, 0.5V (or better 1V) LOWER than the max driving voltage (aprox 5V with arduino), for example (mind this is not the proper engineering design practice, however)..

Example: the above schematics with 1 diode with Vfd=3V and 30mA Idiode current:

Rbase=(5V-(0.7+3+0.03*10))/Ib=(5-0.7-3-0.3)/1mA=1V/1mA=1000ohm. So this will work, provided the arduino output can source 1mA at 5V output voltage (It means with 4V arduino's output it will not work probably) But again, we do not talk cutt-offs or threshold voltages when dealing with bipolar transistor or other such devices (diodes, etc).

PS: the proper way of driving your LEDs with high-side switch is with PNP switch and an NPN driver - see for example:
http://forum.arduino.cc/index.php?topic=165994.0 http://forum.arduino.cc/index.php?PHPSESSID=ojkosvqsv5f3s78vlubp4l5ls4&topic=160532.0

Thanks for explaining all that, guys. I had a feeling that it was possible to make it work, but I think I'll save high side npn switching for breadboard experiments. It works, but as Pito said, it's not the right way to do things...

While looking around at LED matrix designs and how they solved this problem, I noticed the MIC2981 in a few schematics. It's a little pricey at \$2.83 each from digi-key, but looks like it will get the job done with just 8 ICs and a handful of resistors. It's a one-off design built for fun, so I'll gladly pay a few bucks extra to avoid adding all those PNPs.

What you were doing was/is not "high side switching".
You were making an "emitter follower".