# How to compute resistors values in bipolar transistor circuit?

In the attached image, I have this circuit and I need to make the D1 and D2 diodes to work complementary to D3 and D4 based on button status. The problem is that I don't know how to find the resistor values for R3 and R4. So far I have tried guessing some values for them but with no success. I don't really get how to use Kirchhoff law when bipolar transistors are in circuits ( just getting to learn how to analyze such circuits ). Any help will be much appreciated.

P.S. The VCC is 9V. • That design wont work . 1) not complementary LEDs 2) Rb must saturate Vce using 10% of hFE 3) R1 goes to Q1-C not Q1-E 4) R4 is too large and limits current too much. The Collector R determines the switched current. Nov 4, 2019 at 22:33
• What are the rules for the homework? Are you supposed to use two BJTs? Or are you free to use any approach at all with BJTs, generally?
– jonk
Nov 4, 2019 at 22:37
• @jonk The professor gave me this circuit and told me to find the R3 and R4 in such a way that D1 and D2 would be ON when D3 and D4 are OFF and vice-versa. That is all. Nov 4, 2019 at 22:41
• @VrabiiDaniel So the circuit is provided to you and you are not permitted to modify the connections or parts. Only the part values for $R_3$ and $R_4$ may be changed to achieve the desired outcomes? Those are the rules?
– jonk
Nov 4, 2019 at 22:48
• @jonk Yes. That is the task. Nov 4, 2019 at 22:49 Note new REFDES (..reference designators)

allowing for slight dimmer with low battery @ 8V and < =20mA max at 6.2V nominal for two Blue LEDs with some wider tolerance possible depending on parts and current.

Collector R's determine the current limit say at 20mA or maybe you prefer 10mA.

Let R4 = R2= (9-6.2V nom)/ 0.02A = 140 Ohms (assuming Vce=0)

The "Off LEDs" will still be dim from base current for the other Q.

So rather than let Ib=10% of Ic we can allow the Vce to rise from 0V to <= 0.5V (not fully saturated) when turned ON by requiring the current gain to be >10% of hFE or IC/Ib=10 to operate more in the linear range of Vce>>0 but not too high so it affects the current limit.

Let's choose Ic/Ib = 33

If Ib2 = 0.02A/33 = 606 uA find R1.
Q2-C when off to bias Q1 = Vbat-dim LEDs = 9V - (2.6V*2)=3.8V with Q1-Vbe=0.6V

R1 = 3.8V-0.6 / 606 uA = 5k3 Ohms

R3 = (9V-0.6V)/606 uA = 14k

These can be above or below the LEDs.

and R2=R4=140 ohms.

If you maintain all these R Ratios and increase all R's x10 to reduce LED current from ~ 20mA to ~ 2mA this will work.

A more clever design replaces R2 & R4 with a shared R from 9V. to both diode pairs since only one pair is on.

There are other ways too using CMOS inverters.

## Other info

For the student who asks the Prof (and you should) if you used 10k for each base resistor and the voltage is different how can you guarantee each LED string gets the same current when ON. (left Rb goes 0 to Vbat=9V, right Rb from Collector, which rises only to 3V due OFF LED leakage and voltage drop of 2.8V per Blue LED when very dim with base drive to next stage.). His answer ought to be. It works for very low currents and large collector R values. My answer technically is more accurate and equalizes the LED brightness and current (assuming identical LEDs).

The bottom line is you are allowed to interrupt the Prof and ask a good question with your assumptions stated. DONT BE AFRAID TO ASK AND LEARN. He will then clarify his answer and perhaps correct your assumptions or correct an oversight and error in his answer. ( I used to do this all the time with my 4th yr Semi. Prof) then he asked me to be his grad student, but I wanted to get out and design things, feed my wife and kid ...)

• After staring in confusion for a while, I learned something from this. The voltage drop across a blue LED is anywhere from 3 to 3.3 volts. I was under the impression LEDs had around a 0.7V drop across them. But i guess it actually depends on the wavelength of light they emit. Thanks for the unexpected knowledge! Nov 5, 2019 at 3:48
• Yes but there is a threshold voltage dependent on log(current/max) that is around 2.85V max for Blue&White +If*Rs for bulk series resistance which is the biggest tolerance item where Rs is inverse to power rating [1/W] due to chip size. So when "off" the Vf=2.6~2.8V and when "On" Vf=3.1Vtyp =2.85+If * Rs. for 5mm LEDs , Rs~ 15 ohms for Blue. Nov 5, 2019 at 5:09
• @TonyStewartSunnyskyguyEE75 thank you very much for help, but I am a little confused by your design. Why was R2 moved from emitor connection to the collector? In my design, the prof told me that it is in the collector with 10k Ohms as value. Nov 5, 2019 at 7:47
• emitter output is a base voltage follower with current gain, so no inverting which you wanted as a complementary LED driver or “inverter” which the collector does (invert) by drawing some of the current in the collector which now has voltage gain with respect to the emitter R( including internal rE) and feeds the next stage base with another inverter switch to collector. Nov 5, 2019 at 13:55

