Transistor base resistor
TC
Posts: 1,019
Hello all,
I have a small brushless DC fan that I want the prop to turn ON and OFF. The fan is 5V, and requires 200mA max of current. I am going to use a transistor to switch on and off the fan, and with the help from others on here, I think I have a grip on deciding what part I need and what base resistor I need.
But I want to make sure I am figuring things out right.
I need a DC gain of at least 13
200mA (LOAD CURRENT) / 15mA (BASE CURRENT)
Looking on DigiKey I found a transistor that is rated 800mA (cant hurt to have more than I need). It has a DC gain of 60 (Vce = 1V, Ic = 300)
So I would need a base resistor of 761Ω
3.3V (FROM PROP) * 60 (fHE) / ( 1.3(LITTLE WIGGLE ROOM) * 200mA)
I think the 2N2222 would work as well, and I might just use it. But I want to make sure I am right on my math.
Please let me know if I am right, or wrong.
Thanks
TC
I have a small brushless DC fan that I want the prop to turn ON and OFF. The fan is 5V, and requires 200mA max of current. I am going to use a transistor to switch on and off the fan, and with the help from others on here, I think I have a grip on deciding what part I need and what base resistor I need.
But I want to make sure I am figuring things out right.
I need a DC gain of at least 13
200mA (LOAD CURRENT) / 15mA (BASE CURRENT)
Looking on DigiKey I found a transistor that is rated 800mA (cant hurt to have more than I need). It has a DC gain of 60 (Vce = 1V, Ic = 300)
So I would need a base resistor of 761Ω
3.3V (FROM PROP) * 60 (fHE) / ( 1.3(LITTLE WIGGLE ROOM) * 200mA)
I think the 2N2222 would work as well, and I might just use it. But I want to make sure I am right on my math.
Please let me know if I am right, or wrong.
Thanks
TC
Comments
However, this is an excellent place to use a mosfet instead. There's no gate current when being used as a static switch like that.
I completely forgot about that, Thanks
I have never designed anything around a mosfet. How would I figure out what I should use, and what support parts do I need?
for switching.
In general to switch a BJT you need to fully saturate the device so that the voltage loss
is down to 0.1V or so, which commonly is done by providing about 5% to 10% of the collector
current to the base.
So for a 200mA load 10 to 20mA of base current would be used, so a resistor in the range
270 or 120 ohms would be appropriate. You allow 0.7V or so for Vbe (for a large high
current BJT Vbe can be as much as 1.2V, though.
You have to decide if high-side or low-side switching is appropriate for you. High-side
uses a PNP transistor, low-side an NPN.
If the supply is higher than the microcontroller supply (5V as opposed to 3.3V) then high-side
switching will require level-shifting too. This makes low-side switching often easier to do.
As for MOSFETs choose a logic-level device that has Rds(on) quoted for Vgs=3.3V - ignore
the current rating and threshold voltage, choose a device with the Rds(on) low enough that
the power dissipation is OK and you won't lose more than 0.1V across it.
While a MOSfet will work, I can't easily get the ones that will without importing to Taiwan and then they are all SMD devices -- no through-hole devices for the latest and greatest.
So I would go with the 2N2222 and accept that the 5v output will drop to 4.3v by its insertion. At saturation, the PDF says that 15ma will deliver 150ma, and 50ma will deliver 500ma. So you may have to provide 20ma to the base to get what you want.
A MOSfet would load the Propeller i/o pin much less that 20ma for full on.
Its NPN, thus it should be a low-side switch and the voltage loss across it should only be 0.1 to 0.2V.
Gain is for linear region, forget gain and look at the Vce(sat) table in the datasheet for its switching performance.
The transistor I am calculating with has a Vbe of 1.2V (Vce = 1V, Ic = 300mA)
So that would be (3.3V - 1.2V) * 60 / 230mA = 574Ω (just trying to get a handle on it)
Am I correct?
I was planing to use a low-side switching.
Would I use Ohms law to figure out if Rds is low enough? DigiKey's search is showing a list of different values ( 3mOhm @ 14A, 4.5V )
I am looking for something that has both through hole and SMD. for testing I am going to use through hole. But the final design is going to be SMD.
I only picked the transistor I did, because I wanted to understand what values I needed. The 2N2222 is to easy to calculate.
The situation is that the PDF provides information for ALL possible uses.
A. small signal amplification applications
B. switching applications (pretty much for digital signal transmission and reception)
C. saturation loading
So if you can't see the three different contexts, you get lost in the details.
To make things a little harder, the column data doesn't provide answers for all situations -- just a few guide line values. Sometimes you have to read the graphs to get the information you desire.
http://www.radio-electronics.com/info/data/semicond/bipolar-transistor-bjt/datasheet-specifications-parameters-definitions.php
And then, you have to learn a completely different skill to read MOSfet specifications. They tend to omit the linear mode of small signal applicaitions, amplify by voltage control (not current control), and so on.
++++++++++++++
You could just breadboard the fan and a 2n2222 and verify that it gets 200ma when a certain amount of ma turn on the base. Nothing wrong with some real testing.
ztx1049
A mosfet doesn't have wasted base current. However even with a mosfet there is need for a couple of resistors, one Rgs to hold it OFF when it first powers up, and a small resistor in series with the gate as good practice to suppress oscillations that can sometimes occur as it transitions through the active region.
And don't forget the kickback diode across fan, to protect the transistor.
Yea, tell me about it. I have found that out from a lot of datasheets I have seen.
I have noticed that about the graphs. Thanks for the link, it answered a couple questions. And offered A way for me to find more information. I'm just starting to get a grip on transistors, I think I will hold off on mosfets until I have transistors down pat.
I completely agree. I just want to try and understand the calculations behind my testing.
Haha... I have been playing with some ZTX651 for a few days now. I have fried quite a few 2N3906 experimenting. But so far, I have not fried a single one. I do like it though. with 5V for the fan, a 1kΩ pot, one leg going to ground, the other leg going to 3.3V, and the wiper going to base. I can adjust the voltage to the base, and see what happens. Right now I am seeing that 5mA on the base, will allow the fan to run at full speed.
I didnt think a brushless fan needed a kickback diode...... Am I wrong?
Glad you said something, I know I would've forgot that.
You should have a resistor in the wiper, (eg 90 Ohms) to prevent accidents of 3v3 direct to base => instant fried part.
With that setup, measure Ib and also Vce(sat) and plot them on a simple graph.
Check with a stalled fan, and see if you can measure the starting current.
Try all the different transistors you have.
Your hfe maths, only gives you a corner case, so is ok for a reality check, but not for Vce(sat) testing.
The more important figure in all this, is the voltage drop across the transistor. or Vce(sat)
Decide how much that should be 100mV ? 200mV ? 300mV ?, then find the Rb each transistor needs, for that.
Avoid > 1V, at that is >~ 200mW loss in the transistor. Cool to touch is always better than hot.
Yep... I figured that one out the hard way. How do you think I fried the 2N3904's I had?
Now all I do is not to turn the pot all the way.
Did not think of using a graph. Mostly because I only have one meter, and it is a hassle to unhook the base, and put the meter in-line. then do the same thing for the fan. But I will have to do it, to get a better understanding.
Been doing that. I have also been pushing them to there breaking point, and seeing when/where that is. But I am not just hooking them up and turning the pot all the way up. just to watch them blow. I am using my meter to see what voltages/currents do what.
I was not planning to use it as a replacement for testing, but only to confirm what I am testing. That is why I want to know if I am right with the math. Because I could be testing something that could be wrong, but the math is saying it's right.
Yep.... found that out the hard way...
>to unhook the base, and put the meter in-line. then do the same thing for the fan.
Not if you have a 100Ω resistor in series with the pot wiper like jmg suggested and also put a 1Ω resistor in series with the fan. Then you can simply measure the voltage across those resistors to determine the current and you don't have to unhook anything to make all the measurements with your one meter.
> I didnt think a brushless fan needed a kickback diode...... Am I wrong?
You're probably right about that, but I'd like to hear from people more knowledgeable about it. I've had the same question, because I too have a BLDC fan that is turned on and off with a transistor. It is a tiny 15mm Sunon blower, this one. It draws only 35mA. Here is what the signal looks like when the transistor turns it off (high side p-channel fet to 3.3V).
Yellow trace 1 triggers when the transistor turns the fan off, and you can see that there is no back kick, but there is fuzz. The orange trace B time-expands the fuzz and you can see that it a series of low pulses starting at about 0.7V and dying out. Those must be feedthrough from the windings as the motor continues to spin. The purple trace is the tachometer output, shifted over to show that it matches the pulses. It is a 6-pole motor running at 14000 rpm and the tach gives 6 pulses per revolution.
And see.... This is why I like to ask on here. There are so many wonderful, knowledgeable people on here. Measuring the voltage drop of a set resistor never crossed my mind. I think I might buy some =<1% resistors just for this kind of testing. Thanks.
I have to get an oscilloscope, so I can see stuff like this. I got the motor when the Dayton Hamvention was going on. I paid $1 for it (Beat that Erco ), so I don't have any specs except what is on the sticker. I would assume it is a cheap china knockoff. I think I'm going to add the diode, and I think I am also going to add a 1.0µF cap to the fan, in hopes to filter out the noise coming from the fan.
The running of the fan here is very quiet. There is none of the kind of hash you can see on a regular motor with brushes that are making and breaking the contacts.
I wouldn't classify the pulses after the fan turns off as noise. They are more like an interesting side effect, maybe an opportunity to measure the motor's speed without a tachometer. Here are a couple more screen shots. One shows the fan turning on and the gradual buildup in speed of the fan as shown by the tachometer. The second shows the fan shutting off. The tachometer no longer shows the speed because it no longer has power. But the pulses fed through from the motor still do reflect its speed. The fan actually keeps turning for much longer than the 'scope trace might suggest. It keeps turning for a little over a second after the power is off, good bearings. Who knows if your motor would do the same thing. but is probably not important and is just a curiosity. Oscilloscopes are indeed useful tools.
purple = power to fan, and emf pulses
red = fan tachometer
Just an aside about this - I have an old MOSFET databook from Motorola (1985) from when MOSFETs were new and it
explains the gate resistor thing. If you _parallel_ 2 or more MOSFETs then the inductance in the gate and source leads
can interact with the various capacitances in the devices to make an oscillator - here gate resistors or ferrite beads reduce
the Q and prevents oscillation. If you have a single MOSFET this mode isn't possible.
A more obvious reason gate resistors are needed when paralleling devices is the large (1..2V) spread in
plateau voltage between devices - this can cause very unequal current sharing during switch on and off.
Resistors mean the gates can each be at their own plateau voltages during the switching. Of course
driving the gates hard means switching time is short anyway so the duration of unequal current sharing
is short.
Driving a modern MOSFET from a MOSFET driver chip (output impedance perhaps 5 to 30 ohms) doesn't
need a gate resistor except to reduce switching transients. Driving a MOSFET gate from a Prop pin
requires a resistor to limit the surge current and protect the Prop pin (MOSFETs can have input capacitances
as high as 20nF).
Agreed. If I jump back and forth, I will not learn anything.
Yea, I'm going to add a diode across the fan's input wires. It would be cheap insurance. Thanks
As " lardom " suggested, I am going to work with one thing at a time. I have not got a 100% full grip on transistors, and it would be best for me to focus on one thing at a time.
Superbeta transistors are superior to the good old 2N2222, and MOSfets are likely even better. But many times, nothing but the 2N2222 is available locally and ordering from afar is both a time delay and added expense. SMD products are not easy for everyone to manage.
So all the options mentioned above are valid. Much depends on what you have on hand and what you are willing to spend. Good luck to you.
Agreed! Thank you.