I've used that very successfully, but my design used two optos, anti parallel on the diode side and parallel on the transister side. This way I got 120 pulses. I didn't worry about noise - it wasn't something I ran into, and if I got a bad zero cross it didn't have more than a 1/2 cycle delay before getting a correct timing, and I've yet to see a lamp filament that can react that fast. There are other methods to zero cross. The only other isolated method I'm aware of is using the output of the transformer that's powering the PIC. I suspect a simple op-amp or at most comparator circuit would give you the exact zero crossing. For my application I calculated the time the LED would turn off in the opto, and found it reasonably close to later measurements. This way I knew when the zero cross would occur before it actually occured, and I ignored the trailing edge. This could be made automatic, as you suggest. If you'd like the same capability with knowledge beforehand, you can time it each time, and apply it to the next zero cross. Good luck! -Adam Eisermann, Phil [Ridg/CO] wrote: > I have the following idea to detect zero-crossing on an AC line >reasonably close. Looking for comments/feedback on any other ideas that >might be implemented. > > 110V input throught two 10K resistors in series an H11AA814A >optocoupler. collector of optocoupler pulled to 5V via a 22k resistor. >collector fed into GP2 a 12F629. the PIC is running on interal clock. GP is >configured as an external interrupt, so it should be a ST. I expect the >pulse length to vary between devices due to variations in current transfer >ratio of the opto. To get a better reading of the actual zero crossing >point, I would measure the typical pulse length before the application does >anything. Half of the pulse length should get me pretty close to the true >zero crossing point. > > The application will remain in service maybe 10 to 20 minutes before >it is powered down. would the oscillator frequency remain stable enough >during this point, or am I making this too complicated? It is for phase >control, and I will always be switching "very soon" after the zero-crossing >point; I do not need a large control range. > > Thanks for any feedback > >Phil Eisermann >Electronics Engineer >The Ridge Tool Company >(440)329-4680 > > >-- >http://www.piclist.com hint: The list server can filter out subtopics >(like ads or off topics) for you. See http://www.piclist.com/#topics > > > > > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.