220VAC to TTL converter
You're probably fine in regards to the uP's input, but if you're really concerned, you could use a schmitt trigger buffer in between.  They're designed for noisy inputs.  Or if your particular uP has a built-in comparator as part of its analog stuff, then you could use that also.

As for the ripple, it's because the circuit is only getting pulsed once per AC cycle.  Between pulses, it's no different from having lost it entirely.  So you have a tradeoff between analog ripple and response time, neither of which can be zero.  Such is the problem with sensing AC.

Another approach might be to intentionally pulse the uP at the AC frequency, then have two interrupts:


External interrupt clears a timer and sets the AC_present bit.
Timer overflow interrupt clears the AC_present bit.


If you care about line frequency, you could measure it pretty easily by recording the timer before you clear it and then doing some math with that number.