Current doesn't equal what I expected

I'm making a simple LED circuit. I have a 6V power source, and a LED with 2 forward voltage and that requires 18mA. I calculated the resistance by dividing the voltage with the required amps (6-2 / 0.018). This gave me 222, which I rounded to 220 Ohms. Now I have a 220 Ohms resistor.

Now I have a 6 volt battery, 220 Ohms resistor, and a LED. Now I can calculate the current. So I divided the total volt (6v) with the total resistance (220 Ohms). But this gave me 6v / 220 Ohms = 27mA. 27mA does not equal 18mA, which the LED needs to work.

With my understanding, these two numbers should equal. What am I doing wrong?

-
You just missed the drop across diode in second case. – nidhin Jun 7 '14 at 14:11
How about some light thinking before asking such a question. – starblue Jun 7 '14 at 18:47
@starblue the question's text, and the subject of the question, while obvious to the rest of us, does not mean the OP has not thought about it. If it was that simple, OP would have thought it out instead of going through the pain of creating a EE.SE account and typing out a question along with the formulas they used to get their conclusions. Surprise, not everyone gets things immediately. Shit, just today, I completely missed the huge pile of baked goods I wanted in a case of baked goods, while having 20/15 vision. Shit happens, cut OP a break. – Passerby Jun 8 '14 at 7:45
@Passerby not showing sufficient research effort comes to mind here. OP doesn't know how to properly apply Kirchhoffs, which is the bare basic behind electricts & electronics. Not understanding how basic 2-terminal semiconductor (i.e. diode) works and not using e.g. circuit simulator to check the values is clearly another sign of negligence on OPs behalf. tl;dr OP should first a) read books, b) think about what he has read, c) verify it in practice; almost every book on electronics explains simple voltage-LED-resistor circuits explained in depth. – vaxquis Jun 8 '14 at 12:37
I feel a strange need of defending myself here. I should clarify, I am a "newbie" in regards to electronics. I am reading a bunch of free material online because I dont really have the money to buy books. And after I searched online a bunch, I still coulnd't find the answer I was looking for. So I am sorry vaxquis if the question was too stupid for you. But the answers sure helped me getting a broader understanding of the subject. But I have to admit, after realizing what I did wrong, I felt pretty stupid. But hey, you learn from your mistakes! – assasinDN Jun 8 '14 at 19:59

For low frequency operations, a practical diode can be modeled as an ideal diode in series with a voltage source and a resistance as shown below.

D1 is an ideal diode. Vd is the forward cut-in voltage and Rd is the dynamic resistance. But usually Rd is neglected in most of the cases as its value will be small (in $\Omega s$).

Since LED is a diode you can apply the same model. And Vd is 2V in your case. Hence when LED is on, your circuit has a 6V source, 220$\Omega$ resistance and a 2V voltage source (drop), in opposite polarity as 6V source as shown below.

$$\therefore I = \frac{6V-2V}{220\Omega} = 18.18mA$$

You missed the Vd in your calculations.

-
I gave you the accepted answer because I think you explained it the best. Though all the answers were awesome and I greatly appreciate them all, but I only have one button of approval to give. Thanks to you all! :) – assasinDN Jun 7 '14 at 15:47
@assasinDN that is fine. Some people tend to give the first answer acceptance, regardless of merit of the answer. StackExchange prefers that the most helpful answer, not technically right or first answer, be accepted. For the rest, that's what the upvote/downvote arrows are for. :D – Passerby Jun 8 '14 at 7:48
I wouldn't go as far as to say that Vd is a "voltage source"; that's quite risky, because, in any aplication Vd is actually Vd(I) - and, even in simplest cases, Vd is variable, e.g. when the Vsrc is < Vd (common case when working with battery-powered LEDs). I'd rather say that diode has variable (semiconductor, i.e. P-N junction) resistance creating the voltage drop and also stray capacitance (which, in fact, can be skipped); saying a diode is a 'voltage source' can be very misleading. – vaxquis Jun 8 '14 at 12:42
@vaxquis In the 1st figure, diode D1 ensures unidirectional flow of current (left to right in fig) and the polarity of Vd is such that it will oppose this current flow. So Vd acts as a voltage drop. It will not act as a voltage source as current won't flow from cathode to anode through a diode (right to left). The variation in drop with change in current is modeled with a series resistor, Rd. When Vsrc < Vd, the ideal diode D1 is reverse biased and hence it will act as an open-circuit. – nidhin Jun 8 '14 at 15:37
@NIDHIN you don't have to explain to me how diodes work; you're completely missing my point, mate. It's just that you rarely model a diode as voltage source + resistive load in small-signal modelling AFAIR. The voltage-source approach is usually used in large-signal modelling (again, AFAIR) - if you or anybody else can supply a book/datasheet reference of actual small-signal circuit modelling of a diode as V+R, I'll concur this is a good approach indeed. My memory isn't what it has used to be, so I *may be wrong on this one, hence my request for reference. – vaxquis Jun 8 '14 at 16:24

