Zero crossing detector for Arduino using 4N35 optocoupler

Click For Summary
SUMMARY

The discussion centers on designing a zero crossing detector for Arduino using the 4N35 optocoupler, with input from a 6-0-6 transformer (220V to 6V step down). Participants confirm that the 4N35 can be used without rectifying the 6 VAC input, but caution against exceeding the reverse voltage specifications. The circuit aims to detect zero crossings to control a TRIAC for dimming applications, with suggestions to consider alternative optocouplers like the H11AA1 for improved performance. Key considerations include managing peak voltage and ensuring proper isolation for safety.

PREREQUISITES
  • Understanding of optocouplers, specifically 4N35 and H11AA1
  • Knowledge of AC voltage characteristics, including RMS and peak voltage
  • Familiarity with TRIACs and their operation in dimming applications
  • Basic circuit design principles for interfacing with Arduino
NEXT STEPS
  • Research the specifications and applications of the 4N35 and H11AA1 optocouplers
  • Learn about designing circuits with TRIACs for phase angle control
  • Study the effects of peak voltage on optocoupler performance
  • Explore safety measures for high-voltage circuits, including isolation techniques
USEFUL FOR

Electronics hobbyists, Arduino developers, and engineers working on AC control systems, particularly those interested in dimming applications and optocoupler integration.

Wrichik Basu
Science Advisor
Insights Author
Gold Member
Messages
2,180
Reaction score
2,690
TL;DR
Can the 4N35 optocoupler handle 6 VAC in its input, or do I need to rectify it to DC?
I am designing a zero crossing detector for Arduino using the 4N35 optocoupler. This is just a small part of a large project. I haven't bought the components yet, so do not ask me for readings. Everything is in the planning phase now.

My input will be a 6-0-6 transformer (220V to 6V step down).

I was having a look at this website where they have controlled an AC fan using an Arduino and a TRIAC. They have fed the 9 VAC output from their transformer directly to their 4N25 optocoupler:

1604828591246.png

In https://forum.allaboutcircuits.com/threads/zero-crossing-with-4n25-issue.138690/, they have first rectified the AC to DC, and then fed it to the optocoupler (don't look at the input; I will be using 6 VAC):

1604828679312.png

The above circuits use 4N25, but I believe using a 4N35 won't create any problem. Do I need to rectify the input to the 4N35, or can I directly feed it 6 VAC?
 
Engineering news on Phys.org
Well, 4N24 and 4N35 both are with low reverse voltage for this, I think.
I would keep the transformer only, but put a LED in reverse, parallel with the opto.
Or a different opto, maybe with dual LEDs on the input side (something from here, for example).

I guess you are aware that it'll detect a time range around the peaks, not the crossings?
 
  • Like
Likes   Reactions: Wrichik Basu
Rive said:
I guess you are aware that it'll detect a time range around the peaks, not the crossings?
Yes, I am aware of that. I need the time range around the peaks because I will be using that information to switch on a TRIAC for a short period of time, thereby dimming the appliance connected to the TRIAC. Similar to what has been said in the first website linked in the OP.
 
It seems that if there is a safety isolation transformer, it may not be necessary to use an optocoupler, but certainly the optocoupler can serve as a secondary fault protection.

As mentioned in response 2, please make sure that the reverse input voltage does not exceed the rated value.

Wrichik Basu said:
Do I need to rectify the input to the 4N35, or can I directly feed it 6 VAC?

The rectified waveform is very different from the original sinusoidal wave waveform, so the two corresponding output waveforms are also very different. It depends on your design and the processing power of the Arduino hardware and software.
 
Last edited:
  • Like
Likes   Reactions: Wrichik Basu
alan123hk said:
As mentioned in response 2, please make sure that the reverse input voltage does not exceed the rated value.
Yes, I will see to that. Maybe I will use a 5V transformer instead of 6V.
alan123hk said:
The rectified waveform is very different from the original sinusoidal wave waveform, so the two corresponding output waveforms are also very different.
That's what I was thinking about, and the two designs are basically not interchangeable. Thanks for the clarification.
 
Wrichik Basu said:
Maybe I will use a 5V transformer instead of 6V
You have to work with the peak voltage instead of RMS
5V is still too much if you don't limit the voltage by some other means.
 
Rive said:
You have to work with the peak voltage instead of RMS
5V is still too much if you don't limit the voltage by some other means.
Fine. Resistors are always handy in such cases.
 
Be careful, serial resistors are no good for limiting maximal reverse voltage load.
 
