Check: DAC/PWM load filtering

Knowledge check · self-test
Check: DAC/PWM load filtering
Checkpoint: What the Load Sees. A PWM pin switches on and off. The load and any filter decide how those pulses affect current, light, or motion. PWM duty cycle sets average voltage, but the raw pin is still switching between LOW and HIGH. LEDs and motors can tolerate or naturally average PWM; audio and precision references usually need cleaner DAC behavior. RC filtering trades ripple for response time, so a smoother voltage also settles more slowly. Checkpoint: PWM Filtering. A lower filter cutoff reduces ripple but makes the output take longer to settle. The following values show that trade for one example. A 75% duty cycle on 5V PWM averages to 3.75 V before losses and filtering details. For a 1 kHz PWM example, a 100 Hz cutoff target keeps the filter well below the switching frequency. A 0.22uF capacitor with 10k ohm gives about 72 Hz cutoff and a slower but smoother output. Knowledge Check: PWM Duty Cycle. Duty cycle is the fraction of each period spent high. With ideal zero and high levels, that fraction sets the average pin voltage, while the pin itself still switches.
Checkpoint: What the Load Sees. A PWM pin switches on and off. The load and any filter decide how those pulses affect current, light, or motion. PWM duty cycle sets average voltage, but the raw pin is still switching between LOW and HIGH. LEDs and motors can tolerate or naturally average PWM; audio and precision references usually need cleaner DAC behavior. RC filtering trades ripple for response time, so a smoother voltage also settles more slowly. Checkpoint: PWM Filtering. A lower filter cutoff reduces ripple but makes the output take longer to settle. The following values show that trade for one example. A 75% duty cycle on 5V PWM averages to 3.75 V before losses and filtering details. For a 1 kHz PWM example, a 100 Hz cutoff target keeps the filter well below the switching frequency. A 0.22uF capacitor with 10k ohm gives about 72 Hz cutoff and a slower but smoother output. Knowledge Check: PWM Duty Cycle. Duty cycle is the fraction of each period spent high. With ideal zero and high levels, that fraction sets the average pin voltage, while the pin itself still switches.
Back to DAC and PWM: Loads, Filters, and Code: Budget Ripple Before Choosing the Filter