It is very important that the correct resistor value is chosen for your LED. The correct value is dependent on four factors:

**Supply voltage****Current flowing through the LED****LED forward voltage (dependent on colour)**

To calculate resistance we use Ohm’s law. This states that **the current through a conductor is directly proportional to the voltage across the two points**. This proportional aspect is resistance.

As a formula we can express this as: **I = V / R**

We can rearrange this to find resistance: **R = V / I**

The voltage drop across an LED varies, so you should consult the datasheet for an exact value. A typical forward voltage for a red LED is 1.7V. To calculate what value resistor we would use, we need to know what the voltage across the resistor will be. If we are using the 5V from an Arduino then we can calculate the voltage by: **supply voltage – LED voltage drop**. Therefore, **5V – 1.7V = 3.2V**.

To complete the formula we also need to know the current that flows through the resistor. As with the forward voltage, you should consult the datasheet for the LED, as this varies. However, 10mA to 20mA are typical values. If you don’t know the values, picking a resistor value higher than a calculation based on typical values will be fine. For most applications the exact value of resistor is not critical, what is critical is that you don’t pick such a low value that you destroy the LED. An interesting property of LEDs is that they are not a linear device. The result of this is that a small change in voltage drop would not have a proportional effect on current flow! We know the current flowing through the LED but what would the current flowing through the resistor be? The answer is the same as that for the LED! The reason for this is due to **Kirchhoff’s current law**. This states that **for a parallel path, the total current entering a circuits junction is exactly equal to the total current leaving the same junction**. Let’s say that we have 20mA flowing through our LED. We need to convert 20mA into A, which is 20 / 1,000 = 0.02. A math tip for you is that if both values are the same equal prefix, then you do not need to perform any conversion. For example, if the voltage in mV and the current is in mA. Now we have everything that we need: 3.2 / 0.02 = 160. Even though we need a 160Ω resistor, this is not a standard value. As a precaution, round up. The next available value is 180Ω.

Thanks, helped me work out the values for the LED resistors that needed in my project.