The datasheet for the TIP31 shows Ic(max) = 3 A, which is safely above the 1.25 A our motor will draw if it is stalled. So the TIP31 is a contender.
Next we have to verify that the transistor can safely handle the supply voltage we plan to use. The parameter we are looking for is the maximum collector emitter voltage, Vceo(max).
The TIP31 comes in 4 versions, with Vceo(max) ranging from 40 V to 100 V, all safely above the 12 V we plan to use. So the TIP31 is still a contender.
Now we need to calculate whether we can provide sufficient base current to keep the transistor in saturation. First we need to find what the base current will be when the transistor is carrying the worst-case current of 1.25 A. According to Figure 2, Ic/Ib = 10 or Ic = 10 * Ib. This means that for our collector current of 1.25 A, we would need to deliver a base current of .125 A, which is too much for our Arduino, which can deliver (safely) at most 40 mA 20 mA.
Finally let’s take a look at the datasheet for the TIP120. First, we see that Ic(max) = 5 A, and that Vceo(max) is 60, 80, or 100 V, so we are fine so far.
Next we check the base current. Again this is indicated in Figure 2, but this time Ic=250 * Ib or our collector current of 1.25 A requires a base current of 5 mA (5 * 250 = 1250), which is well below the maximum of 40 mA 20 mA the Arduino can put out.
Finally we need to select a base resistor which will be low enough to ensure that the TIP120 remains saturated, but high enough to prevent the Arduino from trying to deliver more current than it should. We want a current between 5 mA and 40 mA 20 mA, so let’s pick a midway point of 10 mA.
Back to Figure 2 where we see that when the collector current is 1 A, Vbe(sat) is about 1.5 V. Now if the Arduino is putting out 5 V, and Vbe is 1.5 V, that means that the resistor has a voltage drop of (5 – 1.5) or 3.5 V across it. Using Ohm’s law, R = V/I = 3.5/(10 mA)= 350 Ohms.
Source: How to use a transistor as a switch
This is all rather confused, and better to skip this and read Klass's explanations further down the thread. Note also that the maximum current on Arduino Micro pins is 20 mA, not the 40 mA used in these calculations.
Mmmh. Well those figures are very close to my motor so according to the above the TIP31 is not suitable. I can't saturate the TIP31 if the motor is drawing more than 400mA. I think I measured 350 mA max, but saw peaks around 800 mA, though now I'm not sure if that was when the motor was slowing and acting as a dynamo. But for the sake of argument, let's assume the motor takes 1 A when stalled.
This means that for our collector current of 1 A, we would need to deliver a base current of .1 A (100 mA), which is too much for our Arduino, which can deliver (safely) at most 40 mA (for the Arduino Micro). So that would rule out the TIP31 as a candidate. I'm pretty sure I have a TIP120 so probably time to switch over to that and do a bit of testing to see how things go. With the TIP120, same scenario, then we would need to deliver base current of (1000/250) = 4 mA. Easily < 40 mA of the Arduino. Further, let's go with the suggested 20 mA limit.
From the final paragraph in the quote, and looking at Fig. 2 in the TIP120 data sheet, Vbe(sat) = 1.5V so that's the voltage drop we use, and calculate ( 5V (arduino) - 1.5V (drop) ) / 20 mA = 3.5/0.02 = 175 ohms for the resistor. Note that the rather high voltage drop is due to the TIP120 being a darlington pair - effectively two transistors in the one package.
So, that's the next test - switch to a TIP120, change the resistor to ~175 ohms (or thereabouts) and also - I've bought some 3A Schottky diodes which unfortunately have thick pins but otherwise should really kill once and for all any backscatter from the motor. I've been advised to keep both the capacitor and the diode as close to the motor as possible to avoid EMI interference due to a long motor lead. So, I'll put them directly across the motor terminals.
If that all works OK, then I'll up the PWM frequency to 20KHz.