Does anyone on here know if the capacitor-resistor combo attached to a pwm output pin of an Arduino gives a decent analog output?
@MLE_online depends on the purpose... If you want is to be smooth it cant change fast.
@RueNahcMohr how fast or slow?

@MLE_online @RueNahcMohr what arduino do you have? They have different PWM speeds. And what is your acceptable ripple in your output?

Slowest pwm is 490hz. If you filter that with a 1k resistor and a 10uf capacitor, that’s a cutoff of about 16hz. So you could have a control signal of about that. It would have a ripple of about [edit: 0.25] volts on the output

Edit: I accidentally ran the calculation at the wrong PWM speed. The slower speed gives you .25 volts ripple, the faster gives you 0.12v

@MLE_online @RueNahcMohr additional info: you can software bit bang a faster pwm, there are arduino libraries

Also, you can use this calculator for PWM. It has been around for decades and I use it all of the time. Just plug in the pwm frequency, and the resistor and capacitor values and it will come back with cutoff frequency, and output ripple, and even graph it over time

http://sim.okawa-denshi.jp/en/PWMtool.php

(Sample)RC Low-pass Filter Design for PWM - Result -