Hi I'm designing a PIC based A.C. motor controller and am looking for a reliable and safe mains zero crossing detector. I've seen the scheme of putting a large (ie. 5 Mohm resistor in series with a port pin. This means I'd have to have the hot or neurtral line as my PIC ground. This makes me nervous. I was wondering if anyone has used a better scheme with success. I was thinking perhaps of using an opto isolator but if this needs 10ma to turn on it won't be very accurate. Maybe I need a common emitter transistor driving the opto isolator with the emitter at the hot side and the base being driven through a resistor by the neutral. Any ideas? Thanks!! Jim