# How to choose correct resistor values when designing a circuit?

I have designed this voltage divider circuit. The idea was to ensure the 5V LED (L1) and the 3.3V LED (L2) receive the correct amount of current so that they do not burn up.

So far I figure the divider should at least output 8.3V (5V + 3.3V) to the load (LEDs in parallel). I have also tried to workout the math for the resistors, considering R2, R3, R4 in parallel, creating the equivalent resistance for the divider, reaching the following result:

• R1: 330 Ohm
• R2: 330k Ohm
• R3: 330k Ohm
• R4: 22k Ohm

I tested everything on the breadboard and it worked, though I am not sure the resistors I have chosen are ideal: the calculation where more like "find the right value of resistance so the the equivalent one was close to 5k" (5k and 330 produce 8.4V output from the divider, with no load).

Hence my question: when a new circuit is designed, even the simplest, what is the thought process (methodically and mathematically) to choose the right resistors value to ensure the safety of the circuit itself?

Here is the circuit schematics:

• It worked on breadboard? With the LED's and those resistor values? Maybe L2 lights up a little but L1 with only a handfull of µA? Commented Jul 26 at 8:08
• @Unimportant Could you explain me a little bit better please? I know what's happening in the circuit (or at least I think so) but sometimes, since I have just started learning electronics, I get confused, thanks in advance. Commented Jul 26 at 8:56
• A "5 volt" LED will actually be a lower-voltage LED with a built-in current limiting circuit to allow it to operate from 5 volts. The highest-voltage plain LEDs are about 3 volts. Commented Jul 26 at 15:32
• please do not post a picture of the circuit ... edit your post ... click the circuit icon ... design the circuit ... click save and insert ... an editable circuit will be inserted in your post ... no grid lines Commented Jul 26 at 17:10
• @KmerPadreDiPdor measure the voltage across R2 ... is it what you expect? Commented Jul 26 at 17:13

## 4 Answers

With that voltage divider you reduce a bit the voltage (what is not necessary), and a small amount of current will go to ground through R2, without any reason. The voltage will be reduced anyway in R3 and R4.

If you want to experiment with voltage dividers you have to choose another circuit, because LED'a are driven by current, not by voltage.

So, you can remove R1 and R2 completely, they don't help.

Then, the values of R3 and R4 are too high. You should calculate them based in the current that you want. For example, if you want 4mA for L1 then:

R3 = V/I = (9V-5V)/4mA = 1KΩ

And

R4 = (9V-3.3V)/4mA = 1425Ω

Try 2.2KΩ or 4.7KΩ or 1KΩ... and check until you are happy with the brightness.

That's not even the simplest circuit and the voltage divider or the resistance values make no sense for a LED circuit.

There is also one incorrect assumption - for a 5V LED and 3.3V LED in parallel, you do not need 8.3V, as that would mean the LEDs would be in series. For a 3.3V LED you need more than 3.3V and for a 5V LED you need more than 5V. 9V is fine as it is without wasting battery power to drop the voltage with a resistor divider.

There is no need for the R1 R2 voltage divider. You can simply use one resistor per LED to 9V, i.e. connect R3 and R4 to 9V.

They will limit current to any value you want for the LEDs even if they have different forward voltages.

How to calculate the resistor values has been asked before from multiple different aspects, many articles on internet discusses it, and the method is even on Wikipedia page on LED circuits.

Just use Ohms's law for how much voltage the resistor must drop with the given current you want through the LED, with the given battery voltage and LED forward voltage.

