Tricky Circuit

Pulse width and average current

Dim a light by switching quickly

PWM means Pulse Width Modulation: changing the fraction of each cycle spent on. This fraction is duty cycle. LED means Light Emitting Diode, a light-producing semiconductor diode. Frequency in hertz (Hz) counts cycles per second.

Open interactive experiment

EXPERIMENT BENCH

Change the circuit settings, predict the readings, then check a challenge. These are learning models, with the assumptions explained in each lesson.

Sign in to save progress. Guest progress stays on this device.

Open laboratory in a full window

Why it works

Ideal 5 V pulses, LED drop 2 V, fixed resistor. Switching edges, visual response and thermal effects are omitted; brightness is not calibrated.

Peak current = (5 − 2)/R. Average current = peak × duty/100. More frequency means shorter cycles, not more average current at fixed duty. The peak formula describes an on pulse. At 0% duty there is no on pulse and the displayed peak is zero.

Difficulty
  1. Build · Build it

    Power on with 330 Ω, 50% duty and 100 Hz. Compare peak and average current.

    Need a hint?

    330 Ω; 50%; 100 Hz

  2. Explore · Change one thing

    Obtain 2–3 mA average, at most 20 mA peak, and a frequency of at least 100 Hz.

    Need a hint?

    330 Ω; 25%; 100 Hz → 2.27 mA

  3. Solve it · Solve the challenge

    Obtain 8–10 mA average, at most 20 mA peak, and a frequency of at least 200 Hz.

    Need a hint?

    200 Ω; 60%; 200 Hz → 9 mA

Extra reading and circuit recipes

Dim a light by switching quickly

A useful pattern

At 25% duty, the current is on for one quarter of each cycle; its peak is unchanged.

Beyond this model

A real driver must tolerate the pulse current. Fast switching does not automatically make an excessive peak safe.

A useful trap to avoid

PWM does not remove the need for an LED current-limiting resistor.

Duty stays at 50%; frequency doubles. Average current…

  1. doubles
  2. halves
  3. stays unchanged
Read more

The same fraction of time is on. Only the length of each cycle changes.

Arduino