Base resistors for transistors - Laundry room alarm and ventilation

Status
Not open for further replies.

MrGlasspoole

Well-known member
I always have problems with the base resistors for transistors.
On the Arduino it's not that critical but with the Teensys 5mA...

Please help me calculate the resistors. In red i wrote down the mA i need to switch.
Link to circuit: http://oi67.tinypic.com/2r1zfo2.jpg
Sorry TinyPic makes it unsharp and here as attachment it is downsized to small.
 
Basic idea is to find the B/E voltage for the fully on state, somewhere around 0.7V. Then find the output pin voltage, about 3.3v for a Teensy. Subtract 0.7 from 3.3 and you get 2.4 volts which is the target voltage drop

R = V/I

R = 2.4/0.005

R = 480 ohms as lower limit for resistor size to not exceed the teensy limits. Depending on transistor you can probably use something in the low k ohm range and still get transistor to work.

Doing this properly involves finding the gain of the transistor and manipulating to BE current to control CE current but for a basic on/off drive the above will work.
 
Sure I can find allot of places where the calculation is explained but i have always problems reading the hFE from the data sheet.

I found a side where they use VCE(SAT).
But a BC337 can switch 800mA and with that calculation i need 80mA base current?

VCE(SAT) = IC / IB
500 mA / 50 mA = 10

Ib (base current) = 800 mA / 10 = 80 mA

Just 400 mA would be 40 mA base current...
 
Last edited:
Doing things properly with the gain really requires knowing more about the other components in the circuit, since the CE current can't magically be more than what the supply can provide. When using transistors as switches (rather than amplfiers) my mental model is that the transistor has a variable resistance, with no BE current it will be very high (open circuit), with some high but sane value it will be a very low resistance (hopefully low enough to be considered a short circuit). Aim then is to adjust the BE drive such that it is as high as possible without exceeding pin drive limits or the transistor capabilities. This in turn gets the internal resistance of the transistor as low as possible for whatever load is actually connected, which hopefully doesn't exceed the power or current limits of the transistor.

This will most likely place the transistor well into saturation, which has some negative effects in switching speed, efficiency etc, but is also easier to either calculate or simply measure than trying for a perfect bias approch.
 
Vce(sat) is the collector emitter saturation voltage which can never be the quotient of two currents. The quotient Ic/Ib is the current amplification factor, also called hfe which is not a true constant since it varies with the collector emitter voltage and thus it is most meaningful when the transistor is used as a small signal amplifier. When a transistor is used as a switch, the design rules are different. If you need to switch 800mA, the first thing is to find a transistor which supports a collector current of 800mA. The you take into account. that you have 5mA to drive it. Thus it must have a minimum hFe of 800/5= 160. If the hFe is bigger than that, don't worry, a switch can not be more closed than closed. Last check: Does the chosen transistor support a base current of 5mA? If yes, go for it and select a base resistor of (3.3-0.7)/0.005=~510R. That's all.
 
@Theremingenieur, you're right. It is not Vce(sat). But since you find Ic/Ib under the Vce(sat) diagram in the data sheet i misinterpreted it wrong.

Are there recommendations for bipolar transistors up to 500mA that work with the Teensys 5 mA.
Here the BC337 is really popular but on the Teensy...
 
I'd go for the BC 337, but to make sure that the hFE is high enough, I'd take the BC337-400 to make sure that it will fully switch through with a 5mA base current. Since the VBE is relatively high (almost 1V), I'd rather take 470R base resistors and check the voltage across it when the Teensy output pin is driven high to make sure that it will not exceed 2.35V.
 
You better use a second (cheap, low current) transistor in a Darlington configuration. This way, you could set up a much lower current for Teensy output, even in microampere range.

There are Darlington transistors too, if space is a problem or if you don't have those BC337 yet.
 
Status
Not open for further replies.
Back
Top