Q:

Zero Cross Detection Circuit for line voltage

Possible Duplicate:
How can I detect a power outage with a microcontroller?  

I'm doing some research with the goal of eventually creating a light dimmer controllable from a micro controller.   I've figured out how to do the dimming of the light and now I need a zero cross detection circuit that I can use to determine when to phase shift the AC power.   
I have a few opto-couplers which should do the trick.   However (and this is my question), it appears that the AC side of the circuit takes around 1.7V (assuming I'm reading the datasheet correctly).   How do I get the line voltage down from 120V to 1.7V.  I assume that I could use a high value resistor, but wouldn't this generate too much heat?   Seems to me like it would just fry the resistor.   I'm pretty hesitant to just try this as I enjoy having all of my fingers attached. 
I've seen people discuss connecting the line voltage directly to the micro controller through high value resistors here, which seems like a pretty bad idea. 
To summarize my question:  How can I connect AC line voltage to my opto-coupler?   And if that's done with a resistor, how do I determine the correct ohms/watt rating to use? 
Thanks! 

A:

You can get big resistors. 
The datasheet specifies 1.15V - 1.5V forward voltage when the current is 10mA. To get that from 120V you would need a resistor of (120-1.5)/0.01 = 11.9kOhm, it would dissipate about 120*0.01 = 1.2W, so a 2W resistor would probably be OK (or use a 5W one if you have space, it won't get as hot).  
It would be difficult to get a resistor that precise, but the LED in the optocoupler can survive a continuous current of 60mA (which would require a resistor smaller than 2k), a 10kOhm 5W resistor in series would work.  The current will be somewhat above 10mA, but nowhere near the maximum.