How to Make a Voltage Regulator: Fixed and Adjustable

A voltage regulator takes an unsteady or too-high voltage source and outputs a clean, stable voltage for your circuit. The simplest version you can build uses just three components: a regulator chip, an input capacitor, and an output capacitor. More advanced versions let you dial in a custom output voltage or handle higher currents. Here’s how to build each type, starting with the easiest.

Fixed 5V Regulator: The Simplest Build

The most common beginner project is a 5V regulated power supply using a 7805 regulator IC. This three-pin chip (input, ground, output) does all the voltage conversion internally. You just need two capacitors to keep it stable.

Here’s what you need:

  • 7805 voltage regulator IC (one unit)
  • 0.33 µF capacitor (ceramic, placed across the input)
  • 0.1 µF capacitor (ceramic, placed across the output)

The wiring is straightforward. Connect your power source (a 9V battery works well for testing) to Pin 1 (input). Connect Pin 2 (common/ground) to your circuit’s ground. Pin 3 (output) delivers a steady 5V. Solder the 0.33 µF capacitor between Pin 1 and ground, and the 0.1 µF capacitor between Pin 3 and ground. That’s it. You now have a working regulated 5V supply.

Place both capacitors as physically close to the regulator pins as possible. If they sit too far away on your board, stray inductance in the traces can cause the regulator to oscillate, producing a noisy or unstable output. Within a centimeter or two of the pins is ideal.

Choosing Your Input Voltage

A linear regulator like the 7805 needs the input voltage to be higher than the output, but not excessively so. The minimum input for a stable 5V output is around 7V. The maximum rated input for the 7805 series is 35V, but pushing anywhere near that limit creates a serious heat problem.

The reason: a linear regulator works by burning off the extra voltage as heat. The power it wastes is simple to calculate. Multiply the voltage difference (input minus output) by the current your circuit draws. If you feed in 12V and draw 500 mA at 5V out, the regulator dissipates (12 − 5) × 0.5 = 3.5 watts. That’s enough to get dangerously hot without a heatsink. At 9V input with the same load, it drops to 2 watts, which is much more manageable.

A useful rule of thumb from Texas Instruments: roughly 1 watt of dissipation spread over one square inch of board area raises the temperature by about 100°C. So if your regulator is dumping 2 or more watts, bolt on a small aluminum heatsink. They clip or screw directly onto the metal tab on the back of the 7805 package.

Building an Adjustable Voltage Regulator

If you need something other than 5V, an adjustable regulator like the LM317 lets you set any output voltage from about 1.25V up to 37V using two resistors. The chip has three pins: input, output, and an “adjust” pin that senses a voltage divider to determine what it outputs.

The formula for the output voltage is:

Vout = 1.25 × (1 + R2 / R1)

R1 connects between the output pin and the adjust pin. A standard value for R1 is 240 ohms. R2 connects between the adjust pin and ground. By changing R2, you change the output voltage. For example, with R1 at 240 ohms and R2 at 1,000 ohms, the output comes to about 6.46V. Want 9V? Use R2 of roughly 1,490 ohms.

You still need the same input and output capacitors as the fixed regulator (0.33 µF on the input, 0.1 µF on the output). If you want to make the output truly adjustable on the fly, replace R2 with a potentiometer. Turn the knob and the voltage changes in real time.

Discrete Regulator With a Zener Diode

Before regulator ICs existed, people built voltage regulators from individual components. You can still do this with a Zener diode and a transistor, and it’s a great way to understand what’s happening inside those IC packages.

The simplest version is a series regulator. A Zener diode is a special diode that maintains a fixed voltage across itself when current flows through it in reverse. Connect a resistor from your power source to the Zener, and the Zener holds a stable reference voltage. Feed that reference into the base of an NPN transistor (like the common 2N2222), and the transistor acts as a voltage follower: its output tracks the Zener voltage, minus about 0.6 to 0.7V lost across the transistor junction.

So if you use a 5.6V Zener diode, your output will be approximately 4.9 to 5.0V. The transistor does the heavy lifting of supplying current to your load, while the Zener just needs to provide a small base current. This lets the circuit handle much more current than a Zener alone, which is only good for a few tens of milliamps. For even higher current loads, you can swap in a Darlington transistor, which amplifies the base current more aggressively and prevents the Zener from falling out of its regulation range.

The sizing of the resistor that feeds the Zener matters. It needs to pass enough current to keep the Zener in its breakdown region (where it actually regulates) while also supplying sufficient base current to the transistor. Too little current, and the Zener drops out of regulation. Too much, and you waste power as heat in the resistor.

Adding Reverse Polarity Protection

One accidental wire swap or a battery inserted backwards can destroy a regulator instantly. A simple diode on the input prevents this. You have two options.

The first is a prevention circuit: place a diode in series with the input, so current can only flow in the correct direction. If someone connects the power backwards, the diode blocks it entirely. The tradeoff is that the diode drops about 0.7V from your input (or around 0.3V if you use a Schottky diode), which eats into your available voltage headroom. If you have margin between your input voltage and the regulator’s minimum dropout voltage, a standard rectifier diode works fine and costs very little.

The second option is a bypass circuit: place a diode between the output and input pins, oriented so that it normally does nothing. If the input voltage ever drops below the output (as can happen when you suddenly disconnect power while output capacitors are still charged), the diode routes that reverse current safely around the regulator instead of through it. This is especially useful in circuits with large output capacitors or inductive loads.

Why Linear Regulators Get Hot

Linear regulators are simple and produce very clean output with almost no electrical noise. But they pay for that simplicity with efficiency. In a test comparing linear and switching regulators both converting 24V down to 5V at 100 mA, the linear regulator ran at just 20% efficiency while the switching regulator hit 84.5%. In raw numbers, the linear regulator wasted 2.06 watts as heat, while the switching regulator wasted only 0.093 watts.

For small loads (under a few hundred milliamps) with a modest voltage drop, linear regulators are perfectly fine. They’re cheap, require almost no external components, and introduce no switching noise into your circuit. But if you’re converting a large voltage difference or supplying high current, a switching regulator (also called a buck converter) is worth the extra complexity. The heat savings alone can eliminate the need for bulky heatsinks and prevent thermal shutdowns.

Keeping Your Circuit Stable

The capacitors in a regulator circuit aren’t optional. Without them, many regulators will oscillate, producing a fluctuating output voltage that can damage sensitive components or cause erratic behavior. Ceramic capacitors are the best choice for the small values (0.1 µF and 0.33 µF) used directly at the regulator pins because they respond quickly to fast voltage changes.

If your circuit draws current in sudden bursts (like when a microcontroller wakes from sleep or a motor kicks on), add a larger electrolytic capacitor on the output, something in the 10 µF to 100 µF range. This acts as a local energy reservoir, smoothing out the momentary dips that the regulator can’t react to fast enough on its own.

On your circuit board, keep the ground connection of the input capacitor separated by 1 to 2 cm from the ground connection of the output capacitor. This sounds counterintuitive, but the small amount of resistance and inductance in that short trace acts as a natural filter, preventing high-frequency noise on the input side from passing through to the output. Both capacitors still connect to the same ground plane, just not at the exact same point.