Zero Crossing Circuit Explanation (Need Explanation)! URGENT!

Status
Not open for further replies.
Here is a simple ZC circuit with verbose explanation:
**broken link removed**
 

It is a simple bridge rectifier, it converts the AC cycles into one polarity so both positive half-cycles and negative half-cycles are made positive. That leaves two possible output states, one is there is a voltage, the other is there isn't a voltage. A voltage will be there at any time except when the cycle is at the point where it changes polarity so the absence of voltage can be used to indicate the zero crossing point.

In that schematic, the input resistors are to limit the current that can flow into the opto-coupler LED to keep it at safe levels, the bridge rectifier ensures the AC cycles are all the same polarity so they can light the LED inside the opto-coupler. So the opto-coupler LED is lit at all times exept zero crossing point. The sensor side of the opto-coupler picks up the light and if any is present it makes it's output transistor conduct. That in turn shorts out the bias current through Q1 and turns it off. So Q1 collector voltage goes high at zero crossing.

Brian.
 

Your explanation is good. What is the purpose of the 5V current power source and the LED (near the 5v) in the circuit? the resistors of R6 and R7 acts as pull up resistor? "A negative pulse signal is output at the detection port through the phase inversion function of the transistor Q1. " is my statement correct? feel free to point out my mistake.

Is there any formula to set the value of the resistances in the circuit?

"Because of the sine wave first goes through double phased rectification, the zero-crossing signal is given regardless whether the sinus wave foes up through zero or down through zero."

Make any sense as well?
 
Last edited by a moderator:

"Because of the sine wave first goes through double phased rectification, the zero-crossing signal is given regardless whether the sinus wave foes up through zero or down through zero."
That is correct. The LED inside the opto-coupler will only light when current flows through it in one direction so it is essential to rectify the AC first to ensure the polarity is correct regardless of whether the AC is really on a positive or negative half cycle.

The 5V is necessary so it can produce the voltage needed by the Arduino. Normally the transistor is held in a conducting state, the current through R6 is enough to bias the transistor so it is almost if not fully conducting "in saturation" so it's collector voltage will be low because the transistor is effectively shortning it to ground. When the opto-coupler LED lights up, it makes the transistor on it's sensor side conduct and the voltage across pins 4 and 5 drops very low, in fact low enough that Q1 no longer has enough base current to keep it conducting. When Q1 stops conducting, there is no voltage drop across R7 (unles some is flowing out of the circuit) so it's collector voltage rises to 5V.

There is no exact formula to calculate the resistances. R7 value depends on how much current flows out of the circuit, if more is needed the value has to be lower. R6 has to be low enough to ensure Q1 has enough base current to be made fully conductive but not so low that it exceeds the limit of the opto-coupler. The values are not critical and I would guess the person who originally produced the circuit just used values they had available to them.

Brian.
 

I attached my result got after simulating my circuit. Is the result correct? When the input voltage cross zero, the LED turns off. that's why no more current passing through. So the current is dropped to zero.
 

Attachments

  • result.jpg
    147.4 KB · Views: 105

You have not stated what the two lines are but yes, it looks like I would expect.

You should note that there will always be some inaccuracy in this kind of circuit, usually not enough to cause any problems though. The inaccuracy is due to the LED not lighting until it has about 1.5V across it and the amount of light it has to produce to operate the sensor transistor. It means it will detect zero from a short time before the actual crossing point and a short while after it where the AC voltage is too low to operate the LED. For most applications it should be OK.

Brian.
 

The pink color link is the input voltage of 230V while the blue color line is the current of the LED in optoisolator (cathode). thank you guys for the explanation.
 

How to calculate all of the resistors value in the circuit?
 

R1,R2,R3 and R4 are to limit the current through the optocoupler LED. The current needs to be high enough to illuminate the LED so the sensor can see it but not so high that it exceeds the LED maximum current rating. As the voltage varies from 0V to about 1.4 times the AC RMS voltage there is no fixed value that gives optimum current. A compromise has to be met, more current means smaller zero crossing time window, less current means lower heat dissipation in the resistors. The data sheet for the opto-coupler will give it's current ratings, it's up to you to find a resistance that fits the requirement best. Note that all four resistors are in parallel so each should be four times the resistance you want. You can replace them with a single resistor, or or parallel combinations as long as you observe their power ratings.

R5 is just to limit the current to the DC supply indicator, use (5-Vf)/ILed to find it's value where Vf is the forward voltage drop of the LED and ILed is the current you want to flow through it.

R6 is to provide bias current to Q1, the value is low enough to ensure Q1 is fully saturated (lowest possible collector to emitter voltage). When the optocoupler LED is lit, the current is diverted through the optcoupler transistor to ground so the Q1 becomes non-conducting. The base current (Ib) is Ic/Hfe but as you want to force it to saturation, a rule of thumb is to increase it by 10 times. The resistor is 5/Ib so you would use 10*(5/Ib) in this circuit.

