# Transistor help

I want to drive a 12 volt relay, with a 33ma current draw. From this I gather I need to use a transistor, but the one thing I’m still not completely rock solid on is at what base voltage the transistor is at maximum current. Take for example this transistor:
http://www.digikey.com/product-detail/en/STPSA42/1026-STPSA42-CHP/2521339
Voltage of collector emitter is 300V, so does that mean that you can put 300V in before the collector and emitter short together? Or is that something else? Would I be able to use 5V on the base to get the transistor to switch all the way?..
If anyone could help me out I’d appreciate it

That part is fine. Arduino pin thru a 270 ohm resistor to the transistor base. Emitter to Gnd. Collector to Coil. Other side of coil to 12V. Diode across the coil pins with Anode to transitor collector, emitter to 12V.

Yes, 300V to damage it. Likely fail when current exceeps 500mA first tho. Your 12V 33mA will be fine.

How is it you determine that 5v with a 270 ohm resistor is enough to fully drive the transistor to an on or off state?

Unlike FETs, transistors are current control devices. The specified gain of the transistor is 40, so for 33ma of collector current you will need approximately 0.7mA of base current. With an arduio output voltage of 5 volts and a base-emitter junction voltage of 0.7, the base control resistor should be 4.3/0.7 Kohms. That equates to 6 Kohms. You need to ensure the transistor is driven hard on (to minimise heat generation) so I'd say something in the order of 2.7 Kohms will do.

Whilst the suggested 270ohms is an order of magnitude lower it will do no harm to the circuit operation - just means the base current is a bit high (and energy wasteful) The collector current will not rise above 33mA since it is determined by the load device (the relay)

Thank you! That all makes sense now! Thanks

CrossRoads: That part is fine. Arduino pin thru a 270 ohm resistor to the transistor base. Emitter to Gnd. Collector to Coil. Other side of coil to 12V. Diode across the coil pins with Anode to transitor collector, emitter to 12V.

Yes, 300V to damage it. Likely fail when current exceeps 500mA first tho. Your 12V 33mA will be fine.

"Anode to transistor collector, emitter to 12V" should read "Anode to transistor collector, cathode to 12V" and the diode should be wired as close to the relay coil as possible.

Why would someone pick a bipolar over a MOSFET here? I'm actually asking.. It seems nonsensical to me, but I think I just don't understand what advantage bipolar transistors have at all.

Much cheaper... [than a TO220 through-hole MOSFET at least]

Also in some situations perhaps current is easier to control than voltage, and or you have a limited vcc and want to switch alot on a 3.3v board your gonna need a mosfet with a mighty low vgth, on the other hand any cheap transistor since all you need is. 7 volts

Thanks for the corrections & further explanations, I typed that up in a bit of a rush I think. BJTs over MOSFETS are also generally less prone to electrostatic damage, can take more abuse.

Awesome. Simple answers, and good to know. Thanks guys. 8)

I tend to make the choice based on the current I am driving.

With the BJT you get a fixed voltage drop Vce. With a MOSFET the voltage drop is a function of the current flowing through it - it's basically a resistor (V=IR).

So, if the current flowing through a MOSFET is going to create a larger voltage drop than Vce of a BJT then I choose the BJT. Otherwise, I go for the MOSFET.

If it's borderline, then I look to see what else is in the circuit and if I can re-use anything. It's cheaper to buy multiple of the same device if at all possible.