Tutorials

Electronics Fundamentals: Alternating Current AC

last updated: 06/02/19

Introduction

Song of this chapter: All songs by AC/DC ;)

Let's do a little history.

In 1887 in the United States Thomas Edison had constructed 121 DC power stations. At that time DC could not be easily converted to high voltages, needed to transport energy over longer distances. Edison promoted a system of many small, local power plants, that would power individual neighborhoods or city sections. With 110 V DC the voltage drop limited the maximum distance from the plant to the end user to 1.6 km. This limitation made power distribution in rural areas impossible.

In 1886 all Rome was electrified with AC. George Westinghouse ( entrepreneur and engineer from Pittsburgh) became aware of the new European alternating current systems in 1885 when reading an UK technical journal Engineering. He imported transformers and an AC electric generator, and began experimenting with AC networks and helped installing the first multiple-voltage AC power system. An hydroelectric generator produced 500 V AC stepped down to 100 V to light incandescent bulbs. The Westinghouse company installed more AC-lighting systems and by the end of 1887 it had 68 alternating current power stations.

The competition with Edison became the "War of the currents" with Thomas Edison spreading public perception that the high voltages used in AC distribution were unsafe.

"Just do (read and watch) it" AC1:

Why sinus and why 50Hz?

Most power plants (water, wind, coal, nuclear, gas) give us mechanical (kinetic) energy of rotation (from steam turbines, gas turbines or water turbines). With generators (dynamos or alternators) this rotational energy is converted to electrical energy.

wind mill

A current (moving electrons) produces a magnetic field. Bending a wire into multiple closely spaced loops to form a coil gives us an electromagnet.

On the other hand a moving wire (or a coil) in a magnetic field produces a voltage. This is called electromagnetic induction. A conductor loop (or a coil of wire) rotating in a magnetic field produces a current which changes direction with each 180° rotation, an alternating current (AC).

The inducted voltage depends on the changing of the magnetic flux Φ and the number of windings (N) of the coil, and the magnetic flux depends on the magnetic flux density B of the magnetic field and the effective area of the conductor loop A in the magnetic field and .

u = -N·dΦ/dt     Φ = B·A

The width w of the effective loop area in the magnetic field is maximum at 0°, and zero at 90°. It can be calculated with the cos of the angle α.

Φ = B·w·l·cos(α)

loop

loop

The changes of the magnetic flux is minimal at 0° and 180° and is biggest at 90° (negative) and 270°. The derivative of a cosine gives a sinus. That's why sinus :). The induced voltage can be calculated with:

u = û·sin(α)

sinus

"Just do (watch) it" AC2:

Characteristics of an AC voltage

Here is the oscilloscope screen of a measured voltage in a wall socket. The oscilloscope measured three voltages, the frequency and the period. Let's take a closer look at these physical quantities.

ac_voltage

Peak voltage û and peak to peak voltage USS

û (Us) is the peak voltage (Vp) in Volt (V).

On the screen it is named Max. This voltage is in the European power supply system 325 V.

The peak-to-peak voltage of an AC voltage USS (Vpp) in Volt (V) is the difference between its positive peak and its negative peak. For a sinusoidal voltage (sin(x) goes from +1 to −1) the maximum values swing between and −û. The peak-to-peak voltage is therefore û−(−û) = 2û.

loop

Period T, frequency f and angular frequency ω

u(t) = û·sin(α(t))

The amplitude of the voltage is changing in the rhythm of the sine between the peak values. One period is one revolution of the generator (0 - 360°). The time needed for such a revolution depends of the rotating speed of the generator. If the generator turns with 3000 revolutions per minute or 50 revolutions per second we get 50 periods per second. One sine wave of the voltage returns 50 times in one second. This is called the frequency f of the voltage. The time needed for one period is called periodic time T.

Frequency is the number of occurrences of a repeating event per unit of time. The symbol is f and the unit is hertz Hz or s-1 (cycle per second).

The period T is the duration of time of one cycle in a repeating event, so the period is the reciprocal of the frequency. It's unit is the second s.

f = 1/T     T = 1/f

One revolution is equal to 360° or radians. We can use the angular frequency ω to connect the time of one revolution with the angle.

ω = 2π/T     ω = 2πf

The angular frequency ω is a scalar measure of rotation rate. It's unit is radians per second (s-1).

For our sine wave we get:

