Electronics > Projects, Designs, and Technical Stuff
Isolated mains zero crossing detector: how?
<< < (3/5) > >>
TJ232:

--- Quote from: Hero999 on November 02, 2018, 10:38:40 am ---All that's needed is a standard opto-coupler and diode in reverse parallel with the emitter. The zero crossing point will be on the rising and falling edge of the opto-coupler's output.

Another option is to power the MCU from an old fashioned transformer and linear regulator and monitor the voltage on the transformer's primary using a comparator.

--- End quote ---

That's exactly how an AC opto looks, see also AC waveform crossing below, 2xFREQ for an AC OPTO:


TJ232:

--- Quote from: technix on November 02, 2018, 07:46:16 am ---
--- Quote from: TJ232 on November 02, 2018, 05:56:06 am ---Don't complicate your life, just use an AC opto like SFH620

Details about ZCD implementation, schematic & stuff HERE and HERE.

--- End quote ---
Why is a DC opto + some R and D complicated? Also there would be no way for my MCU to find out the accurate phase for the mains.

What I need is to find out when mains crosses zero and tell that to a MCU.

--- End quote ---

From a lot of reasons, from BOM to the fact that maybe you want to detect ALL the zero crossing of the AC wave.
If you look at the links above you will find 2 solutions for your request.

Are you using it to drive a triac for light or heating  dimming ?

technix:

--- Quote from: TJ232 on November 02, 2018, 11:07:51 am ---That's exactly how an AC opto looks, see also AC waveform crossing below, 2xFREQ for an AC OPTO:



--- End quote ---
I can NOT tell if the mains is going positive or going negative for the specific pulse with an AC optocoupler. Given the TRIAC type, this information can be important.


--- Quote from: TJ232 on November 02, 2018, 11:21:12 am ---From a lot of reasons, from BOM to the fact that maybe you want to detect ALL the zero crossing of the AC wave.
If you look at the links above you will find 2 solutions for your request.

--- End quote ---
For the BOM it does not differ much. And I am lot losing out on edges even if I am using a traditional DC type one: a positive going edge is 0 degrees phase, and a negative going edge is 180 degrees. Now feed that into an MCU timer and I can get a pretty good idea where the mains phase is at for any given moment.


--- Quote from: TJ232 on November 02, 2018, 11:21:12 am ---Are you using it to drive a triac for light or heating  dimming ?

--- End quote ---
Not determined yet, likely lighting first.
TJ232:

--- Quote from: technix on November 02, 2018, 11:45:43 am ---
--- Quote from: TJ232 on November 02, 2018, 11:07:51 am ---That's exactly how an AC opto looks, see also AC waveform crossing below, 2xFREQ for an AC OPTO:



--- End quote ---
I can NOT tell if the mains is going positive or going negative for the specific pulse with an AC optocoupler. Given the TRIAC type, this information can be important.


--- Quote from: TJ232 on November 02, 2018, 11:21:12 am ---From a lot of reasons, from BOM to the fact that maybe you want to detect ALL the zero crossing of the AC wave.
If you look at the links above you will find 2 solutions for your request.

--- End quote ---
For the BOM it does not differ much. And I am lot losing out on edges even if I am using a traditional DC type one: a positive going edge is 0 degrees phase, and a negative going edge is 180 degrees. Now feed that into an MCU timer and I can get a pretty good idea where the mains phase is at for any given moment.


--- Quote from: TJ232 on November 02, 2018, 11:21:12 am ---Are you using it to drive a triac for light or heating  dimming ?

--- End quote ---
Not determined yet, likely lighting first.

--- End quote ---

What TRIAC  are we talking about?
For Heating you want to look at a PSM Mode implementation, not Phase-cut dimming. Because of AC lines load, EMI & stuff.
Zero999:

--- Quote from: TJ232 on November 02, 2018, 11:07:51 am ---
--- Quote from: Hero999 on November 02, 2018, 10:38:40 am ---All that's needed is a standard opto-coupler and diode in reverse parallel with the emitter. The zero crossing point will be on the rising and falling edge of the opto-coupler's output.

Another option is to power the MCU from an old fashioned transformer and linear regulator and monitor the voltage on the transformer's primary using a comparator.

--- End quote ---

That's exactly how an AC opto looks, see also AC waveform crossing below, 2xFREQ for an AC OPTO:




--- End quote ---
No it isn't. My description relates to the DC opto-coupler, on the right of that schematic, which can easily be used to detect AC zero crossing, just by looking at the rising/falling edge of the output pulse.


--- Quote from: technix on November 02, 2018, 11:45:43 am ---I can NOT tell if the mains is going positive or going negative for the specific pulse with an AC optocoupler. Given the TRIAC type, this information can be important.
--- End quote ---
Then use an ordinary DC opto-coupler with an anti-parallel diode, as I mentioned above. The positive and negative transitions of the mains can be determined by looking at the rising and falling edge of the output from the opto-coupler.

The only issue with using it to trigger a TRIAC is the negative edge of the pulse will occur when the mains voltage is still slightly positive, but that can be easily overcome by delaying the firing for a bit to ensure the TRIAC is triggered when the AC has reversed.
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod