AC detection

@MaheshAtSense and others have recently answered some AC detection questions you might find helpful:

The blog link there is also very detailed