• @KmerPadreDiPdor In that book voltage dividers and driving LEDs are handled as separate concepts. You do not need to mix these concepts together to make a circuit that is excessively complex to understand, with all the dependencies between them. You do not need a voltage divider in your circuit when driving LEDs so you can remove it and focus on driving LEDs if that is what you want to do. Or then at least explain why you put the voltage divider there so we can convince you that it is unnecessary in this circuit. Commented Jul 26 at 9:35
• @KmerPadreDiPdor Technically not incorrect and you can combine a voltage divider in the circuit. But you already have R3 and R4 for each LED. R3 and R4 are sort of voltage divders for the LEDs already, with basically just infinitely high resistance as the other divider resistance, so it does not exist. And the LEDs are loads for the R3 and R4. With R1 and R2, it does divide down voltage, but then you have loads connected to it which will bring down the divider output voltage. Keep it simple, there is no reason to use a voltage divider first as then the LED currents are harder to calculate. Commented Jul 26 at 11:02
• What you are missing is that a naive resistive voltage divider assumes that the input impedance of whatever the voltage output is connected to has 'high' input impedance in order for the approximation to work, otherwise you have to consider that impedance as part of the divider. And the impedance of your LEDs definable isn't. Commented Jul 26 at 11:05
• Additionally I suspect you are missing that the voltage across a led + resistor != voltage across the led, so if you are willing to accept the inefficiency of dissipating power in the resistor, you can make the resistor before an led arbitrarily large to handle arbitrarily large voltage. Try calculating how to use one led with one resistor with a 9v battery. Commented Jul 26 at 11:10
• @KmerPadreDiPdor Yes, that's incorrect. A voltage divider assumes nothing else is connected to the resistors, because it needs equal current through both resistors. (You get away with a voltmeter connected because it's got such a high resistance that you can disregard it.) As soon as anything else draws current, like a LED, it's no longer a "voltage divider". Instead it's a more complicated circuit with series and parallel elements, and a more complicated behaviour as a result. You can still do the calculations, but those are not "voltage divider" calculations. Commented Jul 27 at 0:01

# How do we drive loads?

The way we control electrical loads depends on their resistance: if they have low resistance, we control them by current; if they have high resistance, we control them by voltage. Otherwise conflicts occur and either an unacceptably high current flows or an unacceptably high voltage appears.

## Low-resistance loads

Conceptual circuit: Examples of such loads are a short circuit, ammeter, diode, Zener diode, LED, BJT base-emitter junction, voltage source, etc. We should control them by current, but we usually have voltage sources. So, we must convert the voltage into current. The simplest way to do this is by connecting a resistor in series acting as a voltage-to-current converter. Here are various low-resistance loads connected by resistors in parallel to a common voltage source.

simulate this circuit – Schematic created using CircuitLab

OP's circuits: So the two OP's LEDs should be supplied through individual resistors (it would be interesting to see what happens if you try to supply them by a common resistor, i.e. in parallel). They can be supplied through a common resistor if they are connected in series but then the total voltage drop across them increases.

simulate this circuit

## High-resistance loads

Examples of such loads are an open circuit, voltmeter, following voltage source, FET gate-source, etc. We should control them by voltage. For this purpose, we connect a voltage divider before the load acting as a voltage-to-voltage converter. Here are various high-resistance loads connected in parallel to a common voltage divider.

simulate this circuit

# How do we model LEDs?

To make electronic devices easier to understand, we replace them with simpler electrical devices.

## Constant voltage source

For the purposes of simplified calculation, we can represent an LED as an opposing voltage source with the same voltage. In the CircuitLab environment, we can do this by connecting the specific LED to the circuit and measuring the voltage drop across it. Then, we replace it with an equivalent voltage source.

simulate this circuit

## Dynamic resistor

But the idea above is far from the essence of the device because it is not a source of energy but a consumer such as a resistor. So, an LED is more of a resistor than a voltage source, but this resistor is nonlinear. Its behavior can be modeled with a variable (dynamic) resistor which resistance decreases when the current through it increases so the voltage across it stays constant.

Within CircuitLab, we can achieve this by measuring the voltage and current for several operating points and representing them through the corresponding resistance.

V1 = 5 V

simulate this circuit

V1 = 7 V

simulate this circuit

V1 = 10 V

simulate this circuit

