# How to calculate resistors for transistor driver circuit [duplicate]

This question already has an answer here:

This is related to https://arduino.stackexchange.com/a/36761/13642, I want to find the values for the two resistors so that the led will get 100mA. Vcc will be 5V and I have either 2N2222 or 2N3904 transistors. Let's say I use the 2N3904.

They mention the equation: hFE(VCC-VBE)/RB. (Is the full equation hFE(VCC-VBE)/RB = ICC?)

I tried to plug in the values: Vcc = 5, Hfe = 30 (from the sheet), VBE = 40*10^-3R since the arduino's pwm output is 40mA and from ohm's law, ICC = 100mA (the desired current for the led).

so we get: 30*(5-40*10^-3R)/R = 100*10^-3 => R = 3.3/(100*10^-3/30 + 80*10^-3) = 39.6.

This is not even close to 1000 like in the answer, so I'm doing something wrong here.

So how are you supposed to find the B line resistor value? Also, how do you find the C line resistor value?

This is the led I will use btw: https://www.vishay.com/docs/81009/tsal6100.pdf

"Arduino" is Arduino UNO for now (Wemos D1 mini later).

I don't think it's a duplicate since my circuit is a little different and what I ask for is different. I also have no idea what is that on their C line...

## marked as duplicate by brhans, Dave Tweed♦Oct 8 '17 at 3:36

• arduino's pwm maximum output is 40mA. Its actual output depends on R1 (and Vbe). Vbe is the voltage across the transistor's base-emitter - where did you get "VBE = 40*10^-3R"? – brhans Oct 3 '17 at 20:46
• From V=IR, I'm probably wrong, hence this question. Isn't Vbe without a resistor 5V? @brhans – shinzou Oct 3 '17 at 20:48