<!--order=15-->


<h1>Voltage Regulators</h1>
<p>A voltage regulator maintains a constant output voltage regardless of changes in input voltage or load current. Almost every circuit needs one — from the tiny LDO on a coin battery Bluetooth module to the synchronous buck converters that power modern CPUs. Choosing between linear and switching comes down to efficiency, noise floor, required headroom, and how much heat you're willing to manage.</p>

<h2>Linear vs. Switching Comparison</h2>

<table>
  <thead><tr><th>Property</th><th>Linear</th><th>Switching</th></tr></thead>
  <tbody>
    <tr><td>How it works</td><td>Acts as variable series resistor, burns excess as heat</td><td>Switches inductor at high frequency, stores/releases energy efficiently</td></tr>
    <tr><td>Efficiency</td><td>V_out/V_in × 100% (worsens with larger drop)</td><td>75–95% regardless of voltage difference</td></tr>
    <tr><td>Output noise</td><td>Very low (µV range with good PSRR)</td><td>mV-range switching ripple + EMI</td></tr>
    <tr><td>Minimum dropout</td><td>Standard: ~2V; LDO: 0.1–0.5V</td><td>Can step up as well as down</td></tr>
    <tr><td>Complexity</td><td>Three pins, two caps minimum</td><td>Controller, inductor, diode, input/output caps, feedback</td></tr>
    <tr><td>Size</td><td>Regulator + caps (small); heatsink may be needed</td><td>Inductor dominates size; overall smaller for high current</td></tr>
    <tr><td>Speed</td><td>Fast transient response (µs)</td><td>Slower loop bandwidth (ms range)</td></tr>
  </tbody>
</table>

<h2>Linear Regulators</h2>
<p>The regulator is a transistor in series with the load, controlled by an error amplifier that compares the output to a reference voltage and adjusts the transistor to compensate:</p>
<pre>
P_heat = (V_in − V_out) × I_load

Example: 9V in, 5V out, 500mA load
P = (9 − 5) × 0.5 = 2W → needs heatsink
Efficiency = 5/9 = 55.6%

At 12V in, 5V out, 1A load:
P = 7W → requires large heatsink
Efficiency = 5/12 = 41.7%
</pre>

<h3>78xx / 79xx Fixed Output</h3>

<table>
  <thead><tr><th>Part</th><th>Vout</th><th>Polarity</th><th>Min Vin</th><th>Max Vin</th><th>Iout max</th></tr></thead>
  <tbody>
    <tr><td>7805</td><td>5V</td><td>Positive</td><td>7V</td><td>35V</td><td>1A (TO-220), 100mA (TO-92)</td></tr>
    <tr><td>7809</td><td>9V</td><td>Positive</td><td>11V</td><td>35V</td><td>1A</td></tr>
    <tr><td>7812</td><td>12V</td><td>Positive</td><td>14V</td><td>35V</td><td>1A</td></tr>
    <tr><td>7815</td><td>15V</td><td>Positive</td><td>17V</td><td>35V</td><td>1A</td></tr>
    <tr><td>7905</td><td>−5V</td><td>Negative</td><td>−7V</td><td>−35V</td><td>1A</td></tr>
    <tr><td>7912</td><td>−12V</td><td>Negative</td><td>−14V</td><td>−35V</td><td>1A</td></tr>
  </tbody>
</table>

<pre>
Minimum circuit (7805):
           IN    OUT
V_in+ ─── 7805 ──── 5V out
       100nF│    │100nF
           GND GND

• 100nF ceramics on both pins — required for stability
• Add 10µF electrolytic on output for better transient response
• Heatsink above ~700mW dissipation
</pre>

<h3>LM317 — Adjustable 1.25V to 37V</h3>
<pre>
V_out = 1.25 × (1 + R2/R1)

Standard practice: R1 = 240Ω (or 220Ω)

           OUT   ADJ
V_in ─── LM317 ──┬── V_out
       240Ω │   │
             GND [R2] ← adjust for target voltage
                 │
                GND

Target voltages for common R2 values (R1=240Ω):
  V_out=3.3V:  R2 = 240 × (3.3/1.25 - 1) = 394Ω → 390Ω
  V_out=5V:    R2 = 240 × (5/1.25 - 1) = 720Ω → 680Ω + trim
  V_out=9V:    R2 = 240 × (9/1.25 - 1) = 1,488Ω → 1.5kΩ
  V_out=12V:   R2 = 240 × (12/1.25 - 1) = 2,064Ω → 2.2kΩ
</pre>

<h3>LDO — Low-Dropout Regulators</h3>
<p>Classic 78xx devices need ~2V of headroom. LDOs work with much less — critical for battery-powered devices where the battery voltage drops as it discharges:</p>

