I think the B configuration would be more stable in temperature variations, anyhow I would like to hear some good suggestions on which configuration should be used and what will be the benefits of using the one compare to the other.
-
2\$\begingroup\$ What do you want the two circuits to achieve? How much current are you expecting to flow through the LED - it will be quite different in both circuits you have shown. How much can the 5 volt rail move? What is your MCU IO voltage? What LED are you considering? \$\endgroup\$– Andy akaMay 3, 2017 at 9:41
-
\$\begingroup\$ I am not using this in my circuit. I came accross these two configuration and thought what will make difference if one is used intead of the other. \$\endgroup\$– Nouman TajikMay 3, 2017 at 10:13
-
\$\begingroup\$ Both circuits are equally good in their own ways and both paint their own scenario. There is no generic scenario; there are two scenarios - circuit 1 is one scenario and circuit 2 is another scenario therefore there can be no comparison without you stating what I asked. \$\endgroup\$– Andy akaMay 3, 2017 at 11:01
-
1\$\begingroup\$ Closing until the question is updated with the answers to Andy's questions in the first comment. \$\endgroup\$– Olin LathropMay 3, 2017 at 11:22
-
1\$\begingroup\$ Where are the PNP variants???? \$\endgroup\$– Trevor_GMay 3, 2017 at 13:34
4 Answers
Well, let's analyse the two circuits using the first green LED I can find data on - a Kingbright L-934GD. It has a typical forward voltage of 2.2V at 20mA and an absolute maximum forward current of 25mA. And let's assume a β of 110, the worst case figure, given for a BC547A at an Ic of 2mA.
Circuit A
Assuming the MCU puts out 5V, we get a base current of about (5-0.6)/10000=440uA, and maximum Ic of 110 times that, i.e. 48.4mA. But in practice, it will be limited by the resistor, the transistor will be saturated and we'll get around 300mV Vce and, looking at the LED graph of IF v VF, we would end up very close to the maximum 25mA going through the LED with a forward voltage of 2.25V. So this will light the LED to the fullest extent allowed.
In fact, to put 25mA through the LED, you would only need 0.6+(10000*0.025/110)=2.87V from the MCU. The biggest variable in this circuit is the β of Q1; if that were actually 500 the MCU would only need to put out 1.1V, although this is probably of no real consequence.
Circuit B
To get the same LED current of 25mA, we would need the same 2.25V across the LED, 2.5V across R1, allow for a Vbe of 0.6V and a base current of 25/110=227uA through R2 giving a voltage across it of 2.72V. Add all those up and your MCU will need to put out 8.07V to achieve the same brightness as Circuit A, which I'm guessing is unlikely.
If the MCU puts out just 5V, you'll end up with 12mA through the LED (2.1V across the LED, 0.012*100=1.2V across R1, 0.6Vbe and (0.012/110)*10000=1.091V across R2). So for the same MCU output and the same components, the LED will be half as bright. But if the β of Q1 increased to 500, the LED current would be 19mA instead.
So in summary, A would generally be considered a better design in this situation as it is not materially affected by the potentially large variations in device characteristics. If you wanted your LED to be half the brightness, you'd still be better off using A with a larger resistor. You say you think B would be more stable with respect to temperature, I'd love to know why you think that?
-
\$\begingroup\$ I think the resistance drop that you have in Circuit B across R2 should be 2.28V (when rounded up) not 2.72V ((25E-3A/110)*10000Ohms=2.28V). This would change the required output voltage from the MCU to 7.63V (still unlikely). Also in reference to Circuit B, why did you choose 2.25V across the LED when solving for the required micro-controller voltage but only 2.1V across the LED in the scenario where you assume the micro-controller output to be 5V? When trying to solve for the current through the LED I had two unknowns (Base current and zenar voltage) and only one equation. \$\endgroup\$ Dec 21, 2018 at 18:27
Perhaps you meant for circuit 2's Q1 to be PNP instead of NPN. Then it would behave much more similarly to circuit 1, with the exception being that the LED will light up when the GPIO goes low instead of high. Combining the two circuits together would make a system for driving a set of LEDs (or matrix) with a common cathode. Put the low side driver (circuit 1) on all the LED's the common cathodes and put the high side driver (circuit 2 with PNP) on each LED's separate anodes. Then the uProcessor can cycle through each LED quickly (e.g. >30 cycles per second) so your eyes don't see flickering.
A is typical, where the transistor acts like a switch -> minimum power dissipation.
B is less common. more power dissipation on the transistor, less voltage output on the led/resistor pair. but R2 can be omitted, and it is faster (on the rising edge).
for high/higher power applications, go with A. for fast light-based transmissions, or el cheapo design, go with B.
A is overall the best .A wastes valuable voltage .On a now very normal 3v3 micro you will not do a blue led on B .The collector volts on A can be higher than the micro making things more versatile .A gives more input /output isolation so it is more idiot proof.A is better when Q1 is a mosfet because gs voltages for reasonable conduction exceed VBE .A mosfet is used when speed is important.