To power supply a LED is necessary to limit the supply current,
worth the immediate destruction of the LED junction itself.
The simply way to limit the current is a resistor, adopted solution for every LED used as a warning light.
With the Ohm's law, the calculation of the resistance is simple but it is necessary know the characteristics of the LED which we are supplying.
Supply voltage .. VIN
Kind of LED to supply
Threshold voltage .. VF
Current .. IF
Dropping resistance value .. R
Power dissipated by the resistor .. WR
Measure the threshold voltage of the LED
The threshold voltage can be measured, before you must to calculate resistance with:
Threshold voltage . . . VF = 1 V
Working current . . . . . IF = 10 mA
Then supply the LED and measure with a multimeter the voltage on its terminals, the value read on the multimeter must be inserted in the calculation for the final result.
Detect the maximum working current of a LED.
The detection of the working current is possible but is harder and it is necessary to destroy one for the measure.
It consists in supply an increasing current detecting the light emission and the current absorbed until the destruction of the junction.
All data reported on a chart will highlight the point in which the increase of the current does not correspond to an increasing of the light emission. The optimal current is before that point.
For every LED used as warning light is not necessary do that operation, 15 max 20 mA are more than sufficient for the purpose.
More powerful LED
For what concern power LED for lighting is not correct to supply them with a dropping resistor, the global efficiency will be heavily penalized.
For that kind of LED is necessary adopt specific power supplier, normally switching with a constant current output.