<table>
  <thead><tr><th>Part</th><th>Vout</th><th>Dropout</th><th>Iq (quiescent)</th><th>Notes</th></tr></thead>
  <tbody>
    <tr><td>AMS1117-3.3</td><td>3.3V</td><td>1.1V</td><td>5 mA</td><td>Cheap, common on dev boards. High Iq — bad for battery.</td></tr>
    <tr><td>LP2950-5</td><td>5V</td><td>40 mV</td><td>75 µA</td><td>Low noise, good for audio and RF reference</td></tr>
    <tr><td>MCP1700-3302</td><td>3.3V</td><td>178 mV</td><td>1.6 µA</td><td>Ultra-low quiescent — ideal for battery/sleep devices</td></tr>
    <tr><td>TLV1117-33</td><td>3.3V</td><td>1.1V</td><td>5 mA</td><td>TI version of AMS1117, interchangeable</td></tr>
    <tr><td>XC6206P332</td><td>3.3V</td><td>200 mV @ 100mA</td><td>1 µA</td><td>SOT-23, tiny, very low Iq. Common in portable electronics.</td></tr>
  </tbody>
</table>

<p>LDO gotcha: some are unstable with low-ESR ceramics at the output. Check the datasheet for required output capacitor ESR range — older LDOs (LP2950 family) want 1–10Ω ESR, which means electrolytic or a series resistor with the ceramic.</p>

<h2>Switching Regulators — Key ICs</h2>

<table>
  <thead><tr><th>Part</th><th>Type</th><th>Vin</th><th>Vout</th><th>Iout</th><th>Notes</th></tr></thead>
  <tbody>
    <tr><td>LM2596</td><td>Buck</td><td>4–40V</td><td>1.2–37V adj.</td><td>3A</td><td>Simple, slow (150kHz). Large inductor needed. Good beginner switcher.</td></tr>
    <tr><td>MP1584</td><td>Buck</td><td>4.5–28V</td><td>0.8–25V adj.</td><td>3A</td><td>Small, 1.5MHz. Popular in DFRobot/generic modules.</td></tr>
    <tr><td>LM2576</td><td>Buck</td><td>7–40V</td><td>3.3/5/12/15/adj</td><td>3A</td><td>Fixed voltage versions available. 52kHz.</td></tr>
    <tr><td>MT3608</td><td>Boost</td><td>2–24V</td><td>5–28V adj.</td><td>2A</td><td>Common hobby boost module. 1.2MHz, compact.</td></tr>
    <tr><td>XL6009</td><td>Boost</td><td>3–32V</td><td>5–35V adj.</td><td>4A</td><td>Higher current boost, replaces MT3608 for heavier loads</td></tr>
    <tr><td>TPS63020</td><td>Buck-boost</td><td>1.8–5.5V</td><td>1.2–5V adj.</td><td>2A</td><td>Texas Instruments, excellent for Li-ion battery applications</td></tr>
  </tbody>
</table>

<h2>Heat and Heatsinking</h2>
<pre>
Thermal resistance of TO-220 package (junction to case): θjc ≈ 5°C/W
Thermal resistance to ambient without heatsink: θja ≈ 50°C/W

Max junction temperature for 78xx: 125°C
Ambient: 25°C → max power dissipation without heatsink:
  P_max = (125 − 25) / 50 = 2W

With heatsink (θja = 10°C/W):
  P_max = 100 / 10 = 10W

Always check: T_junction = T_ambient + P × θja  <  T_max
</pre>

<h2>Choosing the Right Regulator</h2>

<table>
  <thead><tr><th>Situation</th><th>Best choice</th><th>Why</th></tr></thead>
  <tbody>
    <tr><td>5V from 9V wall adapter, 200mA</td><td>7805 linear</td><td>P = (9-5)×0.2 = 0.8W — no heatsink needed, simple, quiet</td></tr>
    <tr><td>5V from 12V at 1A</td><td>Buck converter</td><td>P = 7W in a linear — too much heat. Switcher: ~95% efficiency, minimal heat</td></tr>
    <tr><td>3.3V from 3.7V LiPo</td><td>LDO (MCP1700)</td><td>Small dropout (needed at end of charge cycle), ultra-low Iq for battery life</td></tr>
    <tr><td>Variable bench supply</td><td>LM317 + transformer</td><td>Clean, adjustable, low noise — classic bench supply approach</td></tr>
    <tr><td>5V from 3.7V LiPo (USB output)</td><td>Boost (MT3608 or XL6009)</td><td>Need to step UP — only switcher can do this</td></tr>
    <tr><td>Sensitive RF/audio circuit</td><td>Linear with LDO</td><td>Switching noise would degrade noise floor; linear supply essential</td></tr>
  </tbody>
</table>

<h2>References</h2>
<ul>
  <li>Horowitz &amp; Hill — <em>The Art of Electronics</em>, 3rd ed. Chapter 9</li>
  <li>Texas Instruments — <a href="https://www.ti.com/lit/an/slva066b/slva066b.pdf" target="_blank" rel="noopener">Understanding LDO Dropout (PDF) ↗</a></li>
  <li><a href="https://www.ti.com/tool/WEBENCH-POWER-DESIGNER" target="_blank" rel="noopener">TI WEBENCH — online regulator designer ↗</a></li>
  <li>LM317 datasheet — National Semiconductor / TI</li>
</ul>
