all of these transistors say 5 volt max on the base via the datasheets.
So if it is current based, couldn't I apply 12v to the base as long as I use the correct resistor?
Because the base-emitter forward voltage drop is a diode voltage drop (0.5 - 0.8V) because
a transistor consists of diode like junctions. (we can skip the details for now)
So if the forward voltage is 0.7V (typ) and as you already know , it is CURRENT based , and the
5V you referred to is actually the Breakdown Voltage (BVEBO) (the voltage at which the transistor junction is destroyed), and there is NO resistor if for example , you apply 5V to it without a resistor, the the base junction will conduct as much current as your 5V supply can deliver (800+ mA in the
case of an arduino) and the base junction will fry.
So what should you do if , say, you wanted to drive the transistor with 5V ?
The 2N2222 collector current max is 600 mA and hfe 300 so if for example your load
was 500mA (which is really pushing it for this transistor) then the base current should be:
b = Ic/hfe
= 500mA (0.5A)/300
= 1.66 mA (0.00166A)
and the base resistor Rbase = (Vin - 0.7V)/Ibase
= 5V-0.7V/1.66 mA (0.00166A)
= 4.3V/0.00166A
= 2590 ohms (2.4k ohms to 2.6k)
hfe is the transistor small signal gain, which is generally a spec used for small signal
applications where you are not using saturating the transistor as you would driving a relay .
If you want to use it as a driver instead of amplifier you would want to saturated it and would
look at the base=emitter saturation voltage, which for this transistor is specified for a collector
current of 500 mA and a base current of 50mA, in which case the base resistor would be:
the base resistor Rbase = (Vin - 0.7V)/Ibase
= 5V-0.7V/50 mA (0.05A)
= 4.3V/0.05A
= 86 ohms (91 ohms)
Now if instead of 5V, you wanted to drive it with 12V, then you would simply
follow the above but use 12V for Vin , yielding :
Ibase = (VIN-0.7v)/Rbase
or if your calculating the resistor value,
Rbase = (VIN-0.7v)/Ibase
so, for 12V,
for a base current of 2mA,
Rbase = (VIN-0.7v)/0.002A
= (11.3V-0.7V)/0.002A
= 5650 ohms
or if using it as a relay driver:
the base resistor Rbase = (Vin - 0.7V)/Ibase
= 12V-0.7V/50 mA (0.05A)
= 11.3V/0.05A
= 226 ohms (220 ohms)
My guess is that you want to use the transistor as a driver and therefore want to saturate it
IbaseSat = 10 times the small signal current , so depending on the collector current
probably 20 to 40 mA