With a lower voltage out uC like the prop, are PNP's a better option?
Is there a consensus on this?
In using the prop pins to turn things on and off through a transistor, is a PNP a better option? I'm setting up my PCB and trying to determine which type I'd like to use and then which type of pull up/down transistor to use for the base.
Example, a FET that needs 4.5v at the gate to turn on fully, the best my npn BJT could provide was ~2.6 before the emitter voltage was too high and it would turn off.
Is there an inverse scenario to the above that I am not thinking of, but maybe is worth considering?
In using the prop pins to turn things on and off through a transistor, is a PNP a better option? I'm setting up my PCB and trying to determine which type I'd like to use and then which type of pull up/down transistor to use for the base.
Example, a FET that needs 4.5v at the gate to turn on fully, the best my npn BJT could provide was ~2.6 before the emitter voltage was too high and it would turn off.
Is there an inverse scenario to the above that I am not thinking of, but maybe is worth considering?
Comments
BTW, the IRF3708 (nMOSFET) is fully characterized for VGS values as low as 2.8V and can be driven directly from a Prop pin.
-Phil
I'm no authority, but I like to use opto-couplers. Such as:
http://www.datasheetcatalog.org/datasheet/vishay/83645.pdf
Very handy in proto-typing (use as ouput buffer / or input buffer w/Pull up resistor). Mouser carry's them for around 0.86 each. Very handy chip! Much safer for CPU, and very handy for driving NPN or PNP BJT's.
It's supposed to be fairly linear, but I just use it for on/off app's. There are speed limitations though, but I seldom exceed 10KHz in my app's ... so not an issue for me.
... Tim
On all of them:
"IN" is just power voltage, any voltage as long as gates allow for it (usually 20V)
"1/0" turns off and on the power output (non-inverting)
"OUT" is the output power
The first one is for low power (about 2A), low frequency (up to 1KHz) applications.
The second one is for higher power (about 5A), medium frequency (up to 10KHz).
The last one is for high power (about 13A), high frequency (up to 75KHz).
I love schematics over words
I tested them with the transistors I was already using, and chose the resistor values to be a compromise between wasted power and frequency.
BTW, you can save yourself a whole bunch of effort and produce better-looking schematics by using LogicWorks 5, the succesor to DesignWorks Lite.
-Phil
For example, this circuit would output about 510mA (regardless of input voltage) assuming 100 gain transistors, 3.3V from µController, and about 900mV drop from base to emitter (on NPN).
And really, R2 is a good idea, but ultimately not essential if you don't care about a wee bit of leakage.
I still suggest my MOSFET solutions above. They will be lower frequency, but produce way less wasted power and thus allow for much higher power control, more easily.
You need a current-limiting resistor in the base circuit of Q2. You can put it between Q1C and the junction between Q2B and R2.
-Phil
The current limiting resistor from micro controller causes NPN to limit current from the PNP's base.
Explain why that doesn't work?
-Phil
So here is the math:
on NPN: Vbe is 900mV, so the 47K resistor has a 2.4V drop (3.3V - 0.9V), allowing 51µA of current into NPN base. 100 gain means 5.1mA current is sinked to Q1-C from R2 and Q2-B. So with 100 gain, the PNP allows [about] 510mA through.
That's why I had all those caveats above, it would work, right? If they were MOSFETs we were dealing with, no, but these are BJTs, so they have a fairly linear current control we can utilize to make things simpler.
BJT transistors are never "fully on" they are always a product of their gain.
You'd be right, except for one thing: it's usually not a good idea to design a circuit with a specific transistor gain in mind since, in reality, the actual gains can vary all over the place. If you wanted to sink a known current, it would be better to put a resistor in the NPN's emitter circuit, and drive the base through a much smaller resistor. The collector current would be approximately equal to the emitter current, or (VB - 0.6) / RE and would be much less sensitive to the transistor's gain.
But that's mostly beside the point, when all you want to do is turn on the PNP to full saturation. It's simpler, IMO, just to limit the PNP's base current to some ponderable number below iBmax with a base resistor and drive the NPN to full saturation, pulling that base resistor to near 0V. With both transistors in saturation, they will also dissipate less power.
-Phil
How wildly can the gain vary? The gain error is only [approximately] added together (in my method). So even if both gains were off by 10% in the same direction, power would only increase by 21%. It's common for cheap resistors have a 5% tolerance, so you could have a 15% difference with the method you propose, and a 27% difference with my method.
It seems the same current limiting on the PNP can be done with either method within some margin of error. Sure, the gain may off by a bit, so you just err on the side of caution, the same as you would with the PNP base resistor. It seems like a safe bet either way in my mind, and my system would use at least one less resistor (I still think R2 is optional as well -- but it would be optional in both cases). It's not like we are using the BJTs as regulators, just turning on some power. I liken it to some type of inverted darlington pair.
I am usually in the school of economy of parts as long as reliability is not lost.
...Anyway, I go back to saying, USE MOSFETs! The only reason I use BJTs is to increase speed of a circuit, and to more easily interface with TTL devices.
-Phil
Gotcha. I now understand why my design is bad, and am more better learnt.
Phil, I will download that software tomorrow, it has to be better than paint
How does it compare to this one? I take it is is superior with the propeller to the one I have linked below?
http://www.infineon.com/dgdl/IPP_B_I70N10SL-16.pdf?folderId=db3a304412b407950112b42a6a0a4339&fileId=db3a304412b407950112b42a72ce4342
Almost all of my applications right now are automotive and involve me using the transistor as a switch like a relay almost. I have not progressed to cycling them many times a second yet.
Thanks, I will try and set up a bread board like this tomorrow.
-Phil
The NPN acts as switchable current source in this case. If the Prop pin is high, the current is:
(3.3V - 0.6V) / R1, if it is low the current is 0. The current must be high enough to switch the PNP on. The exact gain of the NPN does not matter, its mainly R1 which defines the current.
Andy
Thank you
tie the base high via say a 10k resistor, so when the i/o pin is configured as an input, the transistor will be turned off
connect the base to the controlling pin on the propeller
use dira to convert the controlling pin to an output (and use outa[pin] := 0) to pull the base low, and the transistor can supply whatever current it is rated for (Ic) to your load
i.e. the PNP is controlled by using dira rather than outa
no?
@Ariba: I will have to keep that one in mind. Thanks.
Would Q1 ever conduct in this?
The emitter resistor would create ~6v at the emitter of the NPN and it wouldn't ever turn on with the base only seeing 3.3v.
Did you mean to put an emitter resistor on Q2?