Rive said:
Be careful, serial resistors are no good for limiting maximal reverse voltage load.
Then how do I limit the voltage? (I can't seem to find a 5V transformer, so I have to use a 6V transformer.)
 
  • #10
The absolute maximum reverse voltage spec for the input LED is 6V. You can put in an anti-parallel diode to clamp this at about 0.7V. Read the data sheet for any IC you might use.
 
  • Like
Likes   Reactions: Wrichik Basu
  • #11
You might consider bi-directional opto-couplers like these too:
https://www.vishay.com/docs/83608/h11aa1.pdf

I think the whole HV side could be a resistor and a bidirectional coupler. If the pulse is too short you could insert back to back zeners in series with the resistor to increase the off time. Because there is always a current path, the only HV will be across the resistor.

You may find some with a darlington output which may allow you to have less power dissipation in the HV resistor. Like this: https://datasheet.octopart.com/IL755-1-Vishay-datasheet-10103.pdf
 
  • #12
DaveE said:
You might consider bi-directional opto-couplers like these too:
https://www.vishay.com/docs/83608/h11aa1.pdf
I am actually buying both types. I have to do some testing to see which one actually suits my case. My final aim is to use a triac as a dimmer — I will use a MOC3021 triac driver, and I need to detect the zero crossings because I will fire the triac driver accordingly for a dimming effect.
DaveE said:
You may find some with a darlington output which may allow you to have less power dissipation in the HV resistor.
The two websites from where I buy things don't have an optocoupler with darlington output.
 
  • #13
Wrichik Basu said:
The two websites from where I buy things don't have an optocoupler with darlington output.
Not even 4N33 et. al.? I thought those were everywhere. You could use two in parallel for full wave.
 
  • #14
DaveE said:
Not even 4N33 et. al.? I thought those were everywhere. You could use two in parallel for full wave.
4N35 is available, and it's already in my cart. H11AA1 is also available.
 
  • #15
The following snippet is from a 4N35 Vishay Datasheet (https://www.vishay.com/docs/81181/4n35.pdf)

1607017336798.png


Note that 6Vac is an rms value. The peak voltage would be at 6√2 = 8.485 Vpk. Note that we are talking of ac voltage, and based on your schematic:

https://www.physicsforums.com/attachments/273618

you will be subjecting your 4N35 to 16.97Vpk-pk. I suggest you put a bridge rectifier circuit at transformer secondary to limit the voltage to 8.485Vpk, and further lower the secondary peak voltage to less than 5V by doing a resistive voltage divider. The good news is that even with these modifications, the integrity of your pulse output is not compromised. it will still fire at the zero crossing.

P.S. i implemented a similar circuit to this in my college days for a friend.
 
  • Like
Likes   Reactions: Wrichik Basu
  • #16
maxwells_demon said:
Note that 6Vac is an rms value.
No! It is an instantaneous value. You won't see RMS voltage spec on a diode (maybe on a diode circuit, or application). RMS is only useful for AC signals and specifying an AC voltage limit on a diode is, at best, confusing. In any case the issue is damage to the PN junction which can happen very quickly.
 
  • #17
DaveE said:
No! It is an instantaneous value. You won't see RMS voltage spec on a diode (maybe on a diode circuit, or application). RMS is only useful for AC signals and specifying an AC voltage limit on a diode is, at best, confusing. In any case the issue is damage to the PN junction which can happen very quickly.

I meant 6Vac as the output of the transformer in the OP's schematic.

1607026857229.png


though now that i read it more carefully, OP did say:
Wrichik Basu said:
My input will be a 6-0-6 transformer (220V to 6V step down).

so it's basically a transformer with two secondary windings, only one of which would be connected to 4N35. So scrap what i said about 16.97V pk-pk. Though it still is 6Vac, and therefore 8.485V pk-pk.
 

Attachments

  • 1607026910343.png
    1607026910343.png
    19.4 KB · Views: 284
  • #18
Scrap the bridge rectifier, but the voltage divider is still necessary to bring that 8.485Vpk-pk down to 5Vpk-pk.
 
  • Like
Likes   Reactions: Wrichik Basu
  • #19
maxwells_demon said:
I meant 6Vac as the output of the transformer in the OP's schematic.
Yes, I see that now. Sorry, I misunderstood you! That was covered pretty thoroughly earlier in the thread.
 
  • #20
I am actually thinking of switching to H11AA1 instead of 4N35. My circuit is not yet complete, but am I correct in saying that the H11AA1 will detect a time around the crossing rather than the peaks?
 
  • #21
Wrichik Basu said:
I am actually thinking of switching to H11AA1 instead of 4N35. My circuit is not yet complete, but am I correct in saying that the H11AA1 will detect a time around the crossing rather than the peaks?
Either will work, it's just that the programming will be slightly different.

The 4N35 will be 'On' whenever the voltage is above about +1 Volt.
The H11AA1 will be 'On' when the voltage is above about 1 Volt of either polarity.

That's about 7 to 10 degrees from zero crossing.

For the 4N35 the coding would be:
Detect a change of input
If changed from 'Off' to 'On', a positive going Zero crossing just occurred
If changed from 'On' to 'Off', a negative going Zero crossing is about to occur

For the H11AA1:
If is 'OFF' you are within 10 degrees of a Zero crossing in either direction

Cheers,
Tom
 
  • Like
  • Informative
Likes   Reactions: Wrichik Basu and sysprog
  • #22
Have you thought of using a MOC3041 zero crossing opto triac?
 
  • #23
MalcolmB said:
Have you thought of using a MOC3041 zero crossing opto triac?
I'm not sure this would help much. IIRC, he wants to make a phase angle dimmer circuit and needs zero crossing information to know when to turn on a thyristor, which will then self commutate at the zero crossing.
 
  • Like
Likes   Reactions: Wrichik Basu
  • #24
DaveE said:
I'm not sure this would help much. IIRC, he wants to make a phase angle dimmer circuit and needs zero crossing information to know when to turn on a thyristor, which will then self commutate at the zero crossing.
Exactly, you are right. 👍
 

Similar threads

Replies
7
Views
2K
Replies
4
Views
3K
Replies
5
Views
2K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 63 ·
3
Replies
63
Views
8K
  • · Replies 38 ·
2
Replies
38
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K