Ugenz Academy/IoT Tutorial

Ac And Dc

7 min read1,366 words

Reading progress

Keep learning

AC and DC (Alternating Current and Direct Current)

1. Introduction

Electric current is the flow of electric charge through a conductor, such as a wire. Based on how the current flows and changes over time, electricity is commonly divided into two types:

  1. AC (Alternating Current)
  2. DC (Direct Current)

Both are essential in electronics. AC is commonly used in household electricity supply, while DC is used in batteries, mobile phones, computers, and most electronic circuits.

2. What is AC (Alternating Current)?

Alternating Current (AC) is an electric current that changes its direction periodically. Its magnitude can also change with time.

For example, the electricity supplied to homes generally uses AC.

Characteristics of AC

  • The direction of current changes periodically.
  • Its voltage and current can vary with time.
  • It is commonly used for household and industrial power.
  • Its voltage can be increased or decreased using a transformer.
  • It is suitable for transmitting electrical power over long distances.

Examples of AC

  • Household electrical outlets
  • Fans and refrigerators
  • Air conditioners
  • Washing machines
  • Alternators and generators that produce AC

AC frequency

Frequency tells us how many complete cycles of AC occur in one second. It is measured in hertz (Hz).

For example:

  • 50 Hz means 50 complete cycles per second.
  • 60 Hz means 60 complete cycles per second.

In Nepal and India, the standard household electricity frequency is 50 Hz.

The time taken to complete one cycle is called the time period.

T=1fT=\frac{1}{f}

Where:

  • TT = time period in seconds
  • ff = frequency in hertz

Example: If the AC frequency is 50 Hz:

T=150=0.02 secondsT=\frac{1}{50}=0.02\text{ seconds}

Therefore, one complete cycle takes 0.02 seconds, or 20 milliseconds.

3. What is DC (Direct Current)?

Direct Current (DC) is an electric current that flows in one direction. In a basic battery-powered circuit, conventional current flows from the positive terminal through the external circuit to the negative terminal.

DC voltage may be constant or may vary with time, but its polarity does not periodically reverse in the way AC does.

Characteristics of DC

  • Current flows in one direction.
  • Its polarity remains the same.
  • It is commonly supplied by batteries and DC power supplies.
  • It is widely used in electronic circuits.
  • It can be stored chemically in batteries.

Examples of DC

  • AA batteries
  • Mobile phone batteries
  • Power banks
  • Solar panels
  • Arduino boards
  • ESP32 development boards
  • LED circuits powered by DC supplies

For example, a typical AA battery provides approximately 1.5 V DC, while a USB power supply commonly provides 5 V DC.

4. Difference Between AC and DC

FeatureACDC
Full formAlternating CurrentDirect Current
DirectionChanges periodicallyFlows in one direction
PolarityReverses periodicallyRemains the same
FrequencyUsually 50 or 60 Hz for mains electricity0 Hz for steady, non-pulsating DC
Common sourcesPower stations and AC generatorsBatteries and DC power supplies
VoltageOften varies periodicallyMay be constant or vary without reversing polarity
Transformer useConventional transformers can change AC voltageSteady DC cannot be transformed directly using a conventional transformer
Common applicationsHome electricity and industrial powerElectronic circuits and battery-powered devices

Important: Frequency is not always zero for every DC waveform. Pulsating DC can vary with time, but it does not reverse its polarity.

5. AC and DC Waveforms

An electrical waveform shows how voltage or current changes over time.

AC waveform

AC commonly has a sine-wave shape. Its voltage alternates between positive and negative values.

For an ideal sinusoidal AC voltage:

v(t)=V_peaksin⁡(2πft)v(t)=V\_{\text{peak}}\sin(2\pi ft)

Where:

  • v(t)v(t) = instantaneous voltage
  • V_peakV\_{\text{peak}} = maximum voltage
  • ff = frequency
  • tt = time

DC waveform

A steady DC voltage remains constant over time.

For example, an ideal 5 V DC source maintains a voltage of 5 V.

