PWM lets a purely digital pin produce something that behaves like an analog level. The output switches at a fixed frequency, and the duty cycle, the share of each period spent high, sets the average power delivered. The same principle dims smart lighting, sets the speed of DC fans and pumps, positions hobby servos and drives heaters through a solid-state relay.
Microcontrollers generate PWM in hardware timers, so the signal continues while the CPU does other work or sleeps. The main design choices are frequency and resolution: too low a frequency causes visible flicker or audible whine, while higher frequencies increase switching losses in the driver. Because PWM supplies pulses rather than a steady voltage, loads that need a true analog signal require filtering or a dedicated DAC instead.
Part of the IoT Glossary. Spotted an error or a missing term? Tell us.