u(t) = û⋅sin⁡(ωt)

with the momentary angle α(t) = ω⋅t.

So, why 50 Hz? The alternating current needed a frequency high enough to avoid flickering (see following exercise in this chapter) and not too high for the rotational speed of the generators.

Effective voltage U (Ueff, URMS)

The peak voltage is not a good value to describe the effect of an AC voltage. We want an AC voltage value that has the same effect than a DC voltage (how hot gets a radiator or how bright is a lamp). This can be achieved by comparing the time averaged power P. Instantaneous power p(t) would be calculated with:

p(t) = u(t)2/R

A time averaged power (where the averaging is performed over any integer number of cycles and with the same effect than DC power) can be calculated using a new AC voltage value called root mean square (RMS) value URMS or effective value Ueff or simply U.

P = U2/R     P = Ueff2/R     P = URMS2/R

The effective voltage of a waveform can be calculated with the corresponding crest factor:

Ueff = û/crest factor

Sine wave:

U = Ueff = û/√2 = û/1.4142
Triangle wave:
U = Ueff = û/√3 = û/1.732
Square wave:
U = Ueff = û/1 = û

"Just do it" AC3:

Waveform's (time varying variables)

Alternating voltages and currents can come in a number of different waveform's. With oscilloscopes we can see this changing amplitude over time.

6 waveforms

"Just do it" AC4:
    // Just do it AC4

    const byte Square_out1 = 16;
    unsigned int delay_time = 100;

    void setup() {
      pinMode (Square_out1, OUTPUT);
    }

    void loop() {
      digitalWrite(Square_out1, LOW);
      delay(delay_time);
      digitalWrite(Square_out1, HIGH);
      delay(delay_time);
    }
"Just do it" AC5:
    // Just do it AC5

    const byte Square_out1 = 16;
    const byte Pot_pin = 4;

    unsigned int delay_time = 511;
    unsigned int pulsewidth;

    void setup() {
      Serial.begin(115200);
      pinMode (Square_out1, OUTPUT);
    }

    void loop() {
      pulsewidth = analogRead(Pot_pin)/8;
      Serial.println(pulsewidth);
      digitalWrite(Square_out1, LOW);
      delayMicroseconds(delay_time - pulsewidth);
      digitalWrite(Square_out1, HIGH);
      delayMicroseconds(pulsewidth);
    }
"Just do it" AC6:
    //  Just do it AC6 (DAC1 on IO25, DAC2 on IO26)

    float y;
    int sine[255];

    void setup() {
      for (int i=0;i<255;i++) {
        y=sin(((float)i/255)*2*PI); // calculate the sine table
        sine[i]=int(y*128)+128;
      }
    }

    void loop() {
      for (int i=0;i<255;i++) {
        dacWrite(DAC1, sine[i]);    // write on DAC1
        dacWrite(DAC2, i);          // write on DAC2
        delayMicroseconds(1);
      }
    }

Fourier_series

As seen the most common type of AC is the sine wave.

The french mathematician Joseph Fourier discovered in 1822 that the sine wave has a very special characteristic.

Any periodic waveform can be described with a sum of sine (or/and cosine) waves.

The study of the way functions may be represented or approximated by sums of e.g sine waves is called Fourier analysis. The representation of a function as the sum of simple sine waves is called a Fourier series.

