How it works
Two numbers define a PWM signal
Frequency, how many cycles happen per second, and duty cycle, the percentage of each cycle the output is on. The average voltage at the load is roughly the supply voltage multiplied by the duty cycle.12
Switching fully on or off keeps the transistor's losses low, because it is either carrying current with little voltage across it or blocking voltage with no current. That is why PWM is far more efficient than dropping voltage through a resistor.14
Inductive loads like solenoids and motors smooth the pulses into a near-steady current. Motor drivers such as TI's DRV8873-Q1 H-bridge accept PWM inputs to set motor speed and direction.Medium56
In tuning
Frequency must suit the actuator.
Solenoid valves need a frequency low enough to open and close fully within each cycle, or control becomes nonlinear. Motors and fans run quieter at higher frequencies. Use the actuator maker's recommended frequency where one is published.Medium53
Battery voltage changes the result. The same duty cycle gives a higher average voltage at 14 V than at 12 V, so duty tables for solenoids and pumps often include a voltage correction.Medium13
Formula and worked example
V_avg = D × V_supply
- V_avg
- average voltage at the loadV
- D
- duty cycle as a fraction (0 to 1)
- V_supply
- supply voltageV
Myths vs facts
Myth Higher PWM frequency is always better.
Fact Solenoids need time to move each cycle. Above their useful frequency they stop following the signal and behave as if they were at a fixed position, which makes control nonlinear.Medium53
Myth A PWM output is the same as an analog voltage output.
Fact It switches between full supply and zero. Electronics that expect a steady voltage, such as some gauges or sensor inputs, can misread a PWM signal unless it is filtered.1
Frequently asked
What is PWM in a car?
PWM is a way of controlling devices like boost solenoids, fans, fuel pumps and idle valves by switching them on and off rapidly. The ECU varies the on-time percentage, the duty cycle, to set the average power the device receives, which controls its position or speed.13
What PWM frequency should I use?
Use the actuator maker's recommendation. Solenoid valves generally run at lower frequencies so they can move fully each cycle, while motors and fans often use higher ones to reduce noise. Too high a frequency for a solenoid makes its response nonlinear.Medium53
How does PWM control a solenoid?
The solenoid coil's inductance smooths the switched voltage into an average current. More duty means more current and more magnetic force against the valve's spring. At a suitable frequency, the valve either holds a partial position or opens and closes each cycle, giving an average flow.Medium51
Why does PWM need battery voltage compensation?
Average voltage equals duty multiplied by supply voltage. When the battery drops from charging voltage to resting voltage, the same duty delivers less voltage and current, so the actuator moves less. Voltage compensation adjusts duty to keep the result constant.Medium13
Used in these guides
Sources
Numbered as cited above. Hover or tap a citation chip to preview it.
- Pulse-width modulation · Wikipedia · reference · retrieved 2026-10-27
- Duty cycle · Wikipedia · reference · retrieved 2026-10-27
- Automotive Handbook, 10th edition (2018) · Robert Bosch GmbH / Wiley · book · retrieved 2026-10-27
- Power MOSFET · Wikipedia · reference · retrieved 2026-10-27
- Solenoid valve · Wikipedia · reference · retrieved 2026-10-27
- DRV8873-Q1 automotive H-bridge motor driver data sheet (SLVSDY7) · Texas Instruments · vendor-doc · retrieved 2026-10-27

