You can use a potentiometer to make a simple dimmer for a 12-volt LED. Light intensity varies directly with the current supplied to the LED. To control the LED current and thus its brightness, place a potentiometer in series with the LED. Since a potentiometer's resistance ranges from zero to a specified maximum value, you will also need to place a current limiting resistor in series with the LED. This prevents the LED current from exceeding the forward current value at the low end of the potentiometer's range.
Find the operating, or forward, voltage and the normal operating current of the LED. You can get this information from the specification sheet for the LED you plan to use.
Calculate the resistance for the limiting resistor. To find the resistance value use the formula: R = (Vs - Vf) / I.
"R" is the resistance in ohms; "Vs" is the supply voltage; "Vf" is the operating current (12 volts); and "I" is the forward current in amps. For example, if the supply voltage is 18 volts and the LED forward current is 50 milliamps then the series limiting resistor value will be 120 ohms: (18 Volts - 12 Volts)/0.05 amps = 120 ohms.
Calculate the power dissipation for the limiting resistor. To find the resistor power dissipation use the formula: Pr = (Vs - Vf) * I.
"Pr" is the power in watts. For example, referring to Step 2: (18 volts - 12 volts) * 0.50 amps = 0.3 watts or 300 milliwatts.
Select a resistor with standard resistance and power dissipation values that are closest to the calculated values. For example, based on the values calculated in Step 2 and 3 you would select a 120-ohm, half-watt resistor. If the calculated value is between two standard values, both relatively close, choose the higher value.
Connect the positive terminal of the power supply to one of the outer terminals of the potentiometer.
Connect the centre terminal (the wiper) of the potentiometer to one of the leads or the limiting resistor.
Connect the other lead of the limiting resistor to the positive (longer) lead of the 12-volt LED.
Connect the negative lead of the LED to circuit ground.
Rotate the potentiometer shaft in one direction and then the other. Note that the LED varies in brightness as you rotate the shaft.