For a circuit like this:
VCC - R1 - LED - R2 - GND
Do I just calculate current as VCC/(R1+R2)?
Close. But your expression left out the drop across the diode.
Remember, the components in the circuit are all going to obey the laws that
govern their terminal voltages and branch currents.
The same current flows through R1, R2, and the LED (D1) (kirchoff's current law)
The sum of the voltage drops across R1, R2, and D1 are going to equal VCC (kirchoff's voltage law)
Let's call the current Id.
R1 and R2 are going to obey ohms law, so the sum of the voltages across them will
be Id * (R1 + R2)
The voltage across D1 is going to be Vd and it will satisfy an exponential curve:
Id = Is *(e
Vd / (n*Vt) - 1)
where Vt is kT/q -- a temperature dependent voltage that is about 26mV at room temperature.
But we don't know Is for most diodes.
So we resort to the graph of Id vs. Vd in the diode spec sheet.
OR-- if we don't have such a thing, we take a guess. Let's assume we want Id
to be 20mA. Let's assume that Vd is 2V. (This is a good guess for many LEDs,
a lousy guess for a silicon diode. For a normal silicon diode, we'd use 0.6 or 0.7V)
Then VCC = Id * (R1 + R2) + Vd = 0.02 * (R1 + R2) + 2
if VCC is 5V then the sum of R1+R2 needs to be
R1+R2 = (5 - 2) / 0.02 = 3 / 0.02 = 150 ohms.
That smells right. But let's see what happens if the diode voltage
at that current is only 1.0 V....
Then the current is going to be (5 - 1)/150 = 27mA -- a little high,
but not in the incendiary range.
What if the diode voltage is 3V..
Then the current is going to be (5 - 3) / 150 = 13mA -- high enough
to light the LED.
--------------------
Finally, if we DO have the curve family, then we can calculate R1+R2 by
doing the following.
Place a point on the diode's I vs. V curve that intersects a horizontal
line going through I = 20mA. Label that point "Q".
Place a point on the X (Vd) axis at VCC. Label that B.
Draw a straight line from B through point Q and extend it all the way to
the vertical axis. It will intercept this axis at Im.
(R1 + R2) = Vcc/Im
The line that you drew was the
load line. Each point (Vx, Ix) on that line corresponded
to the resulting voltage across the diode (Vx) , assuming that Ix was flowing through
the two resistors. If no current is flowing, then the entire voltage is across the diode.
If Im is flowing, then all the voltage is dropped across (R1+R2).
But, there's a diode in this circuit. For it to satisfy reality, the current through the
diode and the voltage across the diode must be somewhere on the diode curve.
Both Ohm's law and the diode curve must be satisfied. So, the only combination of
Vd and Id that satisfies both requirements is where the load line and the diode curve
intersect -- at point Q.
If you want to try this on a real datasheet, take a look at figure 1 here:
http://www.cree.com/~/media/Files/Cree/LED-Components-and-Modules/HB/Data-Sheets/C503B-RAS-RAN-AAS-AAN-RBS-RBN-ABS-ABN-RCS-RCN-ACS-ACN-1079.pdfNote that you'll have to extend the graph to the right a bit, as it's horizontal axis only goes to 2.8
and you'll want to extend it to Vcc to draw point B on your load line.
-------
This load line stuff is just one way of expressing circuit behavior as the resolution of
multiple constraints. But it is a meme that is underneath much, if not all, of circuit
design. In fact, there is a class of calculating engines -- analog computers -- that
are entirely based on this notion. With a fairly simple set of primitives, one can build
circuits that add, subtract, multiply, divide, take the log, take the exponential, Nth
root, sin, cos, and others.
And it all boils down to realizing that an expression like
Id = Is(e
Vd/(nVt) - 1)
is not a description of a black box that takes Vd as an input and produces Id as an output.
A device equation is a
relation that must be satisfied (subject to certain conditions) when
the element is in a circuit.
So we could just as easily write it as
Vd = nVt * ln(Id/Is + 1)
Because, no matter what, both expressions must be satisfied if this diode is in a circuit.
In fact, the latter expression is how widgets that produce ln(x) or log(x) work in analog
computers and other instruments. Drive a current corresponding to X through a diode
and measure the voltage drop.
Good question.