# Determine the values and power rating of the resistors to bias the transistor

I'm in an assembly language programming course and our professor casually dropped a homework assignment in electrical engineering topics. (I'm a software engineering student, so I've not had any training on this.)

I'm given this problem:

Determine the values and power ratings of the resistors R_b and R_c to bias the transistor. The LED requires 100 mA of current and has a voltage drop of 0.7V. The 2N2222 transistor has a maximum current of 1 amp (I_CE less than or equal to 1 A), a Beta of 100, and can burn 1W of power. The output pin of the microcontroller provides 3.3V and up to 20 mA maximum. The power rating is the amount of power that the device needs to be able to dissipate.

I have the following schematic: I know I need to use Ohm's law and the equation for power, but I'm not sure how to go about solving the problem. How do I tackle this?

I think I can get as far as saying that the diode's 0.7 V in the transistor subtracts from the 3.3 V in the pin to give 2.6 V, and I think I could calculate the current in the wire connected to the pin as a result, but I'm not sure how to proceed.

• Google BJT switch/driver circuits and hopefully you'll find many great resources that teach you how to analyze such circuits. Nov 7, 2017 at 17:05
• I did, and found some decent ones, but I still feel stuck. I can get as far as saying that R_b = 2600 ohms, I think, but I don't know how to proceed. Nov 7, 2017 at 17:11
• Interesting about the professor. I also taught CS courses and I also definitely wished I could have force-fed them EE problems and the EE coursework of mathematics. My classes were about 75 in size, with about 5 or 6 of them from the EE department. The EE students never did anything but A work in my classes. The CS students had plenty of trouble, by comparison. Some of them only picked CS as an alternative for accounting because they thought CS would be low stress, high pay. hehe.
– jonk
Nov 7, 2017 at 17:26
• I mean, this course used to have a prerequisite course where this material would be covered, but sequencing issues this last year have changed things around so that is no longer the case. We're in an assembly course without any formal knowledge of CPU architecture. Go figure. Nov 7, 2017 at 21:45

You did catch a good segue to the problem, with the $3.3\:\textrm{V}-700\:\textrm{mV}=2.6\:\textrm{V}$. But to continue, you have to realize that this is the voltage siting across the resistor at the base. With $3.3\:\textrm{V}$ on the left side and $700\:\textrm{mV}$ on the right, it has to be that way. If you know Ohm's law, then you know that $I=\frac{V}{R}$ and from this you can compute the current that must be going into the transistor base (where else would the current go?) However, you are supposed to figure out that resistor value. So stop there for a moment. Time to look elsewhere and see if there is something useful to add.

You are told that the LED requires $100\:\textrm{mA}$ of current. That would seem to be another bit of data and probably an important one. This current must go through both $R_C$ and also the transistor collector. At this point it is a good idea to consider some reality checks.

Go take a look at this datasheet for the 2N2222A. (That is actually what they used to look like, by the way, with a small metal TO-18 can. I still have a bunch of them. But they are comparatively more expensive that the TO-92 packaged PN2222A and so are not used so much anymore.) You will indeed see that the total dissipation of the device is given as $1\:\textrm{W}$. However, that assumes that you can keep the case at room temperature. Good luck with that. It's better to look at the "Thermal Resistance, Junction to Ambient" and see that this is $325\:\frac{^\circ\textrm{C}}{\textrm{W}}$. This is what it would be without any extra heat sinks and assuming reasonable and open exposure to air that can move and circulate. Burning a full watt would suggest a rise in temperature of $325\:^\circ\textrm{C}$ and that probably isn't such a good thing. Note that they only rate it as $\frac{1}{2}\:\textrm{W}$ in this case, too. All this together says that the device can still work at about $175\:^\circ\textrm{C}$ at the junction. But that's also still not a good idea.

