Log #105 · Nov 16, 2026
AC vs DC Explained: What's the Difference and Why It Matters
The difference between alternating and direct current, why the grid uses AC and electronics use DC, what RMS and peak voltage mean, how a power adapter converts one into the other, and how to measure both safely.
Your Arduino runs on 5 V DC. The socket in the wall supplies 120 or 230 V AC. Between them sits the power adapter, quietly converting one into the other. Knowing the difference explains why adapters exist, why a multimeter has two voltage settings, why diodes and capacitors appear in every power supply, and why mains electricity deserves so much more respect than a battery. This guide covers the essentials.
DC: direct current
In direct current, charge flows in one direction only, from the + terminal through the circuit and back to −. The voltage stays (mostly) constant.
Sources of DC:
- Batteries of every kind
- Solar panels
- USB ports and phone chargers (their output)
- Bench power supplies and lab adapters
Almost all electronics, from microcontrollers to LEDs and sensors, need DC. A chip has a + pin and a − pin, and reversing them can destroy it.
AC: alternating current
In alternating current, the voltage swings from positive to negative and back, so the current reverses direction many times per second. On the mains grid it follows a smooth sine wave.
The frequency is how many full cycles happen per second:
| Region | Typical mains voltage | Frequency |
|---|---|---|
| Most of Europe, Asia, Africa, Australia | 220–240 V | 50 Hz |
| North America | 120 V | 60 Hz |
| Much of South America | 110–127 V or 220 V, depending on the country | 50 or 60 Hz |
At 50 Hz, one cycle lasts 20 ms; at 60 Hz, about 16.7 ms.
RMS and peak voltage
Here's a surprise: "230 V AC" doesn't mean the voltage is ever 230 V for long. The sine wave climbs to a peak of about 325 V, falls through zero, and reaches −325 V half a cycle later.
The 230 V figure is the RMS (root mean square) value: the DC voltage that would heat a resistor by the same amount. For a sine wave:
peak = RMS × 1.414 (√2)
| RMS (what the label says) | Peak |
|---|---|
| 12 V AC (from a transformer) | ~17 V |
| 120 V AC | ~170 V |
| 230 V AC | ~325 V |
This matters when choosing parts: a capacitor connected after a rectifier on 12 V AC charges to about 17 V, not 12 V, so it needs a voltage rating above 17 V (25 V is the usual choice).
Why the grid uses AC
AC won the "war of the currents" for one main reason: transformers. A transformer can step AC voltage up or down efficiently with just two coils of wire on an iron core. Power stations step the voltage up to hundreds of kilovolts for long-distance lines, because high voltage means low current and therefore much smaller losses in the wires. Near your home it's stepped back down. Transformers don't work with DC.
Today, very long high-voltage DC links also exist, because modern electronics can convert efficiently, but the grid you plug into is AC.
Why electronics need DC
Digital chips need a steady supply: a logic HIGH must stay HIGH. A voltage that reverses 100 times a second would reset them constantly. So every mains-powered device starts with a power supply that converts AC to steady, low-voltage DC.
How an adapter turns AC into DC
The classic (linear) supply does it in four stages:
- Transformer: steps 230 V AC down to, for example, 9 V AC.
- Rectifier: four diodes in a bridge flip the negative half of each cycle positive. The result is "pulsating DC": always positive, but bumping from 0 to peak 100 or 120 times a second.
- Filter capacitor: a large electrolytic capacitor charges at each peak and supplies the circuit in between, smoothing the bumps into DC with a small ripple. (Why capacitor size matters is covered in choosing capacitors.)
- Regulator: a chip like a 7805 removes the remaining ripple and holds the output at exactly 5 V, as explained in voltage regulators explained.
Modern phone chargers are switching supplies: they rectify the mains directly, chop it at tens of thousands of hertz, and use a tiny high-frequency transformer. That's why they're so small and light. The result is the same: clean DC. More on choosing one in choosing a power adapter.
AC signals inside electronics
"AC" doesn't only mean mains. Any signal that swings up and down is AC: audio from a microphone, the output of a function generator, a radio signal. In circuit diagrams you'll see capacitors used for AC coupling: they pass the changing part of a signal and block the steady DC part. And many signals are a mix: a DC level with an AC wiggle on top, like the output of a voltage divider with a varying sensor.
Measuring AC and DC
A multimeter has separate settings:
- V⎓ (or DCV, a straight line): for batteries, Arduino pins, adapters' outputs.
- V~ (or ACV, a wavy line): for AC voltages; it shows the RMS value.
Measuring DC on the AC setting may read zero or a misleading value, depending on the meter, and AC on the DC setting reads near zero (or jumps around). If a reading makes no sense, check the setting first. Cheap meters show correct RMS only for clean sine waves; "True RMS" meters handle distorted waveforms too.
To see the waveform rather than just a number, you need an oscilloscope.
Safety: mains is different
- A 9 V battery can't push dangerous current through dry skin. Mains voltage can kill.
- Never open a powered mains device, and don't build circuits that connect to mains as a beginner. For switching lamps or appliances, use a properly enclosed module and follow the warnings in the relay module guide.
- Capacitors in mains power supplies can stay charged after unplugging.
- The safe way to experiment with AC is a low-voltage transformer or AC adapter (for example 9 V or 12 V AC output), which keeps the dangerous part sealed inside.
Quick summary
| DC | AC | |
|---|---|---|
| Direction | One way | Reverses each half cycle |
| Waveform | Flat line | Sine wave (on the grid) |
| Typical sources | Batteries, USB, solar, adapters | Wall sockets, transformers |
| Changing voltage | Needs electronics (converters) | Simple transformers |
| Used by | Nearly all electronics | Power distribution, motors, heaters |
— TheSolderBench · found a mistake? tell me