<!--order=3-->


<h1>AC vs DC</h1>
<p>AC (alternating current) and DC (direct current) describe how electric current flows. The distinction matters more than it might seem at first — most electronics runs on DC internally, but the power coming from the wall is AC, and the reason for that goes back to fundamental physics. Understanding the difference explains why power supplies exist, why transformers work, why some components behave differently with each type, and why the so-called "War of Currents" between Edison (DC) and Tesla/Westinghouse (AC) was eventually won by AC.</p>

<h2>DC — Direct Current</h2>
<p>DC flows in one direction at a constant voltage. Sources: batteries, solar cells, rectified power supplies, DC generators. Every microcontroller, logic gate, memory chip, and most sensors run on DC. The voltage you measure is the voltage you get — a 9V battery delivers 9V.</p>

<h2>AC — Alternating Current</h2>
<p>AC reverses direction periodically, following a sinusoidal waveform. Mains power in North America is 120V at 60Hz — the voltage cycles from positive peak to negative peak 60 times per second. Europe and most countries use 230V at 50Hz. The 120V you measure is the RMS value, not the peak:</p>
<pre>
V_peak = V_RMS × √2

North America: V_peak = 120 × 1.414 = 170V
Europe:        V_peak = 230 × 1.414 = 325V
</pre>
<p>This matters for component voltage ratings — capacitors in a mains circuit must be rated for the peak voltage, not the RMS.</p>

<h2>Key Differences at a Glance</h2>

<table>
  <thead><tr><th>Property</th><th>DC</th><th>AC</th></tr></thead>
  <tbody>
    <tr><td>Direction of flow</td><td>One direction only</td><td>Alternates at the frequency of the supply</td></tr>
    <tr><td>Voltage</td><td>Constant</td><td>Sinusoidal — varies continuously</td></tr>
    <tr><td>Measurement</td><td>V = what you measure</td><td>V_RMS = effective value; V_peak is higher by √2</td></tr>
    <tr><td>Sources</td><td>Batteries, regulated supplies, PV cells</td><td>Wall outlets, generators, inverters</td></tr>
    <tr><td>Transformer compatibility</td><td>No — transformers need changing flux</td><td>Yes — core of the AC grid system</td></tr>
    <tr><td>Long-distance transmission</td><td>Difficult (historically); HVDC now viable</td><td>Efficient with transformers at high voltage</td></tr>
    <tr><td>Used inside electronics</td><td>Yes — almost universally</td><td>Sometimes (audio signals are AC; mains is AC)</td></tr>
  </tbody>
</table>

<h2>Why AC for Mains Power?</h2>
<p>Transformers only work with AC. A transformer changes voltage with near-perfect efficiency using nothing but wire and an iron core. Transmit power at high voltage (200kV–500kV) and the current is low, so resistive losses in the wires are small (P_loss = I² × R). Step it down at the destination for household use. This is the entire economic case for AC grid power.</p>
<p>Edison's DC system required power stations every mile because DC couldn't be stepped up for efficient transmission. Westinghouse and Tesla's AC system could span hundreds of miles from a single generating station. The physics was decisive — AC won in the 1890s.</p>
<p>Modern High Voltage DC (HVDC) transmission is now technically and economically viable for very long distances and submarine cables, and is used in specific large-scale projects. But the existing grid infrastructure worldwide is AC and will remain so.</p>

<h2>Component Behaviour in AC vs DC</h2>