Back to the design issues. You have a $5\:\textrm{V}$ power source for the LED. (Luckily well under the "breakdown voltage" for it.) The transistor should be operated in "saturated" mode (which often just means "as a switch") Let's go to the following figure on that datasheet: Here, you can see a very conveniently placed curve described as $100\:\textrm{mA}$! You will want a very low $V_{CE_{SAT}}$ voltage (to avoid wasting power in the transistor and so as to provide as much remaining voltage for the LED and resistor.) However, you don't need to go crazy here. Just look for the knee in the curve and go a little bit beyond it. (These are "typical" curves so you can't be certain any particular part will follow that curve perfectly.) You can see it diving downward and then sloping lower. It looks very much like $10\:\textrm{mA}$ might be a good choice for the base current, yes? You could go more, of course. But this looks pretty good to me.

So, now you have $I_B=10\:\textrm{mA}$ for $I_C=100\:\textrm{mA}$ and you can work out the value for your base resistor, finally. From the above chart, you can see that you need to plan on (we need to keep in mind "typical" here) about $V_{CE_{SAT}}=200\:\textrm{mV}$. The only remaining thing is to work out your collector resistor by working out the voltage across it. Here, I think you have a problem. You write that the LED has a voltage drop of $700\:\textrm{mA}$ at $100\:\textrm{mA}$. But that isn't reasonable. I think you need to look up your problem again. Regardless, you can subtract your LED voltage from $5\:\textrm{V}$ and then subtract $V_{CE_{SAT}}$ from that and the remaining voltage will be the drop you need across your collector resistor. So you can then calculate that value, finally, as well.

That should help you see how to proceed, once you get a reasonable figure for your LED voltage. And once you've completed the design, it should be easy to work out the power required for your resistors (either $\frac{V_R^2}{R}$ or else $I_R^2 R$.)

• I do believe that I'm not supposed to use a datasheet for this exercise - he's more interested in the mathematical calculations I get the impression that this isn't so much a circuit design problem as it is a "do you understand the physics" problem. That said, is it correct to say that R_C = 5 V - 0.7 V [LED] - 3.3V [PIN] - 0.7 V [Transistor diode] = 0.3 V? Nov 9, 2017 at 17:26
• @Airhead Without a datasheet, you'd probably assume $\beta=10$ and $V_{BE}=700\:\textrm{mV}$ and $V_{CE_{SAT}}=200\:\textrm{mV}$ (as those figures are found throughout the literature for saturated small signal BJTs operating as switches for LEDs.) $V_{LED}=2\:\textrm{V}$ since that is found in the literature for red LEDs, though this might be $V_{LED}=2.5\:\textrm{V}$ for green ones. And still more for blue or white. So then $R_C=\frac{5\:\textrm{V}-V_{LED}-V_{CE_{SAT}}}{100\:\textrm{mA}}=28\:\Omega$ may be an answer.
– jonk
Nov 9, 2017 at 18:45
• @Airhead And then $I_B=\frac{I_C=100\:\textrm{mA}}{\beta=10}=10 \: \textrm{mA}$, followed by $R_B=\frac{3.3\:\textrm{V}-V_{BE}}{I_B}=260\:\Omega$ as the other part.
– jonk
Nov 9, 2017 at 18:50

A relevant graph from the 2N2222 data sheet involves the case where current flows through $R_c$ through the LED, through the transistor to ground. If you regard the transistor as a switch, it is "ON" and the LED is lit. This graph assumes a common design rule-of-thumb: base current is one tenth of collector current. Start by finding $R_c$. All three components must pass the same current: 100 mA. Kirchoff's voltage law states that the three voltages from +5V to ground must add up to 5:

• voltage drop across $R_c$
• voltage drop across $LED$
• voltage drop $V_{CE}$

You haven't specified the LED voltage properly when it is lit: it should be around 2 to 3.5 volts when 100 mA passes through. Now you can calculate voltage drop across $R_c$...use Ohm's law to find its resistance.

If $I_C$ is 100 mA, then design for $I_B$ about one-tenth of that: you seem to have that method correct. At 100 mA collector current, your guess that $V_{BE}$ of 0.7 V is close, but a bit on the low side. The difference isn't significant because the design rule of ${I_C/I_B}=10$ has much latitude - you simply want to ensure that this transistor operates as a saturated switch that conducts current very well when "ON", and conducts no current when "OFF".
You may have fallen into a trap, making the assumption that ${I_C/I_B} = data sheet current gain$...perhaps 100 for 2N2222. You want a well-saturated switch, not an amplifier. Setting this current ratio too high risks having $V_{CEsat}$ too large (you'd prefer it near zero)....your switch would not be well-saturated.

Another relevant graph from the data sheet shows the saturation region from another perspective: You could take the curve showing "Ic=150 mA" to approximate your case of Ic=100 mA. Base current $I_B$ below about 3 mA risks a poorly saturated switch. That the curve stops at $I_B = 15 mA$ suggests that your design needn't exceed this value.

• Just a note. Those look like OnSemi PN2222A charts (TO-92) and not OnSemi 2N2222 charts (TO-18.) Of course, I've no real idea what the OP actually has. (I have both kinds and they do behave a little differently.)
– jonk
Nov 7, 2017 at 19:18