measuring AC voltage with an analog input pin.

Hi
I'm looking for some help with measuring AC voltage with an Arduino. The normal home voltage here in the USA is 120vac RMS. I'm looking to build a voltage divider the highest voltage would be 156vac (rms) would provide an output of the divider of = 5vdc on analog input pin. The low end 84vac (rms) would produce an output of the divider of 0vdc. I'm planning on rectifying the ac voltage and providing 1/8 amp fuses to protect ac primary voltage. On the dc side I'll have a 5.6v zener to clamp the voltage 30 percent of 120vac is 36 volts so I got 156vac on the high end and 84vac on the low end. I have no idea how to compute the resistor divider. Thanks in advance.
Don

Why not use a transformer, for example 120vac to 12 vac, then rectify and apply to a divider?

The normal home voltage here in the USA is 120vac RMS...
...I have no idea how to compute the resistor divider.

This is DANGEROUS, even with a voltage divider. It's especially dangerous for a beginner! It can be dangerous to both you and the Arduino.

A safer way to do it is to run the AC through a transformer. That will lower the voltage (depending on your choice of transformer) and more importantly, it will electrically isolate you and the Arduino from the dangerous voltage. The downside is that transformers are bulky. But if you are building a power supply to run the Arduino, you can use the same transformer. You'll need to measure the transformer with a voltmeter to calibrate your set-up. (A 12V transformer rarely gives you exactly 12V from 120V.)

With the warnings out of the way... [u]Voltage Divider[/u]. A 120V sine wave has a peak of about 1.4 times the RMS value (~168V), so 5/168 gives you are resistor ratio of 0.0298. (Or, you can adjust the calculation for 156VAC.)

The total resistance isn't critical (it's the ratio), but you'll need to calculate the power dissipation to make sure not to overheat your resistors at 120V. (P = Voltage Squared/Resistance)

You can either use a capacitor to filter the rectified AC to DC (that's what I'd do), or you can take lots of readings quickly to find the peak. (And, once you know the peak, you can calculate the RMS in your sketch.)

30 percent of 120vac is 36 volts so I got 156vac on the high end and 84vac on the low end. I have no idea how to compute the resistor divider.

Where did 30% come from????

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.