R7 has to supply enough current to pull the Arduino input to logic high level. I'm not sure what current an Arduino input needs but I would guess it is very small. It also sets IC in Q1 so it has an effect on the value chosen for R6.

Brian.
 

Hello thank you for your good reply. Can help me to see if my explanation is correct?

For opto-coupler H11A1, there is always a maximum forward input current IF(max). The IF(max) of H11A1 is 60mA. During design, the input current, IF must be less than the maximum forward input current. It can be calculated using the following formula:
IF(max)=V_rms/(R1|(|R2| )|R3||R4)=60mA
When V_rms=230V,R1|(|R2| )|R3||R4=25kΩ, the input current is:
IF=230/25k=9.2mA <60mA
R5 is a pull-up resistor with a value of 10 kΩ. It is a good value for pull-up resistor. Unless you have unusual requirements, like battery operation where low power is important, 10 kΩ is a good tradeoff between low enough to pull the line solidly high against leakage and reasonable noise, but not so low as to require too much current. When the opto-coupler U1 conducts, the voltage across R5 is 5V, the collector of the transistor shows a low electrical level (logic 0). However, when the opto-coupler U1 is not conducted, the voltage across R5 is 0V, the collector transistor shows a high electrical level (logic 1).
When the output transistor in the opto-coupler turns on, it will pull at most 5 V accross R5. 5 V / 10 kΩ = 500 µA, which is the minimum current the transistor must be able to sink.
The larger the resistance for the pull-up, the slower the pin is to respond to voltage changes. If you have a fast changing signal (like USB), a high value pull-up resistor can limit the speed at which the pin can reliably change state. Thus, 5.6 kΩ resistor is chosen on USB signal lines.
From the datasheet, the maximum forward current of LED is 30mA. The supply voltage to the LED is 5V. In this case, we must put a resistor across the LED so that there is voltage drop across the LED to prevent it from blown out. We choose 470Ω in this case. From Ohm’s Law, R=5/470=10mA<30mA. It is generally accepted.




 

When V_rms=230V,R1|(|R2| )|R3||R4=25kΩ, the input current is: IF=230/25k=9.2mA <60mA
Is almost right, the current is derived from the AC line supply so it isn't a constant. The peak current is drawn when the AC voltage is at it's peak which is SQRT(2)*RMS so is bigger than the value calculated from the RMS figure.

On the schematic, R5 is the current limiting resistor for the power indicator LED. I think you mean R6.

You have the switching the wrong way around - the transistor inside the opto-coupler has a low saturation voltage, lower than the 0.7V or so needed to make Q1 conduct. So when the opto-coupler turns on, it shorts Q1 bias to ground and makes it turn off, that makes the collector voltage go high because no current is drawn through R7.

The resistor (R5) is in series with the LED, not across it. The calculation isn't right either, the voltage across the resistor is 5V minus the voltage across the LED which is typically about 1.6V for a red indicator LED. So the resistor passes (5 - 1.6)/470 = 7.23mA.

Brian.
 



thank you for your explanation clearly, for this triggering circuit. could you please share with me how is the calculation for each component? i would like to compare with my idea. do you have any idea where to connect my AC load? where should be my output? for capacitor, can i replace it with non-polarised one?





- - - Updated - - -


"You have the switching the wrong way around - the transistor inside the opto-coupler has a low saturation voltage, lower than the 0.7V or so needed to make Q1 conduct. So when the opto-coupler turns on, it shorts Q1 bias to ground and makes it turn off, that makes the collector voltage go high because no current is drawn through R7."

Did you mean R5 instead of R7 in the circuit? R7 is the resistor in series with the LED.

"When the opto-coupler U1 conducts, the voltage across 10k is 5V, the collector of the transistor shows a low electrical level (logic 0). However, when the opto-coupler U1 is not conducted, the voltage across 10k is 0V, the collector transistor shows a high electrical level (logic 1).
When the output transistor in the opto-coupler turns on, it will pull at most 5 V accross R5. 5 V / 10 kΩ = 500 µA, which is the minimum current the transistor must be able to sink.
The larger the resistance for the pull-up, the slower the pin is to respond to voltage changes. If you have a fast changing signal (like USB), a high value pull-up resistor can limit the speed at which the pin can reliably change state. Thus, 5.6 kΩ resistor is chosen on USB signal lines. "

Is this one make sense?

To clear the confusion, R5=10k, R6=5.6k, R7=470. I would just use value when mentioning.
 

It would be better to say:
"When the opto-coupler U1 conducts it diverts the current flowing through R6 to ground so the bias is removed from Q1 and it stops conducting. Because no current then flows through Q1, it's collector voltage is pulled up to 5V by R7"

The schematic you show as 1.jpg is nonsense, do not build it, it will not work and it will damage the opto-coupler and probably the transistor too.
Instead use the schematic shown in the MOC3063 data sheet which is correct and uses fewer components! You can connect the transistor collector to the opto-coupler instead of the logic gate shown.

Brian.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…