> > Byron A. Jeff wrote: > > > Another thing is that the same issue I raised is still present. Presuming > > I use a transformer and I tie one leg of the secondary to the PIC input pin, > > where does the other leg go? GND? All the transformer does is change the > > voltage, it does not address the issue of how to integrate the return... > > Well, it does. With a transformer you can safely tie one side of the > secondary to ground. With mains input directly, you need to tie > the neutral to the PIC "ground", but you must not connect this to a real > ground, since not only can't you be sure the active and neutral are not > reversed, even if the neutral really is neutral, connecting it to > ground will trip earth-leakage detectors due to ground-loop currents. That's the answer I've been looking for. Thanks. Any reason why the App Note doesn't address these issues? Rhetorical question mind you... > > The transformer primary is easily protected from fingers; the entire > PIC circuit is not. If you do want to float the PIC at mains potential, > then use an isolation transformer during testing, and even then > you still have to be careful of the transformer secondary, since it > can kill you too. A low-voltage transformer is much safer. But one or two other issues are raised. Since I'm trying to do zero crossing will the transformer have any phase effects? Also since the voltage is smaller will it not take longer from the zero crossing for the secondary to reach the 2V threashold? Meaning that the PIC detecting the zero crossing will be much longer than if I was trying to detect directly from the 120V line. Mind you this isn't worth getting killed over so I will use the transformer, but I was just wondering. BAJ