<table>
  <thead><tr><th>Component</th><th>DC behaviour</th><th>AC behaviour</th><th>Key formula</th></tr></thead>
  <tbody>
    <tr><td>Resistor</td><td>V = IR (Ohm's Law, constant)</td><td>Same — resistance is frequency-independent</td><td>V = IR at all times</td></tr>
    <tr><td>Capacitor</td><td>Blocks DC after charging</td><td>Passes AC; lower impedance at higher frequency</td><td>X_C = 1/(2πfC)</td></tr>
    <tr><td>Inductor</td><td>Passes DC (acts like wire resistance only)</td><td>Blocks AC; higher impedance at higher frequency</td><td>X_L = 2πfL</td></tr>
    <tr><td>Transformer</td><td>Does not work (no changing flux)</td><td>Steps voltage up or down with high efficiency</td><td>V_s/V_p = N_s/N_p</td></tr>
    <tr><td>Diode</td><td>Passes in forward direction only</td><td>Rectifies (converts AC to pulsating DC)</td><td>V_f ≈ 0.6–0.7V (silicon)</td></tr>
    <tr><td>LED</td><td>Lights when forward-biased, needs resistor</td><td>Lights on half-cycles; can be damaged by reverse voltage</td><td>—</td></tr>
  </tbody>
</table>

<h2>RMS Values and Power</h2>
<pre>
RMS (Root Mean Square) — the DC equivalent that delivers the same power:

For a sine wave:
  V_RMS = V_peak / √2 = V_peak × 0.707
  I_RMS = I_peak / √2

Power in a resistive AC circuit:
  P = V_RMS × I_RMS = I_RMS² × R = V_RMS² / R

For non-resistive loads (capacitors, inductors):
  P = V_RMS × I_RMS × cos(θ)    (power factor cos(θ) < 1)
</pre>

<table>
  <thead><tr><th>Waveform</th><th>V_RMS / V_peak</th><th>V_avg / V_peak</th></tr></thead>
  <tbody>
    <tr><td>Sine wave</td><td>0.707</td><td>0.637</td></tr>
    <tr><td>Square wave</td><td>1.000</td><td>1.000</td></tr>
    <tr><td>Triangle wave</td><td>0.577</td><td>0.500</td></tr>
    <tr><td>Half-wave rectified sine</td><td>0.500</td><td>0.318</td></tr>
    <tr><td>Full-wave rectified sine</td><td>0.707</td><td>0.637</td></tr>
  </tbody>
</table>

<h2>Converting AC to DC — The Power Supply Chain</h2>
<pre>
Step 1: Transformer (step down)
  120V AC → 12V AC
  Ratio: N_primary / N_secondary = 10:1

Step 2: Bridge rectifier (4 diodes)
  12V AC → pulsating DC, peak ≈ 12 × 1.414 − 1.4 = 15.6V

Step 3: Filter capacitor (smoothing)
  15.6V pulsating → 14–15.5V rough DC (120Hz ripple)
  C ≈ I_load / (120Hz × V_ripple_allowed)

Step 4: Linear regulator
  14V rough DC → 12V stable DC
  Ripple rejected by PSRR (~70dB for 78xx)

Step 5: Optional decoupling at load
  Additional 100nF ceramic per IC, local to the chip
</pre>

<h2>Inverters — DC Back to AC</h2>
<p>Some applications need to go the other direction — converting DC (battery) back to AC (for running AC loads from a battery or solar system). An inverter does this using high-frequency switching and filtering:</p>

<table>
  <thead><tr><th>Type</th><th>Output waveform</th><th>Efficiency</th><th>Use</th></tr></thead>
  <tbody>
    <tr><td>Modified sine wave</td><td>Stepped approximation</td><td>85–90%</td><td>Resistive loads (heaters, incandescent lights). Many electronics will work.</td></tr>
    <tr><td>Pure sine wave</td><td>True sine wave</td><td>90–95%</td><td>Motors, audio equipment, any sensitive electronics. Matches grid quality.</td></tr>
    <tr><td>Grid-tie</td><td>Synchronised pure sine</td><td>93–98%</td><td>Solar/wind power fed back to the grid</td></tr>
  </tbody>
</table>

<h2>References</h2>
<ul>
  <li>Horowitz &amp; Hill — <em>The Art of Electronics</em>, 3rd ed. Chapter 1</li>
  <li>Scherz &amp; Monk — <em>Practical Electronics for Inventors</em>, 4th ed.</li>
  <li><a href="https://www.allaboutcircuits.com/textbook/alternating-current/chpt-1/what-is-alternating-current-ac/" target="_blank" rel="noopener">All About Circuits — What is AC? ↗</a></li>
  <li><a href="https://www.electronics-tutorials.ws/accircuits/ac-waveform.html" target="_blank" rel="noopener">Electronics-Tutorials — AC Waveforms ↗</a></li>
</ul>
