Sourcing a transistor and base resistor

datasheettransistors

I'm aiming to find a transistor that will be used to switch a relay, and can handle the following specifications. I think I've found one and would appreciate having the calculations checked and checking if I have missed anything important:


A device is an Arduino and is connected to base of transistor.

Device voltage: 5V
Device source current: <= 5mA

The collector pin of the transistor is connected to a relay.

Collector voltage (Vce): = 5V
Collector current (Ic): = 90mA
Transistor power dissipation: >= ( 5 * 90 ) >= 450mW

DC current gain F.O.S. = 5
DC current gain >= ( Collector current / Device source current ) * DC current gain F.O.S.
DC current gain >= ( 90 / 5 ) * 5
DC current gain >= 90

I've found the BC337 transistor by ON Semiconductors and using this datasheet.


Collector – Emitter Voltage (Vceo) is 45 Vdc, which covers the 5V required.

Collector current – continuous (Ic) is 800 mA, which is well above the 90mA the circuit requires.

Total Device Dissipation @ Ta = 25c (Pd) is 625 mW, which is above the 450mW required.

DC current gain is given for Ic = 100mA and Vce = 1V, which the Ic is quite close to the collector current (90mA), so this should be okay. The Vce given is 1V, although the circuit runs at 5V, but from all that is understood, the Vce is a bit on the meaningless side once the transistor is saturated.


The resistor is needed to restrict the transistor sourcing too much current from the device, which is limited to 5mA.

Base − Emitter on voltage (Vbe(on)) for the transistor has a maximum of 1.2V, which will be used for a worst case scenario. So, the resistor connected between the device and the base pin should drop:

Resistor voltage drop = Device voltage - Base − Emitter on voltage
Resistor voltage drop = 5 - 1.2
Resistor voltage drop = 3.8

This means the resistor must have a resistance value of:

Resistance = Voltage / Current
Resistance value = Resistor voltage drop / Device source current (A)
Resistance value = 3.8 / 0.005
Resistance value = 3.8 / 0.005
Resistance value = 760 Ohms

  1. Is this all correct, or have I made some fantastic error or overlooked a large problem?
  2. Vbe(on) is quoted for Ic=300mA and Vce=1V. I think I understand that Vce isn't too much of a problem once the transistor is saturated, but the collector current is 300mA, while I'm passing only 90mA – is this something to be concerned about, and why should or shouldn't I be concerned over this?

Best Answer

Since you will be using transistor as a switch the rule of thumb for a saturated BJT is to use beta (current gain) of 10 or 20. Meaning you can directly drive a general purpose BJT (with at least 100mA of collector current) from your Arduino pin.

This is how I would do it:

schematic

simulate this circuit – Schematic created using CircuitLab

NPN always has a base voltage ~0.7V higher than its emmiter. Since the emmiter here is grounded the base voltage sits at around 4.3V (5V that the Arduino can provide -0.7V). And a base current of 10mA gives us 4.3/0.01 =430 Ohm, but you can use a more standard value of 470 Ohm.

Diode D1 is there to dissipate the energy stored in the relay coil when the transistors shuts off. You can read more about this here on EE stack exchange.