• I agree with what you are trying to say; but I think calling a resistor a "voltage to current converter" is at best misleading and confusing to newcomers and at worst complete nonsense. It would be more correct to say that resistors convert an unlimited (or very high) current source to a limited one, suitable for driving low-impedance devices, by themselves having impedance and thus limiting the maximum current to a known (safer) amount depending on the voltage applied. Commented Jul 26 at 17:33
• I would add for the OP that all circuit paths must have impedance - or, to put it more simply, resistance. Some components, such as resistors, have significant resistance. Others (such as LEDs, transistors or plain diodes) have close to zero resistance, and therefore need a resistor in series to prevent them being destroyed by a huge excess of current. There is no such thing as a "5V LED" – only an LED with a suitable value of series resistor that will limit the current to a sensible value when 5V is supplied. Commented Jul 26 at 17:39
• Provided you add an appropriate amount of extra series resistance, you can power your LED with pretty much any voltage at all above 2.5V or so (a limitation of the LED technology itself). Commented Jul 26 at 17:43
• @Sod Almighty, It's been a while since I've had the pleasure of such a detailed response to my answer. The points you've raised are crucial and deserve in-depth discussions. Unfortunately, this kind of open dialogue isn't encouraged here. If you're willing to, you might find my Circuit Idea wikibook interesting, especially the part about my voltage-to-current converter story. I made it a long time ago as part of my circuit building course. Commented Jul 26 at 18:20

Here's the information you have provided, and some assumptions I have to make, in order to show you how to solve it (one way, at least), for which you should refer to my schematic underneath:

• Supply voltage $$\V_1\$$ is constant at 9V
• LED currents are $$\I_3=1mA\$$ and $$\I_4=2mA\$$
• LED forward voltages are $$\V_{D1}=5V\$$ and $$\V_{D2} = 3.3V\$$
• Potential at node A is $$\V_A=+8.3V\$$

Before I begin, I should point out that your reasoning for choosing $$\V_A=+8.3V\$$ is flawed. Since both LED+resistor pairs are in parallel, then $$\V_A\$$ should be greater than the largest LED voltage, which is 5V, not the sum of both LED voltages. If those LEDs were in series, then I would nearly agree with your reasoning; I would amend it to say that $$\V_A\$$ should be significantly greater than the sum of the individual LED voltages. Going forward, I'll stick with the constraint $$\V_A=+8.3V\$$, even though any value significantly greater than 5V, but less than V1 would be fine.

simulate this circuit – Schematic created using CircuitLab

The first thing I notice is that since the potential at A is known, and fixed, I can find R3 and R4 easily. I need to apply Kirchhoff's Voltage Law (KVL) to each path individually. First, the path via R3 and D1:

$$V_{D1} + V_{R3} = V_A$$

Ohm's law will reveal $$\V_{R3}\$$:

$$V_{R3} = I_3 R_3$$

Combine those, rearrange to make R3 the subject, and plug in known values:

\begin{aligned} V_{D1} + I_3R_3 &= V_A \\ \\ R_3 &= \frac{V_A - V_{D1}}{I_3} \\ \\ &= \frac{8.3V - 5V}{1mA} \\ \\ &= 3.3k\Omega \\ \\ \end{aligned}

Do the same for the path containing D2. I'll skip some algebra, since it's identical except for variable names:

\begin{aligned} R_4 &= \frac{V_A - V_{D2}}{I_4} \\ \\ &= \frac{8.3V - 3.3V}{2mA} \\ \\ &= 2.5k\Omega \\ \\ \end{aligned}

To find R1 and R2, I think that basic nodal analysis may be the simplest way, but don't overlook tools like Thevenin's theorem, which might simplify things.

I notice that currents in the two LED paths are well defined, $$\I_3=1mA\$$, $$\I_4=2mA\$$. This is convenient, because it permits me to easily calculate current $$\I_0\$$ emerging from the potential divider junction. Using Kirchhoff's Current Law (KCL):

\begin{aligned} I_0 &= I_3 + I_4 \\ \\ &= 1mA + 2mA \\ \\ &= 3mA \\ \\ \end{aligned}

Using KCL again, I can relate $$\I_1\$$ and $$\I_2\$$ to $$\I_0\$$:

\begin{aligned} I_1 &= I_2 + I_0 \\ \\ I_1 - I_2 &= I_0 \\ \\ &= 3mA \\ \\ \end{aligned}

It's trivial to calculate the voltages across R1 and R2, since we know $$\V_A\$$. This is really just KVL again:

\begin{aligned} V_{R1} &= V_1 - V_A \\ \\ &= 9V - 8.3V \\ \\ &= 0.7V \\ \\ V_{R2} &= V_A - 0V \\ \\ &= 8.3V - 0V \\ \\ &= 8.3V \\ \\ \end{aligned}

