> > Byron A Jeff wrote: > > > > Well it's the holiday season and like Tim Allen it's time for me to start > > working on my Christmas Lights. I decided this year to soften the chasing > > lights scene and to use fading in and out of different strings. While my > > Motorola MOC3010 type circuits works fine, for dimming I need to detect > > zero crossings. I plan to turn the lights one an off for whole cycles instead > > of trying to triggerfor a portion of the cycle which generates that buzzing > > sound. > > > > Enter AppNote 521 "Interfacing to AC Power Lines". Conceptually it's simple > > but I have to ask the dumb question: What's the return on the AC line? I can't > > see how connecting just the hot line of the AC power is going to get you > > anywhere and I'm damn scared to connect the neutral up anywhere near the > > microcontroller. > > We've been down this path before.. > You're best off using a transformer; you can often steal the ac input to > the bridge and diode clamp it to come up with a suitable cmos level > signal. All you need to do is overdrive the diodes enough to get fast > edges, maybe 3 to 5 times, and this works out to be the input to, say, > the 12v or 15v supply in a multi output supply. If you need a separate > transformer, you can get by with a really wee one. Well the transformer is definitely a possibility. But the Microchip engineers seemed to be real proud of the fact that the diodes on the I/O pins could be used for the purpose with just a resistor to limit current. 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... BAJ