using zero crossing optocoupler as zero cross detector

Thread Starter

mtalent

Joined Oct 2, 2017
30
I got that built pretty easy now so how do incorporate r3????

Edit -----

Just read your post, I don't see how it being active high or active low should present a problem. as long as I program it right.

BTW my guy gave me a variable 10K resistor to use to pull pin 5 on 4n35 up and he says I can use it to bring the voltage down to 3v which I need for my mcu input pin. I'll let you know how that works too

thanks

Mark
 

Thread Starter

mtalent

Joined Oct 2, 2017
30
I am thinking running R3 in parallel between dc+ and dc- coming from bridge...?????

edit --------

I am running R3 between the two corners where I have negative negative and positive positive in the square.

edit ----- edit ------

nope blew a diode out a business until this afternoon I think r3 needed to between d2 and d4 and I thin I had it between d1 and d3

Darn
 
Last edited:

philba

Joined Aug 17, 2017
959
Even though this circuit has more components than the typical brute force "drive the opto directly" approach, I really like it. It gives you a symmetrical pulse around ZC (based on the forward drop of D5, I think) and avoids the larger wattage resistors of the brute force approach.

Mark, you don't need a variable resistor on the collector, just a fixed pullup to your Vcc (R5 as shown, 10K is ok, too) but check to see if your processor has builtin pullups - you may not need the resistor at all.
Here's an excellent ZCD circuit that I've been using for years:



And here's the designer's page, with a full explanation on how the circuit works.
 

cmartinez

Joined Jan 17, 2007
8,253
I think r3 needed to between d2 and d4 and I thin I had it between d1 and d3
That doesn't matter, you've just described the same thing in both cases. What matters are nodes. The anodes of D4 and D3 are connected together with one side of of R3, and the cathodes of D1 and D2 to the other side of R3. You could think of R3 as also connected to the positive side of C1 and to the cathode of D5.
 

cmartinez

Joined Jan 17, 2007
8,253
It gives you a symmetrical pulse around ZC (based on the forward drop of D5, I think) and avoids the larger wattage resistors of the brute force approach.
Yes, it pulls down the output before the input voltage has reached zero. That comes in handy when precision triggering is a must. It also has excellent repeatability, and it's virtually unaffected by temperature changes.
 

cmartinez

Joined Jan 17, 2007
8,253
I am thinking running R3 in parallel between dc+ and dc- coming from bridge...?????

edit --------

I am running R3 between the two corners where I have negative negative and positive positive in the square.

edit ----- edit ------

nope blew a diode out a business until this afternoon I think r3 needed to between d2 and d4 and I thin I had it between d1 and d3

Darn
Post a pic of the way you've breadboarded things... maybe we can help you find what's wrong with it.
 

philba

Joined Aug 17, 2017
959
I built an LT sim for that circuit but the 4N25 model that came with LTSpice got sim errors. (It looks different from the one you used.) I used an LED and it didn't have a low enough Vf (3V vs 1.3V) so it wasn't getting enough current. Played with the R values a bit to see how they relate to each other. One thing that did come out was that the ZC pulse isn't quite symmetrical around the zero-cross (but it's not bad). More importantly, the pulse precedes the crossing by about 400 uS, plenty of time to do lots of things in software including very precise phase control.

I assume the split supplies and R6 are just artifacts to make the simulation work.
 

cmartinez

Joined Jan 17, 2007
8,253
I assume the split supplies and R6 are just artifacts to make the simulation work.
Yes they are. In fact, the split supplies simulate a 220 VAC RMS standard input, and R6 is there to provide a very high impedance ground reference to said input. Without it, the sim will crash.
 

philba

Joined Aug 17, 2017
959
Yes they are. In fact, the split supplies simulate a 220 VAC RMS standard input, and R6 is there to provide a very high impedance ground reference to said input. Without it, the sim will crash.
Maybe that was my problem with the 4N25 model. I also used 120 VAC which contributed to the lower If problem.
 

cmartinez

Joined Jan 17, 2007
8,253
Maybe that was my problem with the 4N25 model. I also used 120 VAC which contributed to the lower If problem.
The value of R4 can be made much lower, even down to 100 ohms, to allow more current into the optocoupler. With 1k, only about 2.4 mA reach the 4N25. And if you use 100 ohms, almost 8 mA will flow through it. Which I find more appropriate. But 2.4 mA are more than enough to trigger other types of optos. Such as the SFH620A, which I've been using for years.
 

