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. 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. Mind you, you Yanks only have to be careful of 115V - 240V will kill you twice as fast! -- Clyde Smith-Stubbs | HI-TECH Software, | Voice: +61 7 3354 2411 clyde@hitech.com.au | P.O. Box 103, Alderley, | Fax: +61 7 3354 2422 http://www.hitech.com.au | QLD, 4051, AUSTRALIA. | --------------------------------------------------------------------------- Download a FREE beta version of our new ANSI C compiler for the PIC microcontroller! Point your WWW browser at http://www.hitech.com.au/