As I can see when the button is closed the base of Q3 will be at ground so Q3 is switched off and no current flows. D3 and D4 are off and the emitter of Q3 is also at ground. Consequently the base of Q1 will also be at ground (via R1) and it will also be switches off as will D1 and D2. So all 4 diosed will be off. When the button is open Q1 is turned on via R3, current flows through D3 and D4 and is limited by the emitter resistor R2. Assuming each diode drops about 2.5V the emitter of Q3 will be at about 4V which will turn on Q1 via R1. So D1 and D2 will be turned on and their current is limited by R4. Hence it appears the all 4 diodes are either on or off at the same time. Not what I understand you to want to achieve.

This is evidently a non-starter of a question seeing as the schematic requires more work than swapping out some resistor values in order to work as desired. But i feel there's a teachable moment here about LED's and so i might as well post something.

A good way to start figuring out what values of resistors to use is to get an idea of what the requirements of the circuit will demand. In your case, you want the LED's D1 and D2 to be on when D3 and D4 are off, and vise-versa. There's a couple things we know that will give us limitations on the resistors we can use for this scenario.

First off you will need to keep in mind that in order for an LED to be bright enough to be considered 'on' you will need to be able to pass a certain amount of current through it. It really doesn't take much current, but if you use a 6k ohm resistor the current running through those led's has an upper limit of:

Which could be so little current that the LED doesn't emit appreciable light, depending on the LED of course.

A safe setup for a nice bright LED is usually around 10mA, so let's use that as our target and see what the maximum resistor value is. Starting with that ballpark value of 900 Ohms in mind you could play around with some values and see what kind of results you would get.

Now, unfortunately, the schematic you supplied doesn't have the transistors configured in order to behave in a complementary fashion. So perhaps this is a trick question or your professor goofed. In addition to that problem, the current path through D3 and D4 share a 10k resistor, meaning the maximum current you're going to get through those LED's is less than a milliamp. Which is likely to be too little an amount of light to fulfill any real world requirement.

P.S. here's a schematic of something close to what you're supposed to be able to create here. I'm not a pro at transistor circuits either so forgive my crappy schematic. Perhaps it would be interesting to dissect the circuit a bit, to see why it can't work (especially the right side) as well as a little analysis of how/why it does work as (for example) Tony Stewart has drawn it.

So let's start by looking only at the left side: simulate this circuit – Schematic created using CircuitLab

Given an appropriate value of R1, this much can work. Current flows through R1 to the base of Q3, turning it on and allowing current to flow through the LED to ground, so the LED lights up.

When the switch closes, the current flowing through R1 is now conducted directly to ground, so no current flows into the base of Q1. Q1 turns off, no current flows through the LED. So far so good.

The right half of your circuit has a much bigger problem though. R2 is drawn as a 0K resistor, so the right half of your circuit really looks like this: simulate this circuit

Regardless of what happens on the left side, the base of Q1 is tied to ground. No current flows in, and it never turns on. Regardless of the switch on the left, no current flows into the base of Q1, and the LED never turns on.

With the circuit as Tony Stewart re-drew it, the situation changes completely. In this case, when the switch is closed, Q3 is turned off, so there's a high voltage at the collector. Current can flow through the LED, through R1, and into the base of Q1. So, when Q3 is turned off, Q1 turns on. R1 has to be selected to be small enough that Q1 turns on, but large enough that we're not drawing enough current for the LEDs on the left to light up (at least enough to notice). Since Q1 (presumably) has a fair amount of gain, that's usually going to be a pretty broad range though (you don't need much current flowing into the base to allow a fair amount of current to flow between the emitter and collector).

If we open the switch, Q3 turns on, so the left side of R1 is pulled to ground. Current stops flowing into the base of Q1, so the LEDs on the right turn off.

• i think R2 is actually a 10k with the '1' occluded by some sort of cursor. Nov 5, 2019 at 2:38
• I s'pose it could be...I can only go by what's shown... Nov 5, 2019 at 3:21
• @JerryCoffin R2 is indeed 10k, sorry for that misunderstanding. Nov 5, 2019 at 7:34