Now I have a 6 volt battery, 220 Ohms resistor, and a LED. Now I can calculate the current. So I divided the total volt (6v) with the total resistance (220 Ohms). But this gave me 6v / 220 Ohms = 27mA. 27mA does not equal 18mA, which the LED needs to work.

Your math is wrong. Mainly, the resistance of the led is negligible, so it can be ignored, but the voltage drop can not.

simulate this circuit – Schematic created using CircuitLab

The voltage across the resistor is what sets the current, not the total voltage. This can be tested with a multimeter.

-
Thanks! So I take it as diodes or components with a voltage drop should always be in the calculation when finding out the current. So if I have two diodes with a voltage drop of 2v each they together should be subtracted from the total voltage. So for example, to calculate the current, it should be 6v - 4v / 220 Ohms. – assasinDN Jun 7 '14 at 15:06
@assasinDN exactly. – Passerby Jun 7 '14 at 15:08

So I divided the total volt (6v) with the total resistance (220 Ohms).

To find the current through the resistor (and thus, the current through the diode), according to Ohm's Law

$$i_R = \frac{v_R}{R}$$

where $v_R$ is the voltage across the resistor.

But, by KVL, we have

$$v_R = 6V - v_D$$

thus,

$$i_R = \frac{6V - v_D}{220 \Omega} = i_D$$

Assuming $v_D = 2V$ then

$$i_D = \frac{6V - 2V}{220 \Omega} = 18.2mA$$

-

In your calculation for the LED ballast resistor value, you seemed to have included the fact that the LED has internal "resistance" because it consumes a certain amount of voltage for the given forward current, but then you ignore that fact later when trying to determine the full loop current.

The LED has a dynamic, and no-so-constant resistance of R = V/I during steady state, and you have said it drops 2V and supposedly at 18mA. It therefore has an R value of 111 Ohms.

6V / (111 + 222) Ohms = 0.01801 Amps.

Edit: Just so it's clear, LEDs and other diodes don't actually have a "resistance" value, and if you give them their forward voltage they will effectively short circuit and blow up so please don't assume an LED always has a resistance. They do not limit current at all.

-
I don't like the way you say the LED has a resistance of $111\Omega$. That is not really true. – Matt Young Jun 7 '14 at 14:13
It's not true, and i've covered myself buy saying it has a dynamic and non-static "resistance". By Ohms law, it MUST have that impedance/resistance under those conditions. – KyranF Jun 7 '14 at 14:14
Dynamic resistance has a specific technical meaning (slope of V/I curve) so it's bad to mix it up with these hand-waving explanations. And LEDs do actually have a resistive component to their voltage-current curve (and even if they didn't the ideal diode equation indicates that the current is limited for limited voltage). It just happens that the current is limited at a value that will quickly destroy the LED if the voltage is much more than about 2V in this case. – Spehro Pefhany Jun 7 '14 at 15:38
The problem with this answer, is that it takes a premise (2V drop across the led) and works backwards to justify it (said 2V drop at 18mA is like a 111Ω resistor). It's right, in an incorrect manner, like Aristotle was with Abiogenesis. – Passerby Jun 8 '14 at 7:52
Yes but it's a valid and sufficient explanation for somebody who obviousuly has not yet grasped even the fundamental laws of electricity, so chill out guys :D – KyranF Jun 9 '14 at 5:27

What you did wrong is basic arithmetic,

$$\frac{6-2}{.018} \approx 222$$

Thus, working backward to the .018 has to be:

$$.018 \approx \frac{6 - 2}{222}$$

and not:

$$.018 \neq \frac{6}{222}$$

You calculated (correctly) the resistor value for the desired current using a voltage drop of 4 for the resistor. So the same value must be used to work backward from the resistor to the current.

-

If you look at a plot of LED Vf VS If:

you'll see that a very small change in Vf will effect a very large change in If.

Then, When you look at an LED data sheet and you see the specifications for Vf and If, you may think that If is specified by putting Vf across the LED and measuring If.

That's not the case however, and Vf is derived by forcing If through the LED and then measuring the voltage it drops.

That way, with a given current forced through a large number of samples, a range of measured Vfs will emerge which will allow the current-limiting resistor to be easily calculated by subtracting the LED voltage (at the current specified) from the supply voltage and dividing by the specified If.

For example, let's say you have a 5 volt DC supply and a red LED with a typical Vf of 1.9V when there's 20mA If through it, and that you want to drive it at 20mA.

Then you could say:

          Vs - Vf     5V - 1.9V
Rs = --------- = ----------- = 155 ohms
If          20mA


155 ohms isn't a standard 5% value, but 160 is, and if you wanted to, you could figure out the drop in current for the higher value resistor by rearranging the formula and solving for If. Plus, there's a pretty wide latitude of Ifs allowable, from very dim with a small If to, generally, 30 mA for an LED spec'ed at 20mA nominal.

-