All LEDs can be modelled as zener diodes with a colour/substrate specific forward voltage Vf and a series resistive Rs, where they combine both to give the Vf at rated current.
Rs tends to be small so you can neglect it for approximations of adding current limiting series resistors. (see below)
Therefore the current is non-linear and proportional to the voltage difference between the supply and the Vf drop at desired current.
Batteries with low voltage variation are ideal such as Lithium primary cells. Most White flashlights using 3V per LED use these without series resistors as the Li cell is also 3V. However they may be specify a sorted bin of LED's to achieve this.
My Rule of Thumb is to string arrays of LED's such that the voltage difference is ~1V for the current limiting Resistor for a fixed regulator. If the supply range has a wide range, e.g. 10 ~15V then a constant current sink circuit is best.
Additional Info
For more accuracy over a wider range of currents, you can determine the Rs value from the specsheets for a given temperature. The Vf forward voltage also is a function of temperature which affects the results slightly. THe Rs of LED's is much lower than the dynamic Rs of Zeners using silicon junctions.
- 20mA HB devices are <20 ohms.
- 300mA HB devices are < 2 ohms.
- 1Amp power modules are ~ 0.3 ohm.
- Rs for LED arrays , add in series, and divide in parallel.
- Old technology LEDs were much higher Rs values.
- Rs will reduce as the current increases but you can approximate it at the 10% of rated current value and extrapolate if the device stays at constant temp.
- Because of the Shockley effect with voltage variationmyou can actually calculate the junction temperature from the voltage drop of a calibrated LED.
There is no limit on the voltage, per se, that you use to power the circuit that drives the diode. The diode only cares about what the diode can see, and it can't see the voltage drop across the current limiting resistor.
That said, at some point what you're going to care about is the power dissipated across the resistor, which is \$ I^2R \$. If you want to keep the current to be constant in the case of growing required voltage drop, then R will eventually get big, and it will dissipate too much power. The power that run of the mill axial lead resistors can dissipate is 1/4 watt. For a 20mA current, that means to limit power across the resistor to 1/4 watt, you can't exceed 625 ohm, which means you can maximally drop 12.5 volts across it, and you're ceilinged out at a power supply of about 14.5V for a red LED. It's worse for small package SMD resistors, which are often 1/8 Watt or less. If you need more of a voltage drop, you would have to change to a higher power rated resistor, which can get physically big, as well as more expensive.
As to why the actual voltage across the LED doesn't change too dramatically given proper choice of current limiting resistor, one convenient way to look at this is with the "load line" technique. From http://i.stack.imgur.com/1cUKU.png, (Public domain image from Wikimedia):
The negative sloped line represents the resistor. If \$ V_D = 0 \$ there would be \$V_{DD}/R \$ of current through the resistor, and if \$ V_D = V_{DD} \$, then there is no current through the resistor (as there's no voltage drop across the resistor). The circuit "lives" at the equilibrium point where the resistor line and the diode curve intersect, as you MUST have the same current through the diode and the resistor. Note that changing R and \$ V_{DD} \$ less than dramatically won't move this point as much as you think it might in terms of the final voltage drop across the diode, because of how steep the diode curve gets.
Best Answer
That would be correct if the current was 0.018A but it won't be.
LEDs (and diodes in general) are a little odd. For a start they don't follow Ohms law, that only applies to passive devices (Resistors and for AC signals capacitors and inductors).
As a first approximation a diode can be modeled as allowing no current to pass if the voltage is less that its on threshold voltage and allowing an unlimited current to pass once over that threshold. It's sort of the electronics equivalent of a dam, if the water level is below the top of the dam all the water is stopped. But any water that is over the top of the dam can flow as fast as it likes.
This isn't quite correct, in reality there is a small switch on region where the voltage / current relationship in the diode transitions from being zero current to almost unrestricted current, but this is close enough for most basic circuit analysis.
So in this case the circuit you end up with is:
+9V -- 500R -- LED -- 0V
If the current was 0.018A then there would be 9V over the resistor leaving 0V for the LED. The LED is not at its threshold voltage and so no current flows. But current can't just vanish, for a series circuit like this it must be the same at all points. Clearly the current in the resistor can't be 0.018A.
Similarly if the current in the resistor was 0 or close to it then the voltage on the resistor would be close to 0 and the voltage on the LED would be 9V. But anything over the threshold and the LED doesn't restrict current flow so we have unlimited current flowing. Again we have an inconsistency so this can't be correct.
As should hopefully be clear by this point the the only way we will get things to balance is if the voltage over the LED is exactly at the threshold voltage. That way the LED is allowing current to flow but we don't end up with an infinite current requirement. The LED is operating within that small switch on region, where exactly within the region doesn't matter for something like.
If the LED is at the threshold this means the LED voltage is 2V leaving 7V over the resistor. 7V and 500 ohms means a current of 0.014A.
The maximum current for an LED (and most diodes) is mainly for thermal reasons. The power used by the LED will be the voltage drop * the current. Only a tiny amount of that will be turned into light, the bulk of it will be converted into heat. Too much current and you get too much heat and things go bang.