"Just do it" AC7:
    //  Just do it AC7 (DAC1 on IO25, DAC2 on IO26)

    float y;
    int ymax = 80;
    int i,j,sine[255],sine3[255],sine5[255],sine7[255],sine9[255];

    void setup() {
      for (int i=0;i<255;i++) {
        y=sin(((float)i/255)*2*PI);
        sine[i]=int(y*ymax);
      }
      for (int i=0;i<255;i++) {
        y=sin(((float)i/255)*2*3*PI);
        sine3[i]=int(y*ymax/3);
      }
      for (int i=0;i<255;i++) {
        y=sin(((float)i/255)*2*5*PI);
        sine5[i]=int(y*ymax/5);
      }
      for (int i=0;i<255;i++) {
        y=sin(((float)i/255)*2*7*PI);
        sine7[i]=int(y*ymax/7);
      }
      for (int i=0;i<255;i++) {
        y=sin(((float)i/255)*2*9*PI);
        sine9[i]=int(y*ymax/9);
      }
    }

    void loop() {
      for (j=0;j<1000;j++) {
        for (i=0;i<255;i++) {
          dacWrite(DAC1, sine[i]+128);
          dacWrite(DAC2, sine3[i]+128);
          delayMicroseconds(1);
        }
      }
      for (j=0;j<1000;j++) {
        for (i=0;i<255;i++) {
          dacWrite(DAC1, sine5[i]+128);
          dacWrite(DAC2, sine7[i]+128);
          delayMicroseconds(1);
        }
      }
      for (j=0;j<1000;j++) {
        for (i=0;i<255;i++) {
          dacWrite(DAC1, sine[i]+sine3[i]+128);
          dacWrite(DAC2, sine[i]+sine3[i]+sine5[i]+128);
          delayMicroseconds(1);
        }
      }
      for (j=0;j<1000;j++) {
        for (i=0;i<255;i++) {
          dacWrite(DAC1, sine[i]+sine3[i]+sine5[i]+sine7[i]+128);
          dacWrite(DAC2, sine[i]+sine3[i]+sine5[i]+sine7[i]+sine9[i]+128);
          delayMicroseconds(1);
        }
      }
}

Let's have a closer look on the fourier series of a square wave:

