Consider using an Opto Isolator. You could put series resistors on both sides of the LED, and then the Sensor side goes to your logic isolating the logic from the mains. Also putting a zener and diode circuit in parallel with your LED could bring the "on" time closer to the zero line without frying the LED. Fred Thompson fthompso@mail.win.org On Thu, 4 Sep 1997, Jim Ruxton wrote: > 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 >