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. > > Can anyone clarify? > > BAJ BYRON if your running your lights from 220/110 volts and your control box is plastic with no exposed metal parts, and if you feel comfortable developing the system then there is no reason not to use a direct connection to the mains you can use a resistor, cap or both to drop your voltage from the mains voltage to power the pic with no transformer I would only condone this method if the circuit is totaly isolated (no exposed metal parts) preferably no user controls or switches and designed so that Live/Neutral reversal would not present a problem A .1mF cap at 50 hz has an approx resistance of 31k at 220V gives 7mA .47mF = 6k7 32mA 1mF = 3k1 69mA At 60Hz the resistance would be lower and curent less -------20megOhms(220V, 110V 5meg)------------ I/O pin pic | ~ac-----O---||----------O---diode----O----7805----O-------+5V pic | | | 22v Zener diode elec cap elec cap | | | ~ac--------------------0-------------O------------0--------0V pic PS. The Zener does two jobs -- Peter Cousens email: peter@cousens.her.forthnet.gr snailmail: Peter Cousens, karteros, Heraklion, Crete, 75100, Greece, phone: + 3081 380534, +3081 324450 voice/fax After Bill Gates announced to the world that he was Microsoft, his wife was asked to comment. She said that as his wife, she had been the first to notice this problem