Thanks Ian, that's super helpful and clear as a bell. For my application, I have a sensor that produces its own ac voltage (variable reluctance sensor) and I'm just looking to confirm that the amplitude of that signal is reaching a specific height -- say 3 volts peak to peak. Given what you say about the cap having no discharge other than the sampling pin, what happens when the cap fills up? Does the full ac voltage pass by the cap and get clamped to the Zener diode's reverse voltage rating? For my purpose, there's no harm if the cap remains charged up for a while after I sample it, but am wondering if a high value resistor to ground (and maybe smaller cap) could be added so the cap doesn't store the peak voltage for more than a few seconds?
It's not a sine wave, but more of a regular pulse/burst wave -- if you picture a hummingbird's EKG chart (blips at 10 to 20Hz), you're in the right territory. The amplitude will normally be in the 5-15v range peak-to-peak, but can go higher under rare circumstances and, presumably, from noise and real-world realities. My thought was to cut off the negative half of the pulse with a diode and store the peak voltage in the cap, and then pass it through a voltage divider so that the original 5-15v peak becomes 1.66 to 5v (less the diode) with very little current. That seems to work well in testing, but I'm focused now on the rare spikes that will still bring it over 5v. If I'm right that the full ac will pass by the cap when the cap is full, then that leaves only the Zener and the low current to protect the 5v controller. Good enough?