AC zero-crossing circuit idea (LM339 hints?)
Jose Da Silva email (remove spam text)
On Sunday 24 October 2004 01:29 pm, Steve Willoughby wrote:
> Thanks to all who offered suggestions for the AC zero-crossing
> detector. I will experiment some with a couple of the ideas presented
> here and see how it all goes. I'm intrigued by one idea someone
> pointed me to, which is just to connect the PIC's interrupt pin
> directly to the 120V AC line without transformer, isolator, or
> NEU <--------3 || E-----|Rect. |----> +
> 120V AC 3 || E |Bridge |
> HOT <----*---3 || E-----|_______|----> GND
> | ______________
> +-------/\/\/\/------| RB0/INT |
> 5M | |
> | PIC16F777 |
I missed reading some of the other postings, but That isn't going to work.
According to the diagram above, you have your circuitry isolated behind a
transformer. The PIC pin has to be in "reference" to something, and
according to that diagram, you only have one pin going out to the main
120vac side. If the GND on your circuit doesn't connect to the NEU on the
120v side, you don't have a reference, if it does, then you have a
reference, but you also have the potential to electrocute someone if someone
plugs the circuit in backwards to the 120v side (exposing your GND to HOT!).
> Now, color me paranoid, but this makes me a little nervous :)
For safety's sake, put all your circuitry behind the safety of the
transformer unless you really know what you are doing!!!
Use an opto-isolator to get your zero crossing signal and put your opto-input
on the 120vac side if you want to get your crossing directly from the AC.
Yes it will, but it won't take care of a lightning spike.
The other thing is that the PIC is running on HOT lines, so the entire
circuit must be isolated from any external GND, CHASSIS, etc or you must be
200% sure that your circuit is never plugged in where the HOT is plugged
into the NEU and the NEU into the HOT.
If you connect to an external GND of any sort, you have a problem, including
something as simple as a metal chassis and you standing in a puddle of water
to complete the circuit.
> Has anyone else done this? Is there perhaps a more refined version of
> this circuit which would be better, or ought this to be adequate as
> drawn above?
If you want to be on the safe side by keeping everything behind the
transformer. Monitor the 5v to 0v transistion, when that happens, add a
delay XuSec for your zero crossing because with an 8v transformer, the 5v to
zero volt transistion happens significantly early. Since you are dealing
with a full-wave bridge, you could probably try something like this:
NEU <-3 || E--|Rect. |--+--|>|--> +
120V AC 3 || E |Bridge | |
HOT <-3 || E--|_______|----------> GND
+----| RB0/INT |
| | |
100k Z | PIC16F777 |
You can do the math to figure out what the delay XuSec is needed, or if you
are not willing to do the math, then you can experiment to find the zero
Hopefully that helps you keep it safe ;-)
In reply to: <Pine.BSF.firstname.lastname@example.org>
See also: www.piclist.com/techref/power.htm?key=ac
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the