u(t) = 1.2732(sin⁡(ωt) + 1/3(sin⁡(3ωt) + 1/5(sin⁡(5ωt) + 1/7(sin⁡(7ωt) + 1/9(sin⁡(9ωt) + ...)

We see that a square wave with a certain base frequency f can be created by adding to a sine wave with the same base frequency and an amplitude of 4/π = 1.2732 to a second sine wave with 3 times the base frequency and an amplitude of 4/3π = 1.2732/3 and a third sine wave with 3 times the base frequency and an amplitude of 4/5π = 1.2732/5 and so forth as shown in the following animated gif-picture from wikipedia.

fourier

Even by adding multiple sine waves up to very high frequencies, the square wave is not perfect! There will always be little ripples (ringing artifacts) and the rise time (time to change from a low to high) will not be infinite low.

This tells us a very important lesson.

It is impossible to achieve in physical systems an ideal square wave (instantaneously changes between the high and the low state and no under- or over-shooting). This would require an infinite bandwidth, but every real system has the characteristic of a low-pass filter. To transport a digital signal, the passing frequency of the used transportation channel must be much higher than the base frequency of the signal.

If we use an oscilloscope of 20 MHz to watch a perfect digital signal of 10 MHz, we will see a sine wave!! Even with an oscilloscope of 100 MHz we will not see the real signal!

Another example: In older days :) the telephone line was limited to 3.4kHz. It was not possible to pass a digital signal directly at a reasonable frequency. So it was necessary to use a modem (modulator-demodulator). Instead of sending a digital signal four sine waves were used. The call originator used sine waves at 1070 Hz and 1270 Hz (for low and high) and the answering modem 2025 Hz and 2225 Hz. This modulation is a frequency modulation and is called Frequency-shift keying (FSK) and allowed [full-duplex](https://en.wikipedia.org/wiki/Duplex_(telecommunications) at 300 bit/s! (50 years ago). If you want to see modem with acoustic coupler watch the film war games from 1983.

Any signal that can be represented as a variable that varies in time has a corresponding frequency spectrum. On the following picture we see the frequency spectrum of three different waveform's:

fourier

Electromagnetic spectrum (wiki)

  Class Short Frequency Wavelength
  Gamma rays γ 300 EHz

30 EHz
1 pm

10 pm

Ionizing radiation
Hard X-rays HX
300 EHz
1 pm
  Soft X-rays SX 300 PHz 1 nm
  Extreme ultraviolet EUV 30 PHz

3 PHz
10 nm

100 nm
------------------------- ------------------------ ----- --------- ---------

Visible radiation =>
Near ultraviolet NUV 3 PHz

300 THz
100 nm

1 µm
  Near infrared NIR
30 THz

10 µm
  Mid infrared MIR
3 THz

100 µm
  Far infrared FIR
300 GHz

1 mm
------------------------- ------------------------ ----- --------- ---------
  Extremely high frequency EHF 300 GHz

30 GHz
1 mm

1 cm

Microwaves
Super high frequency SHF
3 GHz

1 dm
  Ultra high frequency UHF
300 MHz

1 m
  Very High frequency VHF
30 MHz

10 m
------------------------- ------------------------ ----- --------- ---------
  High frequency HF 30 MHz

3 MHz
10 m

100 m

Radio waves
Medium frequency MF
300 kHz

1 km
  Low frequency LF
30 kHz

10 km
  Very low frequency VLF
3 kHz

100 km
------------------------- ------------------------ ----- --------- ---------
  Ultra low frequency ULF 3 kHz

300 Hz
100 km

1 Mm
  Super low frequency SLF
30 Hz

10 Mm
  Extremly low frequency ELF
3 Hz

100 Mm

Dangerous current

In the war of currents Edison used the danger of currents to argue against AC voltage. A pamphlet claimed DC had not caused a single death, and included newspaper stories of accidental electrocutions caused by alternating current. Westinghouse on the other side pointed out in letters to various newspapers the number of fires caused by DC equipment.

If you touch the electric wire around a meadow, you touch a voltage of 2000 V - 5000 V. Why does this high voltage does not kill you on the spot?

It's not the voltage that kills (voltage can hurt without direct damage), but the height of the current and the duration the current passes the heart. The current of the meadow wire is limited to 100 mA - 300 mA and the duration to 20 ms - 100 ms.

Effects of electrical current in the human body

The IEC publication 60479-1 defines four zones of current-magnitude /time-duration. In each of these four zones the physiological effects are described.

electric<em>shock</em>graph

Source: Graphic by Cmglee under Creative Commons Attribution-ShareAlike 3.0 Unported license(CC BY-SA 3.0).

Time/current zones for AC 15 Hz to 100 Hz for hand to feet pathway

Zones Boundaries   Physiological effects
AC-1 Up to 0.5 mA Perception possible but usually no ‘startled’ reaction
AC-2
0.5 mA up to
green curve
Perception and involuntary muscular contractions likely but usually
no harmful electrical physiological effects
AC-3


Green curve up
to red curve


Strong involuntary muscular contractions. Difficulty in breathing.
Reversible disturbances of heart function. Immobilization may occur.
Effects increasing with current magnitude.
Usually no organic damage to be expected
AC-4
1)

Above red curve


Patho-physiological effects may occur such as cardiac arrest,
breathing arrest, and burns or other cellular damage.
Probability of ventricular fibrillation increasing with current magnitude
and time
AC-4.1 Probability of ventricular fibrillation increasing up to about 5 %
AC-4.2 Probability of ventricular fibrillation up to about 50 %
AC-4.3 Probability of ventricular fibrillation above 50 %

1)
For duration's of current flow below 200 ms, ventricular fibrillation is only initiated within the vulnerable period if the relevant thresholds are surpassed. As regards ventricular fibrillation, this figure relates to the effects of current which flows in the path left hand to feet. For other current paths, the heart current factor has to be considered.

As we see above, the differences between AC and DC are not huge.

Simplified we could state that for a short time (less than 200 ms) a human can stand 50 mA (AC or DC).

Ohm's law states that the current drawn depends on the resistance of the body. Every person has his own resistance as a lot of different factors are involved (e.g. like for wires as resistors, the resistance of an arm or leg depends on it' length and diameter). Men tend to have lower resistance than women (thicker arms and legs). A rough value for the internal resistance of the human body is 300 Ω - 1000 Ω. The path that electricity takes through the body is also important (e.g. the resistance from hand to foot is bigger than the distance from thumb to ring-finger on the same hand).
But the main resistance comes from the skin, witch is a poor conductor if it's not wet or burnt/blistered. The resistance from dry skin is between 1000 Ω - 100000 Ω.

The total resistance is:

RBody = RSkin+RBint+RSkout

body_resistance

For simplification we will memorize that the total resistance of the human body is 1000 Ω.

"Just do (calculate) it" AC8:

It is the current that kills, but anyway we can state:

Voltages above 50 V AC and above 120 V DC are dangerous!
For children and animals voltages above 25 V AC and above 60 V DC are dangerous!
Voltages under 25 V AC and under 60 V DC schould be used, they are not dangerous!

"Just do (research) it" AC9:

Other dangers

A current through a wire causes heat, and so a third of all fires is caused by short circuits or overheating of electric equipment. Other dangers of electricity are the high forces generated through magnetism at high currents, or flash burns of the eyes flash arcs caused in short circuits. A current through a fluid can also produce toxic or explosive gases.

Interesting links: