Hello!
I know that the base of a transistor must have a resistor connected to it. The problem is that I don't know what resistor to use! I've seen examples using 1k, 10k and 220 ohm resistors. How can I determine what resistor to use for the base?
Thanks!
It depends upon the transistor you are using and how much current it is expected to carry. Tell us more!
--
The Rugged Audio Shield: Line In, Mic In, Headphone Out, microSD socket, potentiometer, play/record WAV files
If the transistor is being used as a switch (in the common-emitter configuration) then you need to ensure the base gets enough current to saturate the transistor at the desired collector-current.
You also must ensure the output pin isn't providing more than about 25 or 30mA to protect it. Thus the minimum resistor value is 180 ohms.
If you want a collector current of 100mA, say, and your transistor has a (minimum) gain of 100, then it needs 1mA to conduct that current, but significantly more current to properly saturate, say 2 to 5mA. The base resistor will have about 5 - 0.7V = 4.3V across it, so 5mA means something like 820 ohms.
If the transistor isn't saturated its only "sort of" turned on and won't be a good switch.
Are you familiar with [u]Ohm's Law[/u]? With Ohm's Law, you can calculate the resistance, if you know the current & voltage.
Assuming you are connecting to the output of the Arduino, you've got 5V. The 5V output gets divided between the resistor and the transistor's base-emitter junction. But, with the transistor turned-on, you've got less than 1V across the transistor, so you can just approximate the voltage as 4 or 5V.
Now, you just need to calculate/estimate the required base-current. For that you need to know the output/load current. Then you can just divide by the transitor gain (hfe) to find the needed base-current. As Mark said, in a switching application you need to saturate* the transistor. So, with a typical gain of around 100, your base-current needs to be somewhere around 1/10th to 1/50th of the collector-emitter current, and your circuit should work!
The current through the resistor is the same current into the transistor base. Now that you know the voltage across the resistor and the current throught the resistor, you can use Ohm's Law to calculate the resistance.
- Here's an example of transistor-saturation: You've got an LED & resistor that take 20mA when connected directly to 12V. You connect it through a transistor with a gain of 100.
If you put 1mA into the transistor base with a gain of 100, you should be getting 100mA through the collector-emitter, (and through the LED & resistor). But with 12V, you can only get 20mA (Ohm's law)... The transistor is turned-on all-the-way... It's in saturation, and the current is limited by the other series devices.
I found a datasheet to my 2N3904 transistor: Intelligent Power and Sensing Technologies | onsemi. I know that is has a maximum collector current of 200mA. But the h_FE value is a very large range of values. :~ I am familiar with Ohm's law: V = I*R, I = V/R, R = V/I. There is always 0.6V between emitter and base when the transistor is turned on, so that leaves 4.4V across the E and C. So I should do some formula like this: r_B = 4.4V / (0.2A / h_FE). Example: 4.4V / (0.2A / 100) = 4.4V / 0.002A = 2200 ohms. _ = subscript. A found a formula for h_FE: h_FE = i_C / i_B. But that isn't helpful, because I don't know the i_B [i_C / h_FE]; I need to know the h_FE first! Is there a formula for calculating the h_FE given the i_C and V_EC. etc.? Or better: formula for base current required.
you have to pick the the from data sheet.
you have to pick the the from data sheet.
What?
Is there a way (formula, rule of thumb, etc.) to estimate the required base current, knowing the collector current?
For a normal bipolar transistor (not a darlington), Vce(sat) is typically quoted with Ib = 0.1 * Ic. Therefore, to achieve the value of Vce(sat) on the datasheet, you should plan the base current to be 1/10 of the collector current you want to switch. For example, if you are switching 60mA, design for a base current of 6mA. The base voltage will be around 0.7v and the voltage from the Arduino will be nearly 5V (assuming a 5V Arduino). Therefore a suitable base drive resistor would be around 4.3/0.006 = 717 ohms (nearest standard value 680 ohms).
If you are switching high currents, you should also bear in mind the 40mA current rating of the Arduino output pin. The highest current I switch with bipolar transistors is 500mA and I normally use a BC327 (PNP) or BC337 (NPN) transistor for switching currents up to this value. For these transistors, Vce(sat) is quoted at Ic=500mA, Ib=50mA. However, 50mA is too high for an Arduino pin. So I would design for Ib ~ 30mA and accept a slightly higher saturation voltage.
Above 500mA it is better to use a mosfet. Avoid using darlingtons, they have high saturation voltages so they get hot and need heatsinks.
Thanks for the advice! If I need to switch a 380mA motor, I can use a 500mA NPN transistor, such as MPSA06. I don't have it yet. 4.4V / (0.38A * 0.1) = ~116 ohms. Closest standard value: 100 ohms. Closest value I have: 330 ohms. I need more resistor values! To control 50mA IR LED: 4.4V / (0.05A * 0.1) = 880 ohms.
If you are doing much Arduino development, it's worth buying a resistor kit so that you always have the right resistor, except when you need a power resistor or an unusually high or low value. In the UK, this one http://www.rapidonline.com/Electronic-Components/MR25-Metal-film-resistor-kit-65199 is good value IMO.
I'm just having fun with Arduino. 100k, 1k, 1M, 10, 100, 4.7k, 47k, 470k ohms, what other resistors are commonly used?
"standard" values are:
10, 12, 15, 18, 20, 22, 27, 33, 47, 56, 68, 82, 91, 100
Multiply by 10, 100, and 1000
150, 180, 220, 270 for controlling LEDs.
I know that resistors are needed to limit the current for LEDs. A have an IR LED that uses 1.6V @ 50mA. I could use a 100 ohm resistor to a I/O pin, but I/O pins are limited to 40mA. Can I use Transistor 1.png? Isn't the 1k ohm resistor on the base supposed to limit the collector current to about 50mA? I will be using the 2N3904 from before.

In the US this is a great assortment: http://www.amazon.com/Joe-Knows-Electronics-Value-Resistor/dp/B003UC4FSS/ref=sr_1_1?ie=UTF8&qid=1337030229&sr=8-1&tag=68656c7064757-20
dkl65:
Closest standard value: 100 ohms. Closest value I have: 330 ohms. I need more resistor values!
3x 330 resistors in parallel is 110 ohms.
dkl65:
I know that resistors are needed to limit the current for LEDs. A have an IR LED that uses 1.6V @ 50mA. I could use a 100 ohm resistor to a I/O pin, but I/O pins are limited to 40mA. Can I use Transistor 1.png? Isn't the 1k ohm resistor on the base supposed to limit the collector current to about 50mA? I will be using the 2N3904 from before.
The 1K base resistor does indirectly limit the collector current, but to a rather unpredictable value, so it is not sufficient. You need a resistor in series with the LED. If you want to drive it at 50mA then the value should be (5 - 1.6 - 0.3)/0.05 = 62 ohms. The base resistor should be chosen to give about 5mA base current, so it needs to be around 820 ohms (1K is close enough).
Assortments of Resistor and Capacitors:
DISCLAIMER: Mentioning stuff from my own shop...!
My parts-junky habit made me do it: scour all over Shenzhen for good assortments already made up.
Resistors-Capacitors: http://goo.gl/hA1S2 See: (20 values 20 each = 400 resistors) (21 values 100 each = 2100 resistors) Low cost!
Popular IC's : http://goo.gl/19egs
I have some nice plastic boxes with 6 compartments that are good for a "decade" of resistors. Like:
100-130 150-200 220-300 330-430 470-620 680-910 and so on. So 10% and 5% values are in the same compartment, but that's no problem. So I have 6 of those boxes for the decades from 10 ohms to 10 meg. I've also seen a 3x5 inch card box with resistors in strips in between the index cards.
Still, for a large percentage of Arduino - Resistor situations, either 220 ohms or 10K ohms will do it ![]()
terryking228:
Still, for a large percentage of Arduino - Resistor situations, either 220 ohms or 10K ohms will do it
Thanks for that! Just what I was looking for. 220 is more for LED's and the 10K is for transistors or pull up/down. Makes perfect sense and confirms my thoughts.