PWM to analog

by ourcircuits

3 parts

How a microcontroller fakes a DAC. A 10 kHz square wave with adjustable duty feeds an RC whose time constant is ten switching periods, so the capacitor holds the average and ignores the switching. The output level is just duty × supply.