Electronic – Calculating base resistor value

led stripresistorstransistorsvoltage

I've looked around on the internet, but there's so much conflicting advice on how to find the value for the necessary resistor between the base of the transistor and the microcontroller. I'm completely at a loss at this point.

The microcontroller I'm using is a the huzzah ESP8266 breakout board from adafruit, and the transistors are TIP41C's.

Here's a schematic:

enter image description here

Best Answer

First you have to determine what the maximum collector current is that the transistor needs to support when on.

Divide this collector current by the gain of the transistor to get the minimum required base current. The gain of a BJT varies with operating point, so you have to look at the datasheet carefully to see what gain value you can assume at your maximum collector current.

Once you know the minimum required base current, it's just a matter of Ohm's law to find the base resistance. The B-E junction of the transistor looks like a diode to the driving circuit. Figure it will drop around 700 mV when the base current is flowing. Subtract that from the logic high level to find the voltage across the base resistor. By Ohm's law, the resistance is the voltage divided by the current.

Remember that this calculation was based on the minimum required base current. That means the result is the maximum allowed base resistance. It's usually good to round down the resistance one or two standard values to leave some margin.

Now that you've picked a base resistance, work backwards to find the actual base current, and check to make sure the digital output can deliver that. If not, that transistor in that circuit won't work.

That all said, why not use a FET? It seems you only need to switch 12 V. It looks like the IRLML2502, for example, would work nicely here. Then you don't need a base resistor at all. The on-state voltage drop will also be lower.