Ohm's law for R1 and R2:

\begin{aligned} I_1R_1 &= 0.7V \\ \\ I_2R_2 &= 8.3V \\ \\ \end{aligned}

Remember from before that $$\I_1 - I_2 = 3mA \$$. We actually have three equations which I will reiterate here:

\begin{aligned} I_1 - I_2 &= 3mA \\ \\ I_1R_1 &= 0.7V \\ \\ I_2R_2 &= 8.3V \\ \\ \end{aligned}

This is interesting, because we have three independent simultaneous equations, but four unknown quantities. This is math's way of telling us that there are an infinite number of solutions. We have to employ some reasoning to "guess" one of the values, to eliminate one of the unknown quantities. Then there will be a unique solution.

Experience tells me that R2 is redundant. Why would it be necessary to have any current at all through R2? I can plug in $$\I_2=0\$$ without breaking anything:

\begin{aligned} I_2R_2 &= 8.3V \\ \\ I_2 &= 0A \\ \\ 0A \times R_2 &= 8.3V \\ \\ R_2 &= \frac{8.3V}{0A} \\ \\ &= \infty\Omega \\ \\ \end{aligned}

We can remove R2 altogether, leaving only R1 to be calculated. The remaining equations are:

\begin{aligned} I_1 - I_2 &= 3mA \\ \\ I_1 - 0A &= 3mA \\ \\ I_1 &= 3mA \\ \\ I_1R_1 &= 0.7V \\ \\ R_1 &= \frac{0.7}{3mA} \\ \\ &= 233\Omega \\ \\ \end{aligned}

That's one solution. Let's see if it works:

simulate this circuit

If you insist on using all the resistors, including R2, then you'll have to decide on a non-zero value for $$\I_2\$$. It would be silly to make it much larger than LED current of 3mA, since that's just a waste of energy in R2, but just for laughs, let's make it silly. Lets set $$\I_2=100mA\$$, and see what resistor values come out of the equations:

\begin{aligned} I_2 &= 100mA \\ \\ I_1 - I_2 &= 3mA \\ \\ I_1 - 100mA &= 3mA \\ \\ I_1 &= 3mA + 100mA \\ \\ I_1 &= 103mA \\ \\ I_1R_1 &= 0.7V \\ \\ R_1 &= \frac{0.7}{103mA} \\ \\ &= 6.8\Omega \\ \\ R_2 &= \frac{8.3V}{100mA} \\ \\ &= 83\Omega \\ \\ \end{aligned}

simulate this circuit

This is a difficult question answer comprehensively, because the behaviour you expect from this circuit is not well defined. For example, the first question I aksed myself was "is the 9V source expected to change voltage ever?". Then I asked, if the supply voltage can change, is the goal to keep LED current constant?" If not, is there some relationship between supply voltage and LED current that you are trying to achieve?

If that 9V supply is never going to change, or is always close to 9V, give or take a bit, then nobody with any experience would use the design you have proposed, since those exact same conditions can be obtained with only two resistors:

simulate this circuit

With the goal being to choose resistances needed to obtain two known currents $$\I_1\$$ and $$\I_2\$$, the algebra for this scenario is way simpler than all that mess above, and no engineer would ever choose to do this the hard way.

If your goal is to obtain LED currents that remain constant, even as V1 changes, then you cannot use your design, or even the two-resistor solution, since such designs cannot achieve that behaviour. Then your question about finding R1, R2, R3 and R4 is moot, and you'll have to use a different approach.

If you expect V1 to change, but you require LED currents to change in some specific manner, in response to a changing V1, then the information you are missing is the exact algebraic relationships between $$\V_1\$$ and the two LED currents. Without having equations that describe those relationships, you can't incorporate them into the set of simultaneous KVL, KCL and Ohm's law equations, and you can't possibly derive a solution.

• Your logic is flawed, because the potential at A is not known. The voltage divider only works that way without any load. As soon as you connect the leds the voltage at A will drop significantly Commented Jul 26 at 16:44
• @Boldar that whole exercise was about building a divider that produced 8.3V under load. Yes $V_A$ drops, but it drops to exactly 8.3V. Commented Jul 26 at 18:35