Alternating Current (AC) vs. Direct Current (DC)

Contributors: ShawnHymel
Favorited Favorite 10


alt text

Where did the Australian rock band AC/DC get their name from? Why, Alternating Current and Direct Current, of course! Both AC and DC describe types of current flow in a circuit. In direct current (DC), the electric charge (current) only flows in one direction. Electric charge in alternating current (AC), on the other hand, changes direction periodically. The voltage in AC circuits also periodically reverses because the current changes direction.

Most of the digital electronics that you build will use DC. However, it is important to understand some AC concepts. Most homes are wired for AC, so if you plan to connect your Tardis music box project to an outlet, you will need to convert AC to DC. AC also has some useful properties, such as being able to convert voltage levels with a single component (a transformer), which is why AC was chosen as the primary means to transmit electricity over long distances.

What You Will Learn

  • The history behind AC and DC
  • Different ways to generate AC and DC
  • Some examples of AC and DC applications

Recommended Reading

Alternating Current (AC)


Generating AC

AC can be produced using a device called an alternator. This device is a special type of electrical generator designed to produce alternating current.

A loop of wire is spun inside of a magnetic field, which induces a current along the wire. The rotation of the wire can come from any number of means: a wind turbine, a steam turbine, flowing water, and so on. Because the wire spins and enters a different magnetic polarity periodically, the voltage and current alternates on the wire. Here is a short animation showing this principle:

(Video credit: Khurram Tanvir)

Generating AC can be compared to our previous water analogy:

alt text

To generate AC in a set of water pipes, we connect a mechanical crank to a piston that moves water in the pipes back and forth (our “alternating” current). Notice that the pinched section of pipe still provides resistance to the flow of water regardless of the direction of flow.


AC can come in a number of forms, as long as the voltage and current are alternating. If we hook up an oscilloscope to a circuit with AC and plot its voltage over time, we might see a number of different waveforms. The most common type of AC is the sine wave. The AC in most homes and offices have an oscillating voltage that produces a sine wave.

alt text

Other common forms of AC include the square wave and the triangle wave:

alt text

Square waves are often used in digital and switching electronics to test their operation.

alt text

Triangle waves are found in sound synthesis and are useful for testing linear electronics like amplifiers.

Describing a Sine Wave

We often want to describe an AC waveform in mathematical terms. For this example, we will use the common sine wave. There are three parts to a sine wave: amplitude, frequency, and phase.

Looking at just voltage, we can describe a sine wave as the mathematical function:

alt text

V(t) is our voltage as a function of time, which means that our voltage changes as time changes. The equation to the right of the equals sign describes how the voltage changes over time.

VP is the amplitude. This describes the maximum voltage that our sine wave can reach in either direction, meaning that our voltage can be +VP volts, -VP volts, or somewhere in between.

The sin() function indicates that our voltage will be in the form of a periodic sine wave, which is a smooth oscillation around 0V.

is a constant that converts the freqency from cycles (in hertz) to angular frequnecy (radians per second).

f describes the frequency of the sine wave. This is given in the form of hertz or units per second. The frequency tells how many times a particular wave form (in this case, one cycle of our sine wave - a rise and a fall) occurs within one second.

t is our dependent variable: time (measured in seconds). As time varies, our waveform varies.

φ describes the phase of the sine wave. Phase is a measure of how shifted the waveform is with respect to time. It is often given as a number between 0 and 360 and measured in degrees. Because of the periodic nature of the sine wave, if the wave form is shifted by 360° it becomes the same waveform again, as if it was shifted by 0°. For simplicity, we sill assume that phase is 0° for the rest of this tutorial.

We can turn to our trusty outlet for a good example of how an AC waveform works. In the United States, the power provided to our homes is AC with about 170V zero-to-peak (amplitude) and 60Hz (frequency). We can plug these numbers into our formula to get the equation (remember that we are assuming our phase is 0):

AC equation

We can use our handy graphing calculator to graph this equation. If no graphing calculator is available we can use a free online graphing program like Desmos (Note that you might have to use ‘y’ instead of ‘v’ in the equation to see the graph).


Notice that, as we predicted, the voltage rise up to 170V and down to -170V periodically. Additionally, 60 cycles of the sine wave occurs every second. If we were to measure the voltage in our outlets with an oscilloscope, this is what we would see (WARNING: do not attempt to measure the voltage in an outlet with an oscilloscope! This will likely damage the equipment).

NOTE: You might have heard that AC voltage in the US is 120V. This is also correct. How? When talking about AC (since the voltage changes constantly), it is often easier to use an average or mean. To accomplish that, we use a method called “Root mean squared.” (RMS). It is often helpful to use the RMS value for AC when you want to calculate electrical power. Even though, in our example, we had the voltage varying from -170V to 170V, the root mean square is 120V RMS.




Direct Current (DC)

Direct current is a bit easier to understand than alternating current. Rather than oscillating back and forth, DC provides a constant voltage or current.

Generating DC

DC can be generated in a number of ways:

  • An AC generator equipped with a device called a “commutator” can produce direct current
  • Use of a device called a “rectifier” that converts AC to DC
  • Batteries provide DC, which is generated from a chemical reaction inside of the battery

Using our water analogy again, DC is similar to a tank of water with a hose at the end.

alt text

The tank can only push water one way: out the hose. Similar to our DC-producing battery, once the tank is empty, water no longer flows through the pipes.

Describing DC

DC is defined as the “unidirectional” flow of current; current only flows in one direction. Voltage and current can vary over time so long as the direction of flow does not change. To simplify things, we will assume that voltage is a constant. For example, we assume that a AA battery provides 1.5V, which can be described in mathematical terms as:

alt text

If we plot this over time, we see a constant voltage:

alt text

What does this mean? It means that we can count on most DC sources to provide a constant voltage over time. In reality, a battery will slowly lose its charge, meaning that the voltage will drop as the battery is used. For most purposes, we can assume that the voltage is constant.


Almost all electronics projects and parts for sale on SparkFun run on DC. Everything that runs off of a battery, plugs in to the wall with an AC adapter, or uses a USB cable for power relies on DC. Examples of DC electronics include:

  • Cell phones
  • The LilyPad-based D&D Dice Gauntlet
  • Flat-screen TVs (AC goes into the TV, which is converted to DC)
  • Flashlights
  • Hybrid and electric vehicles

Battle of the Currents


In 1886, Ganz Works, an electric company located in Budapest, electrified all of Rome with AC. Thomas Edison, on the other hand, had constructed 121 DC power stations in the United States by 1887. A turning point in the battle came when George Westinghouse, a famous industrialist from Pittsburg, purchased Nikola Tesla’s patents for AC motors and transmission the next year.

AC vs. DC


Thomas Edison (Image courtesy of



Tesla Westinghouse
Nikola Tesla (Image courtesy of George Westinghouse (Image courtesy of


Edison’s Smear Campaign


The Rise of AC


alt text



High-Voltage Direct Current (HVDC)





Going Further

You should now have a good understanding of the differences between AC and DC. AC is easier to transform between voltage levels, which makes high-voltage transmission more feasible. DC, on the other hand, is found in almost all electronics. You should know that the two do not mix very well, and you will need to transform AC to DC if you wish to plug in most electronics into a wall outlet. With this understanding, you should be ready to tackle some more complex circuitry and concepts, even if they contain AC.

Take a look at the following tutorials when you are ready to dive deeper into the world of electronics: