Powering an LED (Light Emitting Diode) for your project could be a complicated thing, but powering a single LED for the sole purpose of being able to do so is a simple process, just a little more complex than powering a filament lamp.
Consider the circuit shown below for a switched 12 volt filament lamp.
The circuit shows a 12 volts DC supply powering a 12 volt DC rated lamp via a switch. When the switch is closed, the lamp lights and when the switch is opened, the lamp extinguishes. Since the lamp is a filament type, the polarity of the supply (which way round it is connected to the lamp) is not vitally important in this case. The filament in the lamp provides a resistance within the circuit. Lamps like these are typically rated in Watts (W), so we could find out the current draw of the lamp from it's watt rating and the supply voltage using the power equation : Current (amps) = Power (watts) / Volts. Lets say that the lamp above is a small 5 watt unit.
5 (watts)/12 (volts)
=0.416 amps
Lets look at a typical LED circuit.
The circuit shows a 12 volts DC supply powering an LED via a switch and a resistor. When the switch is closed, the LED lights and when the switch is opened, the LED extinguishes. Since the LED is a diode, the polarity of the supply (which way round it is connected to the LED) is important. Whilst 12 volt LEDs are available to buy, typically LEDs require less voltage than this. To prevent us from cooking a standard LED, we fit a resistor in-line with the LED to bring the voltage down to the correct level required.
So what should the resistor value be?
To find this out, we need to know three values: supply voltage, LED forward voltage, LED Current draw.
Calculations:
For the above circuit, the Supply voltage (Vsupply) is 12 volts, the LED is a RED 5mm unit, forward voltage (VForward) is 1.65 volts, max current draw (MaxCurrent) is 20 milliamps (0.020 amps).
(VSupply-VForward)/MaxCurrent
(12-1.63)/0.020
10.37/0.020
= 518.5 ohms
This is Ohms law : resistance = volts divided by amps
As you can see from my circuit above, I have fitted a 1kilohm resistor - so what would the current be for that value?
Using Ohms law : current = volts divided by resistance
with the values of (Vsupply-Vforward) 10.37 volts, resistance is 1 kilohm (1000 Ohms)
10.37/1000
=0.01037amps
=10.37 milliamps
So I have used a value which does not allow MaxCurrent (20 milliamps) to be reached or exceeded.
How do I find out the Forward Voltage of my LED?
The forward voltage of LEDs will vary by manufacturer and LED colour. I have tested several unbranded 5mm LEDs and found the Forward Voltage to be Between 1.5 volts and 3.8 volts typically. If you are buying branded items, get a specification sheet on the units you are buying. If you are using LEDs of an unknown origin, Use the LED circuit shown above and measure the voltage across the lit LED with your multimeter, this will be the LED's forward voltage.