Mains voltage zero crossing detector with optical isolated output

Feb 15, 2012 482 Replies

if the signal goes to a micro, accurately detecting zero doesn't seem so important, as long as the delay is repeatable it is easily compensated in software

the totem-pole is cute, but I think I'd wire the outputs as open collector OR, that way everything is symmetric with regards to the input and using rising or falling edge can give you a leading or lagging trigger

-Lasse

-Lasse

Right, that makes two dumb mistakes. And using a pullup adds complications.

On many LM339's, including the National original, pulling any input more than 0.3 volts below ground will spray charge all over the chip and mess up all the sections. Very weird things happen.

See the Natiional datasheet, footnote 3. I'm shocked that a self-proclaimed Master Circuit Designer would screw up things this badly.

"Sprays charge"?? Are you really that ignorant?

"Note 3: This input current will only exist when the voltage at any of the input leads is driven negative. It is due to the collector-base junction of the input PNP transistors becoming forward biased and thereby acting as input diode clamps. In addition to this diode action, there is also lateral NPN parasitic transistor action on the IC chip. This transistor action can cause the output voltages of the comparators to go to the V+ voltage level (or to ground for a large overdrive) for the time duration that an input is driven negative. This is not destructive and normal output states will re-establish when the input voltage, which was negative, again returns to a value greater than -0.3 VDC (at 25°)C."

The 0.3V is a cover-your-ass specification.

Are you really that ignorant? Yes you are. ...Jim Thompson

| James E.Thompson, CTO | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

You've posted pics of the interior. I wouldn't go in there if you paid me.

You really can't count on doing that unless you have some means of calibration. Withoug a lot of gain the uncertainly window is too large.

Is that the best slur you can manage? You're seriously mentally ill and should seek treatment. ...Jim Thompson

| James E.Thompson, CTO | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

I've seen it happen, got bit by this *before* I noticed the note on the datasheet. In the original National linear databook, the footnote was microscopic type on ratty paper, practically invisible. A 1N4148 is absolutely not adequate to make your circuit safe. Are you willing to design stuff that violates clear warnings like this, by about 2:1 or so? That's really scary. Hell, we even discussed this bug here before. Sloppy, sloppy work.

But it's academic, since an LM339 won't work in your circuit at all.

What comparator did you use in the sim? Something "behavorial" probably.

=A0 =A0...Jim Thompson

Just replace the diodes with Schottky's- that ought to be more than safe.

Maybe not. It takes a surprisingly small voltage and current to mess up the National version. Why take the risk?

But a 339 won't work in that circuit anyhow.

Hey, you're big on parts values. What value of pullup?

So your inattention to detail is National's fault? A poor workman blames his tools.

Got anything quantitative instead of your usual pretense at sagacity?

On a sunny day (Sat, 18 Feb 2012 15:32:47 -0700) it happened Jim Thompson wrote in :

Googling "BILLIONTH chip shipped" gives: Cypress. Don't think Nvidia is your game. Day before yesterday I watched Alien versus Predator 2, and it reminded me of Thompson vsLarkin. But I though, not a good analogy. But then the gov nuked the city with the aliens in the end (great shot), to prevent them spreading. In fact the only good shot in the whole movie :-) So then I was thinking of what Obanana is doing to you guys, and yes, maybe the analogy holds ;-) :-)

Do your customers read your quarrels? You work for mil? Now there is a .... hehe LOL

Yes, John "Sick Puppy" Larkin certainly is. ...Jim Thompson

| James E.Thompson, CTO | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

The data sheet says to not go below -0.3. That's not good enough for you? Thompson is clamping it with a 1N4148, around twice the voltage that National footnote 3 recommends.

Sound pretty risky to me. I only had this problem once, about 25 years ago, and what I remember is that a silicon diode was not enough to keep the comparator from getting goofy.

Hey, try it yourself and report back.

Thompson't inattention to detail - he screwed up twice here - is certainly his own fault.

In simulation?

Do you have the National schematic, or someone elses'?

Another hack to a bad circuit.

and haul-ass drive that input below ground (be

Going to change that circuit yet again? Go for it.

Insane. National's note is a warning about going negative more than

0.3 below ground. There's a parasitic current path. This current, on one input, can mess up *all four* outputs on the original National part.

But you haven't fixed the open-collector blunder. What value of pullup resistor have you chosen? You won't answer that.

What comparator did you use in the zcd circuit simulation? You won't answer that either.

Flail, flail, flail! You just have to keep on demonstrating your ignorance, you poor sick mentally-ill puppy. ...Jim Thompson

| James E.Thompson, CTO | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required