I do have one last question: how do I know at what Vbe/Ibe the transistor will switch on, from looking at the specs on the data sheet?
Cheers.
Technically, you need the
input characteristic curve of the BE junction which is not supplied on the given datasheet. But for
silicon transistors, it is always around
0.6 to 0.7V unless you have multiple BE junctions like a Darlington transistor. Having said that, there is no precise turn on voltage. There is a sharp knee which is generally around 0.6 to 0.7 V. In most simple circuits the exact nature of the input curve is not necessary because the biasing resistors will self regulate the DC base and emitter voltages. In this case, the ratio of the base resistor to the collector resistor ensures that the transistor will be on. Essentially this occurs because the resistors are linear devices and BE junction of the transistor is not. The BE voltage will change only slightly for large changes in the base and collector currents. So you can begin your design by assuming approximately 0.7V across the BE and then calculate the required values of the resistors to ensure the transistor is saturated.
In this case, the collector resistor is set to produce 100 mA when the transistor is saturated. Vce will be low, say 0.1V. We'll assume 0V. The Ired drop will be about 2V (varies slightly with actual Ired and current ) and the supply is 12V. so Rc = (12V-2V)/100 mA = 100 ohm ( you can subtract another 0.1V for Vce if you want but as you can see it will not matter much ).
For the base resistor we start by assuming 0.7V drop across BE when it is on. We should be safe in assuming a beta of 100 for most general purpose npn transistors. As the transistor saturates, there will not be enough supply to allow beta to remain high. This is actually the main reason why beta drops as the transistor saturates. So Ib = Ic / 100 = 1 mA. and the voltage across the base resistor will be 5V-0.7V so Rb = (5V - 0.7V) / 1mA = 4.3 kohms. This is the bare minimum to turn the transistor on and can be unpredictable because of variations in beta and the input characteristic curves. So it is better to choose Rb < 4.3kohms. Since the Arduino can supply 40mA, the minimum value of Rb is 4.3V / 40mA = 107.5 ohms. As you can see 1 kohm should be plenty to ensure saturation and not drain the output of the Arduino.
Let's go back for a moment and see what I meant about saturation supply. At 1 kohm and 1 mA, the voltage across the base resistor is 1V. That means 4V across the BE junction. ( I am assuming of course 5V out of the Arduino which is not actually accurate but good enough for our purposes ). The BE junction would blow with 4V across it. It is rated at a max of 1.2 V. But this won't actually happen because the input curve of the transistor, if we had it, would surely have a Ib >> 1mA for Vbe of 4V. So what happens? beta drops!!! Ib will be larger than 1mA and Vbe will self regulate to match the input curve of the transistor to the required beta.
Note: this only happens because we ensured the transistor will saturate by making Rb smaller than 4.3 kohms.
Also Note: none of the above design elements were based on the specs of the transistor other than beta. As I said, general npn transistors almost always have beta > 100 anyways. And,
if you had to, you could make this work with a beta of less than 100.