24ac signal

I might be wrong about the half-rectification. After all we are trying to discharge the capacitor, and if we only activate the opto-isolator 50% of the time, the average would be for it to stay (at least partly) charged.