SHARANYADAS

Joined Apr 13, 2017
60
Here's an excellent ZCD circuit that I've been using for years:



And here's the designer's page, with a full explanation on how the circuit works.
I know that this thread is a bit old.But i want to ask one thing...
I am using this ZCD circuit for a couple of months & it is working correctly.I made it in DIP version.Now,i have to shrink the PCB so I have to use SMD packages.The main question is,If I use a 10uF/10v Tantalum cap instead of Electrolytic,Will it work?The main reason behind asking is,I was going through the Tantalum cap's datasheet & I found that the ESR is pretty high for those Tantalum caps.Should that be a problem regarding working perspective of this circuit?
 

cmartinez

Joined Jan 17, 2007
8,253
I know that this thread is a bit old.But i want to ask one thing...
I am using this ZCD circuit for a couple of months & it is working correctly.I made it in DIP version.Now,i have to shrink the PCB so I have to use SMD packages.The main question is,If I use a 10uF/10v Tantalum cap instead of Electrolytic,Will it work?The main reason behind asking is,I was going through the Tantalum cap's datasheet & I found that the ESR is pretty high for those Tantalum caps.Should that be a problem regarding working perspective of this circuit?
The tantalum cap should work just fine ... it's overkill, if you ask me, because it's more expensive than an electrolytic, but there should be absolutely no difference in the circuit's performance.

I've attached the LTspice sim file of the circuit, if you want to play with it and find out for yourself:

upload_2018-5-10_14-43-25.png
Edit: I've run the simulation using a 10V, 10uF tantalum cap, and it's running just as expected. :)
 

Attachments

SHARANYADAS

Joined Apr 13, 2017
60
The tantalum cap should work just fine ... it's overkill, if you ask me, because it's more expensive than an electrolytic, but there should be absolutely no difference in the circuit's performance.

I've attached the LTspice sim file of the circuit, if you want to play with it and find out for yourself:

Edit: I've run the simulation using a 10V, 10uF tantalum cap, and it's running just as expected. :)
Thanks a lot for your reply...Basically I was going through Mouser website & saw that the ESR of these caps are pretty high.That's why I asked!Although Tantalum polyner caps have low ESR.I have to build 5 of this circuit.That's why,I had to be sure cause there is no room for errors regarding the final PCB.
I will choose a cap for final design & give you the link tomorrow.Please take a look & give your feedback!!
 

cmartinez

Joined Jan 17, 2007
8,253
Please take a look & give your feedback!!
Sure will... I'll take a look at your chosen cap, and then I'll sim it for you, see how it performs. I've already performed the sim using a value 0f 0.55 Ω ESR for the cap (instead of the original 0.055 Ω) and it's running with virtually no changes in behavior.
 

SHARANYADAS

Joined Apr 13, 2017
60
Sure will... I'll take a look at your chosen cap, and then I'll sim it for you, see how it performs. I've already performed the sim using a value 0f 0.55 Ω ESR for the cap (instead of the original 0.055 Ω) and it's running with virtually no changes in behavior.
Sorry for being a little bit late.Basically there are so many Tantalum caps at mouser & i am literally confused,Although,i have chosen a cap(depending on the price) & i am providing the link below.Please take a look if it can perform in this circuit!!

1) Link
2) Link
 
Last edited:

cmartinez

Joined Jan 17, 2007
8,253
Sorry for being a little bit late.Basically there are so many Tantalum caps at mouser & i am literally confused,Although,i have chosen a cap(depending on the price) & i am providing the link below.Please take a look if it can perform in this circuit!!

Link
I've run the sim using an ESR of 2.9 ohms, as your cap's datasheet states, and also using values of 8 and 12 µF (which correspond to the 20% tolerance given to the tantalum capacitor) and the results were exactly the same. The circuit's performance is completely unaffected by this change.

Also, I've just remembered that I have already built this circuit using an SMT tantalum cap, which is installed inside a router motor that is subject to intense vibration, and the circuit has been running flawlessly since 2012.

So feel free to go ahead and build your circuit, it should work just fine with the cap you've chosen.
 
Top