DC motor control using BJT

allanhurst:
1/

Make R1 `150 ohms, R3 0 ohms, use a BC337 and add a diode eg 1N4001 across the motor , cathode to supply,
and use about 12V as the supply.

Allan

Here's how to figure this out ["teach a guy to fish" donchaknow ;D]

Find the datasheet of the transistor you plan to use -- let's use the BC337. I typically search for the device on a site like Mouser, then click on the datasheet link [if you already have the part in hand, then try to find the same manufacturer that made the part you have -- but, the specs for a part number are fairly standard, so you can get away with looking at a different manufacturer's datasheet].

On the datasheet, first, make sure the transistor can handle the highest voltage involved. In this case, you'll probably be using 12V, so make sure the Collector-Emitter Voltage is at least 1.5 times 12V or 18V -- so if the Collector-Emitter Voltage is 18V or higher, you're good to go. The BC337 is 45V so excellent! BTW: you'll usually find this specification in the MAXIMUM RATINGS section.

Then, check to see if it can handle the highest current. Now, this is a little more tricky, because it's more about the transistor's ability to handle the amount of power it will be dealing with. BUT, because this is a switching application, it's a lot simpler. What you want to look at is the VCE(sat). In most cases you'll find that under the ELECTRICAL CHARACTERISTICS. The VCE(sat) is the voltage across the Collector-Emitter junction when the transistor is turned fully on. Some datasheets have graphs that allow you to see what this is at different amounts of collector current [the current going from the Collector to the Emitter]. And some datasheets, just specify this for one or a few different collector currents. The two datasheets I looked at, for the BC337 [Central and ON Semi], this is only spec'ed at IC = 500mA. Which is 0.7V.

Notice how, in that VCE(sat) entry, along with an IC stipulation, there is also an IB indicated? That's because, to turn a transistor on "hard" for switching purposes -- I.e. put it into saturation -- the ratio of the Collector current (or IC), to the Base current (or IB) needs to be in the range of 10 to 20. Notice that the IC value is 500mA, and the IB value is 50mA and that the ratio of the two [500mA/50mA] is 10. That's how much base current is needed, when the collector current is 500mA, to get the Collector-Emitter junction down to 0.7V. BUT, this ratio of=10 stipulation is not written in stone.

Fun Fact: the ratio of the Collector current to the Base current (or IC/IB) is called the Beta. The Greek symbol ß is also used to represent Beta.

What we, next, need to look at, is the MAX Power Dissipation which is 625mW, for the BC337. First let's cut that in half-- because the value they give is the ABSOLUTE MAXIMUM (in other words, right before the thing starts burning up!). So, half of 625mW is 312.5mW. Caveat: this is the power rating at room temperature. If you plan to use this transistor at higher ambient temperatures, then use the derating formula (the one called "Derate Above 25°C"): 5.0mW/°C. So, if the highest ambient temperature will be, say 30°C, then 5.0*(30-25) = 25mW ... so, the ABS MAX power is: 625mW - 25mW = 600mW. And, thus, our excepted Max, which is half the ABSOLUTE MAX, will, instead, be 300mW.

So, let's play with some numbers. An Arduino output can, technically, deliver up to 40mA -- but, that's also an ABSOLUTE MAX. The "happy" max is more like 20ma [the datasheet for the ATmega328P (which is the MCU used in the Arduino Uno) uses "20mA" when it talks about things like VOL (how low the output goes when a LOW is written to a pin) and VOH (how high a pin goes)]. But, since we need all the current we can get, lets call it 30mA. At a base current of 30mA, and a Beta of 10: 1030ma = 300mA. And, the VCE will be a little less than 0.7V at 300mA, but let's call it 0.7V. The power that will be dissipated in the transistor, when it is full on, with 300mA flowing in the Collector will be: 0.7V300mA = 210mW. Which is well below our accepted max of 300mW, so the transistor should survive!

So, to set the base current to 30mA, use this formula: (VCC-VBE)/IB = RB
OR: (5V-0.7V)/30mA = 143Ω [or the standard value: 142Ω]

--That concludes part 1 -- part 2 to follow after a little more than 5 minutes :stuck_out_tongue: