MyRoboPath
electronics14 min readUpdated 2026-03-10Beginner

AC vs DC: Alternating Current vs Direct Current Explained

Compare Direct Current (DC) from batteries and microcontrollers with Alternating Current (AC) from wall outlets. Learn frequencies, RMS voltage, rectification, and transformers.

MyRoboPath Engineering Lab
Peer-Reviewed Open-Source Hardware & Firmware Guide

Key Engineering Takeaways

  • Direct Current (DC) flows in a single fixed direction with constant polarity; generated by batteries, solar panels, and DC power supplies.
  • Alternating Current (AC) continuously changes direction and magnitude in a smooth sine wave; standard mains grid power (120V@60Hz or 230V@50Hz).
  • RMS Voltage (V_RMS = 0.707 · V_peak) represents the equivalent DC heating power of an AC sine wave.
  • AC is chosen for national power transmission because step-up transformers can boost voltage to hundreds of kilovolts, drastically minimizing I²R wire losses.
  • All microcontrollers (ESP32, Arduino, Raspberry Pi) and robotic sensors require steady, ripple-free DC power.
Prerequisites
  • Basic Voltage and Current understanding
Required Hardware / Tools
  • Oscilloscope (or visual simulator)
  • AC-to-DC Wall Adapter (12V/5V)
  • Multimeter (AC/DC mode)

What is Direct Current (DC)?

In **Direct Current (DC)**, electrical charge flows exclusively in **one constant direction**. The voltage potential remains steady over time without alternating polarity. ### Sources of DC: - **Chemical Batteries**: AA, 9V, 18650 Lithium-ion, and LiPo packs. - **Solar Photovoltaic Cells**: Sunlight directly excites DC electron current. - **DC Power Supplies & USB Ports**: Regulated 5V, 12V, 24V rails. In mobile robotics and embedded computing, **99% of all digital circuits run on DC** because microcontrollers require steady logic thresholds ($0\,\text{V} = \text{LOW}, 3.3\,\text{V} = \text{HIGH}$).
Direct Current DC flat line waveform graph
Figure 2.1: Direct Current (DC) voltage graph showing constant unidirectional voltage over time.Visual Guide

What is Alternating Current (AC)? Sine Waves & Frequency

In **Alternating Current (AC)**, the flow of electric charge periodically **reverses direction**. The voltage starts at zero, climbs to a positive peak, drops back through zero to a negative peak, and repeats in a continuous sinusoidal oscillation. ### Key AC Parameters: - **Period ($T$, seconds)**: Time taken to complete one full positive and negative cycle. - **Frequency ($f$, Hertz $\text{Hz}$)**: Number of full cycles completed per second: $$f = \frac{1}{T}$$ - **North America**: $120\,\text{V}$ AC at $60\,\text{Hz}$ (reverses direction 120 times per second). - **Europe, Asia, India, UK**: $230\,\text{V}$ AC at $50\,\text{Hz}$ (reverses direction 100 times per second).
AC sinusoidal waveform diagram
Figure 2.2: Alternating Current (AC) sine wave showing peak voltage, period T, and zero crossings.Visual Guide

Peak Voltage vs RMS (Root Mean Square) Voltage

When a wall outlet is labeled "$120\,\text{V}$" or "$230\,\text{V}$", that number is **not the peak voltage**—it is the **Root Mean Square (RMS)** voltage. RMS is the effective voltage that produces the exact same heating power in a resistor as an equivalent DC voltage: $$V_{\text{RMS}} = \frac{V_{\text{peak}}}{\sqrt{2}} \approx 0.7071 \times V_{\text{peak}}$$ $$V_{\text{peak}} = V_{\text{RMS}} \times \sqrt{2} \approx 1.4142 \times V_{\text{RMS}}$$ For a $120\,\text{V}_{\text{RMS}}$ wall outlet: $$V_{\text{peak}} = 120 \times 1.414 = 169.7\,\text{Volts}$$ $$\text{Peak-to-Peak Voltage } (V_{\text{p-p}}) = 2 \times 169.7 = 339.4\,\text{Volts!}$$
AC peak vs RMS voltage comparison graph
Figure 2.3: Comparison of V_peak, V_rms, and Peak-to-Peak voltage on an AC sine wave.Visual Guide

Why is AC Used for Power Grids? (Transformers & Low Loss)

During the famous "War of the Currents" between Thomas Edison (DC) and Nikola Tesla / George Westinghouse (AC), AC won because of one critical device: the **Transformer**. Transformers operate on electromagnetic induction, which only works with changing (alternating) magnetic fields. Power lost as heat in transmission lines is: $$P_{\text{loss}} = I^2 \times R_{\text{wire}}$$ By stepping up AC voltage from $10{,}000\,\text{V}$ to $400{,}000\,\text{V}$, the current $I$ drops by a factor of 40, reducing transmission wire heat loss by a staggering $40^2 = 1{,}600\times$! Once it reaches cities, step-down transformers safely reduce it back down to $120\,\text{V}/230\,\text{V}$.
High Voltage EfficiencyTransmitting at high voltage allows electricity to travel hundreds of miles over thin cables with minimal power loss.

How AC is Converted to Clean DC (Rectifiers & Regulators)

To power DC electronic boards from AC mains, modern power supplies perform 4 sequential conversion steps: 1. **Step-Down Transformer**: Lowers $230\,\text{V}/120\,\text{V}$ AC to safe low-voltage AC (e.g. $12\,\text{V}$ AC). 2. **Diode Bridge Rectifier**: Flips negative half-cycles to positive, creating pulsating DC. 3. **Smoothing Filter Capacitor**: Stores and releases charge to flatten voltage ripples. 4. **Voltage Regulator (Buck / Linear)**: Regulates the voltage to an exact flat DC line (e.g., $+5.00\,\text{V}$ or $+3.30\,\text{V}$).
AC to DC power supply conversion stages
Figure 2.4: The 4 stages of converting AC to clean DC: Transformer -> Rectifier -> Filter -> Regulator.Visual Guide

Frequently Asked Questions

Can you plug a DC device into an AC wall socket directly?

No! Connecting a DC device directly to AC will reverse polarity 50-60 times per second, immediately destroying capacitors, transistors, and ICs. Always use an AC-to-DC adapter.

Can batteries supply AC power?

No. Chemical reactions in batteries always produce DC. To get AC from a battery (such as running household appliances in an RV or solar home), you must use an electronic Inverter.

Tags:#Basic Electronics#AC#DC#Alternating Current#Direct Current#Rectification#RMS