# LED resistor from assumed forward drop and current supply = 5 V in 3..12 forward = 2 V "Assumed LED forward voltage" current = 20 mA in 5..40 resistor := (supply - forward) / current [ohm] resistorPower := (supply - forward) * current [W] check resistor minimum: resistor >= 100 ohm scenario higher supply: supply = 9 V