We have seen quite many power supply and driver circuits in this blog using the IC LM338, that's because this particular device is so versatile with power regulation and control functions.
The same IC yet again takes the center stage in this application too. Here the IC LM338 has been configured in its standard mode and it perfectly executes the expected current as well as voltage regulations for driving a 3 watt or a 5 watt LED.
As shown in the circuit diagram below, in its standard mode the resistor 240 ohms is a regular placement, and the next resistor connected to it is the one which decides the voltage at the output of the IC. Here it has been calculated and set for producing around 3.3V at the output, which is the optimal voltage value for driving all types of white LEDs.
However the IC itself cannot control the current and normally would allow about 5 amp at the output.
We can see that the IC is associated with an additional active component which is the transistor connected to its ADJ pin.
The transistor here is employed solely for controlling the current at the output to the specified limits.
The resistor across ground and base decides how much current would be allowed to the output.
As indicated in the diagram, 0.6 ohms will pass about 1 amp maximum current which becomes suitable for driving a 3 watt led safely, and if a 5 watt LED needs to be driven safely, this resistor must be replaced with a 0.3 Ohms, which will allow a maximum of 2 amps of current.
The input to the IC can be derived from a standard transformer bridge capacitor power supply or from a suitably rated battery supply.
In fact, the transistor and the associated base/emitter resistors are absolutely not required, because once the voltage is set to precise 3.3V, the current would automatically get adjusted as per the LEDs specs.
So the correct circuit should be as given below: