Adjustable Regulators

The only difference between a fixed regulator and an adjustable regulator is that the fixed ones come with two adjustment resistors built inside, so you don't have to pick them and wire it up yourself. Fixed regulators are very convenient, and are cheaper for high-volume manufacurers because it saves two components. However, for the robot-enthusiast / hobbyist, getting to grips with adjustable regulators (e.g. the ubiquitous LM317T) may mean you never have to buy another type of regulator again.


 * Power supply input goes to the 'Vi'/'input' pin as per usual
 * The output voltage comes from the 'Vo'/'output' pin as per usual
 * A resistor is put between the 'adjust' pin and ground, the value of which controls the output voltage
 * A resistor is put between the 'adjust' pin and the 'Vo'/'output' pin, of a fixed value (check the datasheet!)
 * Capacitors are placed between 'Vi' and ground, and 'Vo' and ground, as per usual

The following circuit shows a general case for a LM317T regulator.



To calculate the output voltage of the LM317T, use the following equation. R1 should be 240 ohms, but a little less is ok (e.g. 220 ohms, a more common value).

Vo = 1.25(1 + R2/R1)

A more detailed explanation:
 * To regulate a variety of voltages, the LM317T simply produces 1.25V between the Vo pin and the adjust pin.
 * By putting a 240 ohm resistor across here, we can use Ohm's Law (V = IR) to find that the current through R1 is thus fixed at about 5mA (1.25V / R1).
 * This current then has to flow from the adjust pin to ground, via R2.
 * Using Ohm's Law again, we can find that the voltage across R2 then becomes (1.25 / R1 * R2)
 * To find the output voltage, we add the voltage across R2 and R1: Vo = (1.25 / R1 * R2) + 1.25
 * Which simplifies a little to the above equation, Vo = 1.25(1 + R2/R1)
 * The minimum voltage the regulator can provide is 1.25V (when R2 = 0, i.e. the adj pin is connected to ground)
 * The maximum voltage the regulator can provide is 37V, as specified in the datasheet.

Assuming you have a 220 ohm resistor for R1, the following voltages can be achieved with appropriate resistor combinations (you may prefer to use a trimpot; some of these are complicated to make with standard resistor values!):
 * 1.25V - 0 ohm (connect the 'adj' pin to ground)
 * 2.5V - 220 ohm (use a 500 ohm pot)
 * 3.3V - 360 ohm (use a 500 ohm pot)
 * 5V - 660 ohm (use a 1k pot)
 * 12V - 1900 ohm (use a 2k pot)
 * 24V - 2420 ohm (use a 5k pot)
 * 36V - 6120 ohm (use a 10k pot)