Voltage regulator (LDO) calculator (LM317, LM1117 or AMS1117)

Voltage regulator circuit diagram

How to use the voltage regulator calculator

To use the calculator enter two values. The blank field will be automatically calculated. If you fill in all three fields, the last calculated value will be recalculated. You can modify the units using the selectors.

What is a voltage regulator (LDO)?

A linear regulator is a circuit (sometimes sold as a single component) that provides a fixed voltage at the output, regardless of the input voltage or the loading current. It is therefore very useful for generating voltage rails for a circuit. Linear regulators can supply much more current than operational amplifiers, but they are not very efficient. Keep this in mind if you are going to need a lot of current, as they will get quite hot and you may need a heatsink or fan. There are fixed output linear regulators such as 5[V], or 3.3[V]. There are also adjustable ones. The latter allow the output voltage to be adjusted by using a pair of resistors. Adjustable regulators have, in addition to an input and an output, a pin that is usually called 'ADJ', for adjustment or 'Vref' for reference voltage. The adjustment pin has high-precision voltage, which can be of any value, but is usually 1.25[V] with respect to GND, or below the output (depending on regulator model). This is the case for the LM317 or LM1117, which are widely used regulators. The adjustment resistors go between the output and the adjustment pin, and between the adjustment pin and ground. The equation to adjust the output voltage is:

$$V_{out} = V_{adj}\cdot\left(1+\dfrac{R_{bot}}{R_{top}}\right)+I_{adj}\cdot R_{bot} $$

Vadj is usually 1.25[V], but remember to confirm this on the datasheet. You should also know that, if you are not using the LM317 or LM1117, you may have to swap Rbot for Rtop and the other way around. This is due to how the internal construction of the regulator is. Iadj is usually an almost negligible value and, in most cases, can be approximated as 0 if your Rbot is low, in the range of hundreds of Ohms.

Example

Suppose you have a microcontroller that is powered at 3.3[V] that you plan to use in a wireless device. This equipment is powered by a battery. Batteries vary their voltage a bit depending on their charge, so you decide to use a regulator to keep the microcontroller's power supply constant. How do you do this?

  • To calculate the output voltage we use the previous equation. We know that we want 3.3[V] at the output. We can set Rbot and solve for Rtop. Here it is convenient to set a low value of Rbot. This allows us to keep the Iadj*Rbot term small and we can eliminate it without making a noticeable error. We set Rbot to 100 Ohm for example and solve for Rtop (remember that we eliminate the Iadj term): $$R_{top}= \frac{R_{bot}}{\left(\frac{V_{out}}{V_{adj}}\right)-1} =\frac{100}{\left(\frac{3.3}{1.25}\right)-1} = 60.9[Ω]$$

LM317 / LM1117 / AMS1117 Linear Regulator LTSpice Simulation

Download this ready-to-use LTSpice simulation to evaluate the transient response, output stability, load regulation, and line regulation of your adjustable linear regulator. This file is ideal for validating LM317, LM1117, and AMS1117 designs before building the circuit on hardware. You can visualize how the output voltage reacts to load changes, check startup behavior, and analyze compensation or capacitor choices to ensure a stable regulator.

LTSpice schematic showing LM317, LM1117, or AMS1117 adjustable voltage regulator with Rtop and Rbot LTSpice transient response plot of LM317/LM1117/AMS1117 showing output stability and load regulation

Frequently Asked Questions

  • Why is my measured output voltage different from the calculator result?
    Variations in resistor tolerance, Vadj, and the small Iadj term can cause slight deviations. For higher accuracy, use precision resistors like 1% or even 0.1% tolerance.
  • What value should I choose for Rbot?
    A low value (100 - 240 Ω) minimizes the Iadj·Rbot error and improves regulation. Higher values reduce current consumption through the adjust network but are less accurate.
  • Which capacitors do I need for stability?
    Place input and output capacitors close to the regulator pins. It is strongly recommended to have a tantalum capacitor at the output (ESR helps). Something close to 22uF should be fine for most applications; always follow the datasheet.
  • How much current can LM317/LM1117/AMS1117 supply?
    Actual limits depend on power dissipation, as it heats the component. It depends on current and difference between input and output voltage P = (Vin - Vout) x Iout. These regulators come in different packages and can sustain different dissipation levels. If you want a number to have in mind, something exceeding 0.5W will likely need a heatsink or air flow, although this is very dependent on PCB layout and if there are other hot components nearby.
  • What is dropout voltage and why does it matter?
    Dropout is the minimum Vin-Vout required for regulation. LM317 may need up to 2.5 V; LM1117/AMS1117 ~1.1-1.3 V. If Vin is too close to Vout, the regulator will not hold the set voltage. These values depend on load current and temperature; check the datasheet for details.
  • Why does my regulator get hot?
    Power dissipation equals (Vin - Vout) x Iout. High dissipation requires a heatsink or adequate cooling.

Comments

To comment you must be a registered user. Login / Register