Author Options:

Resistor for NPN Transistor Base? Answered

Hey all, I need help identifying the value of the resistor I would need for the base of a 2n2222a transistor in this circuit. If you need any additional information, ask and ill try to answer asap. The resistance of the relay coil is 106 ohms and its rated for 6v but I operate it at 5v. The 3.3v is supplied by a step down circuit connected to the same power supply as the 5v used to operate the relay. If you can, please also list the steps you took to calculate the value of the resistor so that it can be useful for future use, I couldn't find a simple answer online. Ty,


Your circuit looks wrong to me. I should draw you a picture of what I expect a circuit like this should look like.

But before I draw that picture, I will attempt to answer your question about how to calculate the size of resistor needed for pushing some current through the base of an NPN transistor.

Actually there are two ways to do this.

One way is to just try a 1K or 10K resistor, and then measure the collector current, which is the same as the relay coil current, and check if that is giving you enough current, or voltage across the relay, to make the relay do what it is supposed to do. If the voltage across the relay coil is measured to be too small, try a smaller resistor, for to give more base current.

The other way is to do a bunch of math.

Regarding the math, the current path from base to emitter, looks like a forward biased diode. So the math needed to pick a resistor to attach to the transistor's base, this is essentially the same math needed to pick a current limiting resistor for an LED. The current through this resistor R is the voltage across it, divided by R. Assuming the transistor's emitter is connected to ground, the voltage across R will be (Vs-Vd), and the current through it will be I=(Vs-Vd)/R.

But how much base current is needed? I mean, what is the minimum base current neede to give you that much collector current.

To get an estimate for that, just take the desired collector current, and divide that by beta=100, or whatever your estimate for beta is. Recall beta is the current gain of the transistor beta = IC/IB

Anyway, you've got this relay coil, with resistance 106 ohms, and you want to drop about 5.0 volts across that. Thus IC = 5.0/106 = 0.047 = 47 mA

So what is that current divided by 100? 47/100 = 0.47 mA

Thus, only about half a milliampere of current is needed for IB.

What is the resistor that would limit current to I=0.47 mA, for a silicone diode with forward voltage Vd=0.6V and Vs=3.3V?

R = (Vs-Vd)/I = (3.3 -0.6)/(0.00047) = 5740 ohm

So that is the resistor that would give the minimum base current needed, for to give a collector current sufficient to energize the relay coil.

The next step is to realize you can safely give your transistor a lot more base current than the minimum required to give the calculated collector current. Doing so will merely push the transistor into the saturation region, and that is something you actually want for a task like switching on a relay. You want the transistor, when it is on, to be all the way on. (Conversely, when transistor is off, you want it all the way off.)

So I choose R to be 1K = 1000 ohms. That gives about 5 times the minimum base current needed, and 1K is nice round number, and I probably have that size in my parts box.

I said I would draw a picture, circuit diagram, of the way I am thinking this thing should be wired, and verily, here it is:


Thank you so much! You explained it really well and I understood what I was doing wrong. In the diagram you have connected the ground of both the power sources together, is that necessary? As the 3.3v does have the same ground as they are from the same 5v supply.

I was kind of guessing the 5 V supply and the 3.3 V supply share the same ground, and the way I have drawn it shows them connected.

Maybe you're asking if it was necessary to draw it that way?

I guess I could have just drawn the 3.3V supply as a node floating in space, the way you drew yours, but I thought it would be more clear to draw it the way I did.

By the way, if you have not already discovered the Wikipedia article for "Bipolar junction transistor", I was thinking I should link to that, here,


In my explanation of how to pick a resistor limit the base current, I was using some jargon like "beta = IC/IB", and "saturation", and I think the Wiki article for BJT does a reasonable job of explaining these concepts.

I mean, it would be kind of frustrating if, in your search for a "simple answer", I also gave you an answer too complicated to grok.