Real power supplies can have small fluctuations, called ripple, but they still provide DC if the output polarity does not reverse.

6. Peak Voltage and RMS Voltage

Two important measurements used with AC are peak voltage and RMS voltage.

Peak voltage: The maximum instantaneous voltage reached by an AC waveform.

RMS voltage: The effective voltage that produces the same heating effect in a resistor as an equivalent DC voltage.

For a pure sinusoidal AC waveform:

V_RMS=V_peak2V\_{\text{RMS}}=\frac{V\_{\text{peak}}}{\sqrt{2}}

Similarly:

I_RMS=I_peak2I\_{\text{RMS}}=\frac{I\_{\text{peak}}}{\sqrt{2}}

For example, household electricity rated at 230 V AC is generally specified in RMS terms. For an ideal sine wave, its peak voltage is approximately:

V_peak=2302≈325 VV\_{\text{peak}}=230\sqrt{2}\approx325\text{ V}

This is why the instantaneous voltage of household AC can reach around 325 V even though its rated RMS voltage is 230 V.

Safety warning: Household mains electricity is dangerous and can cause severe injury or death. Never experiment directly with mains voltage on a breadboard or exposed circuit.

7. How AC Is Converted into DC

Many electronic devices need DC even though household outlets provide AC. A device called a rectifier converts AC into pulsating DC.

A typical AC-to-DC power supply contains these stages:

1. AC input

Alternating voltage from the source

2. Transformer or switching converter

Changes the voltage as required

3. Rectifier

Converts AC into pulsating DC

4. Filter

Reduces voltage ripple

5. Voltage regulator

Maintains the required DC output

For example, a phone charger takes AC input from a wall outlet and converts it into a suitable low-voltage DC output for charging the phone.

Modern phone chargers commonly use high-frequency switching converters rather than a large, traditional transformer.

8. How DC Is Converted into AC

A device called an inverter converts DC into AC.

For example, a home backup system may use a battery to store DC energy. During a power failure, an inverter converts the battery's DC output into AC to supply compatible household appliances.

Common applications include:

  • Solar power systems
  • Home backup systems
  • Uninterruptible power supplies (UPS)
  • Electric vehicle power systems

An inverter's output voltage, frequency, and waveform depend on its design.

9. Practical Electronics Examples

Example 1: Battery and LED

Suppose you connect a 3 V battery to an LED through a suitable current-limiting resistor.

  • The battery provides DC.
  • Current flows in one direction.
  • The LED emits light when connected with the correct polarity.
  • Reversing the LED's polarity normally prevents it from lighting.

Example 2: Household fan

A conventional household AC fan is designed to operate from AC mains electricity. Its motor uses the supplied alternating voltage to produce the magnetic effects needed for rotation.

Some modern fans use electronic controllers and motors that internally convert or process the incoming power.

Example 3: ESP32 development board

An ESP32 development board commonly receives 5 V DC through its USB connection. Onboard circuitry may regulate this to a lower voltage, such as 3.3 V, for the ESP32 chip.

Never connect household AC directly to an ESP32 pin. Use an appropriately designed, isolated power supply.

10. Quick Revision

  • AC: Current periodically reverses direction.
  • DC: Current flows in one direction.
  • Frequency: Number of complete cycles per second, measured in Hz.
  • Time period: Time required for one complete cycle.
  • Rectifier: Converts AC into pulsating DC.
  • Inverter: Converts DC into AC.
  • RMS voltage: Effective value of AC voltage.
  • Transformer: A conventional transformer changes AC voltage through electromagnetic induction.

Practice questions

  1. What is the full form of AC and DC?
  2. What is the difference between AC and DC?
  3. What does a frequency of 50 Hz mean?
  4. What is the function of a rectifier?
  5. What is the function of an inverter?
  6. Why does an ESP32 normally require DC rather than direct household AC?
  7. What is the difference between peak voltage and RMS voltage?

Next topic: 9. Series and Parallel Circuits

Keep learning. Keep building. Keep growing.

© 2026 Ugenz Academy