Hacker News new | ask | show | jobs
by coupdejarnac 1230 days ago
You can do PID using a discrete output instead of analog/PWM. It's a common use case. I think I've seen an Arduino library that allows for this. Or, you can use whatever library you're already using and convert the PWM value to OFF or ON. Slow down the loop so you don't get a lot of chatter on the output; add hysteresis if necessary.

If you actually want to do AC "PWM" (it's not really PWM), use a triac as suggested by another poster, and make sure it does zero crossing detection.