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. With PIC processors you can get by with a wee transformer and gross input to the bridge because the power is going to so low. In this case the same transformer winding can perform both jobs. I use a typical poorly regulated ac wall wart for this; the 5v regulator gets between 13 and 19 volts, and the ac peaks above that. For power switching zero crossing detection this gets you plenty close enough, and you're not connected directly to that high compliance source.. --Tom Rogers