An LED (Light Emitting Diode) is a semiconductor that emits light energy when a current flows through it. Current will only flow one direction, just like a regular diode. There are a few things you need to know about an LED before you use one. First, and most importantly, is that an LED has very low internal resistance. This means that left to itself, an LED will pass so much current that it will burn up. They require an external resistor to limit the current.
Most LED's have a current rating, which determines the size of the resistor you will need. The current rating tells you what the maximum allowable current for the part is. In general, the higher the current, the brighter the LED.Most LED's seem to handle at least 15mA. If you are using a 5 volt circuit, then Ohms law tells you what resistor value to use. R = V / I, so R = 5v / .015A = 333 ohms.