Thats a good circuit Don, but i'd also use a 47E resistor in series with the 0.1 uf cap.
Anand
Thats a good circuit Don, but i'd also use a 47E resistor in series with the 0.1 uf cap.
Anand
I guess I wasn't very clear . . .
I don't need a transformerless power supply for the PIC circuit and associated glue; I was looking just for a transformerless zero-crossing detector.
Russ
N0EVC, xWB6ONT, xWN6ONT
"Easy to use" is easy to say.
Hi,
You can also use a NPN inverter from the rectified DC for sharper (inverted zero cross).
Last edited by sougata; - 11th August 2009 at 08:39. Reason: If you use a transformer this could be handy
Regards
Sougata
Recently ive been using this idea. That page describes how to run an LED from the mains but with just the capacitor and resistor you can run an AC input darlington opto. Ive been using this method for detecting the presence of AC but it should work fine to detecting a zero crossing too.
I always use an opto for safety. I did try a huge resistor feeding directly into the PIC which seemed to work fine till i connected the PIC to my laptop through serial and the laptop turned itself off.
My prefered method is to use the 12V coming from the supply transformer. If you can use a transformer for the supply then you only need 2 extra diodes and a resistor to feed into the PIC.
As for the code, i dont like using oninterrupt but i do use the interrupt flags. The program doesnt have to check the interrupt after each command that way. It checks it when you want.
Last edited by sougata; - 11th August 2009 at 15:00. Reason: Found out later
Regards
Sougata
For ZC, the resistor is adequate given the PIC has clamp diodes on the inputs. If you need mains isolation for RS232, use optos in the RS232 lines.
Bookmarks