0
\$\begingroup\$

circuit diamgram

I've been continuing to play with small circuits and Im trying to sort out how to calculate the resistor for the base of this transistor. The transistor is a pn2222 (https://www.fairchildsemi.com/datasheets/PN/PN2222.pdf). Its my understanding that the resistor for the LED should be calculated much in the same way I would without the transistor. In this case, I know the LED drops 2.48 volts and draws 46mA. So my resistor for the LED is 54 ohms and I used a 47 ohm resistor.

I've tried many different formulas to try and figure out what the base resistor should be used and I can't seem to get it right. From my reading this is important because too much current could open the transistor too far and block the current coming from the collector through to the emitter.

I tried using this formula...

R = Voltage x hfe / LED current R = 4.3 x 35 / .05

That gave me 3010 and when I use a 3k resistor I only get about 30 milliamps of current to the LED. Shouldn't I get the full 46 as I see when the LED and resistor are plugged directly into the power source?

Also - in the above circuit I subtracted .7 volts from voltage since that just seems to be what everyone was doing. In reality, when I check the voltage drop from collector to emitter and base to emitter I see .8v and .6 v respectively. Shouldn't this be factored in? What about the voltage drop of the LED?

Im lost.

Update - Thanks for all the comments. Im really new to this space and still learning so it's been very helpful. I've moved the LED and it's series resistor to the collector leg of the transistor. The more I think about this, the more I see that Im dealing with two parallel circuits on the same power supply as I've drawn out.

circuit diamgram2

If this is the case, I can see how having the LED as part of circuit 2 would impact the power required to drive the transistor. Having it in it's own leg on the collector means that I can deal with it separately. I've also measured the voltage drop from base to emitter and verified that it's right around .7 volts which seems to match the value everyone else has been using for transistor voltage drop. At this point Im just trying to sort out the math for driving the transistor to saturation. What Im not confused about is which spec on the sheet I should be looking at in order to figure this out. For instance, the spec sheet lists saturation values for for collector-base as well as base-emitter. Im getting the feeling that Im getting too far ahead of myself here. Just by moving to this new configuration and having a 3k ohm resistor on the base it seems to work, Im just trying to prove out why that works now. Thanks!

\$\endgroup\$
  • 1
    \$\begingroup\$ Your LED and resistor are in the wrong leg, I think. You want them in the collector leg if you are going to use all these web site formulas. \$\endgroup\$ – jonk Jan 20 '17 at 22:53
  • \$\begingroup\$ Are you sure of the LED voltage and current? The forward voltage of a typical red LED is about 1.8 volts, and for common LEDs, the Absolute Maximum current is 25 - 30 mA. I generally aim for an LED current of 10 mA or so (and some are too bright even at that current). \$\endgroup\$ – Peter Bennett Jan 20 '17 at 22:58
  • 1
    \$\begingroup\$ See this, I think it will be helpful. You have the LED and resistor connected to the emitter when they should be between +5V and the collector. Your LED is also backwards. learn.sparkfun.com/tutorials/transistors/… \$\endgroup\$ – dgreenheck Jan 20 '17 at 23:10
  • 1
    \$\begingroup\$ What are you trying to accomplish by adding the series base resistor? It isn't needed - your 47 ohm resistor establishes LED current. So I propose that base resistor = 0....only for this emitter-follower circuit. \$\endgroup\$ – glen_geek Jan 21 '17 at 0:23
  • \$\begingroup\$ Then, after you remove the base resistor, remove the transistor as well and just connect the battery directly to the LED. And turn your LED around if you want it to produce light. \$\endgroup\$ – The Photon Jan 21 '17 at 13:20
1
\$\begingroup\$

Let's say the model for your LED is \$V_{fwd}=1.56\:\textrm{V}+20\:\Omega\cdot I\$ and the schematic is as follows:

schematic

simulate this circuit – Schematic created using CircuitLab

Then I compute:

$$I_B=\frac{5\:\textrm{V}-V_{LED}-V_{BE}}{R_2+\left(\beta+1\right)\cdot R_1}\approx 150\:\mu\textrm{A}$$

From that (and \$\beta\approx 200\$) I would get that \$V_B\approx 4.5\:\textrm{V}\$ and \$V_E\$ about \$800\:\textrm{mV}\$ less, or about \$V_E\approx 3.7\:\textrm{V}\$. The LED drop isn't yet certain but let's say it's another \$2.4\:\textrm{V}\$ for now. This means \$1.3\:\textrm{V}\$ across \$R_1=47\:\Omega\$. Or about \$28\:\textrm{mA}\$.

Which isn't far from what you got. Given that lower current and the assumed model I laid out at the top, I'd refine my estimate of \$V_{LED}\approx 2.1\:\textrm{V}\$. This would add another \$300\:\textrm{mV}\$ across \$R_1\$ and add another \$6\:\textrm{mA}\$ to make it \$34\:\textrm{mA}\$. Putting that back in, I'd then get \$V_{LED}=2.2\:\textrm{V}\$, losing \$100\:\textrm{mV}\$ across \$R_1\$, dropping the current to \$32\:\textrm{mA}\$ as a still further refinement. (I could do that several times more to nail it down.) But my model was just made up from your single set of values for it in your question and I've no idea if it is very accurate. The main point here is that you should NOT be surprised.

But the above circuit isn't the way most people try and do this. And it's not how you'll see web sites laying it out, either.

\$\endgroup\$
  • \$\begingroup\$ Am I laying the circuit out incorrectly? \$\endgroup\$ – jonlan Jan 20 '17 at 23:13
  • 1
    \$\begingroup\$ @jonlan Yeah. I think I said that much. You have the LED and resistor in the emitter leg. Most folks put it in the collector leg and tie the emitter to ground. (It's also not the only way to do things, of course. There are as many ways as you can imagine, I suppose.) \$\endgroup\$ – jonk Jan 20 '17 at 23:16
  • \$\begingroup\$ So is there a way to get full current to the LED? Im not clear on how moving the LED to the collector leg would help this but I'll try it out. \$\endgroup\$ – jonlan Jan 20 '17 at 23:18
  • \$\begingroup\$ @jonlan Do you plan on hooking up the base (through the resistor) to a microcontroller so that you can turn the LED on and off? \$\endgroup\$ – jonk Jan 20 '17 at 23:21
  • \$\begingroup\$ @jonlan Imagine if the LED is all the way on. That would mean that the top of D1 is close to 5V. That would mean the base is close to 5V. Since the base is driven by 5V, that would mean very little current through the base, contradicting our assumption that the LED was all the way on. The more you try to turn the LED on, the harder it is to get current to flow into the base. You don't have this problem if you tie the base to ground. The B-E circuit is then much simpler and it's easier to ensure sufficient base current -- especially if the base voltage might not be so close to 5V. \$\endgroup\$ – David Schwartz Jan 20 '17 at 23:56
0
\$\begingroup\$

you generally don't drive the load on the emitter (or source of a mosfet): the power dissipation on the bjt can be significant. typically the load is on the collector. But there are cases where switching on the emitter so is preferable.

the key here is to account for the led's forward voltage drop. if 5v is applied to the base, 4.3v shows up on the emitter. that means the voltage over the resistor is 4.3v - 2.5v = 1.8v.

to drop 46ma, the resistor should be 39ohm. lower if the input signal cannot swing to 5v fully, or the base resistor drops meaningful amount of voltage.

the base resistor isn't needed in those cases but I typically put one to protect the output pin from going over its max current spec.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.