measuring AC voltage with an analog input pin.

I like the transformer idea for sure. I just came up with a percentage of 30. Any thing below 95vac (rms) would be concidered a brownout. I was looking to monitor if power was lost or low voltage. I was going to have a battery back up.