1
\$\begingroup\$

I have a optocoupler PS817 that I plan to use for a zero-crossing detection circuit for mains 230 V AC.

enter image description here

But I do not know how to size the resistance of R1 and R2 mainly because: I do not know what is the optimal value of the current that the LED of the optocoupler needs to be. Which value is it at the datasheet i should use (I mean it should be there right?). The absolute maximum is 50 mA, so at least that narrows it down. I’m leaning on using 20 mA but that number is just pure instinct and not really based on anything.

Another problem which complicates things for me is, the resistor is placed before the full-bridge rectifier. I would assume its placed there over the DC side is for safety(?) as it immediatly limits the current of anything downstream. In this scenario how would the resistance be calculated (and power rating) of the resistor. The bridge rectifier part number is: KBL608

\$\endgroup\$
3
  • \$\begingroup\$ Do you want to detect a zero crossing of the mains voltage? You need a very different circuit with an analog comparator to detect the event when the mains voltage is changing from negative to positive voltage. Your circuit may be used to detect if there is mains voltage at the input or not. \$\endgroup\$ Commented Aug 1, 2024 at 22:44
  • \$\begingroup\$ @Uwe ahh think that is not true, this has already been done, there are modules for this that uses this exact configuration (may use different part number) but the concept is the same. \$\endgroup\$ Commented Aug 1, 2024 at 22:54
  • \$\begingroup\$ Have a look at these ti.com/lit/pdf/sbaa542 ti.com/lit/pdf/snoa999 hackatronic.com/… To detect the real time zero-crossing you need a circuit with a comparator. Look at the diagram with the waveforms at input and output. \$\endgroup\$ Commented Aug 17, 2024 at 14:13

1 Answer 1

2
\$\begingroup\$

The minimum is determined by leakage (dark) current, and response time.

Also, you may want a resistor across the LED, so that 1. it turns off in the short instant where voltage goes to zero, including due to rectification into diode capacitance (consider noise/RF effect), and 2. effectively raising Vf so that it's non-conducting for longer during the zero crossing.

With this information, you should have a better idea how to go about completing the design.

Some drawbacks:

  • Datasheets don't always give complete data on frequency response / time delay and operating conditions. OptoSupply PS817 for instance specifies response at Ic = 2mA, for various RL (thus the switching times are also just swinging that much more voltage, i.e. up to 2mA * 10kΩ = 20V, but we don't care about that for a 3.3V/5V/etc. system). What's the response for say 1mA? Or 0.1mA? Or 10mA?
  • CTR needs to be factored in, of course. It has a manufacturing spread, and also decreases over time (as the LED wears).
  • Dark current is specified at max. 100nA, but it increases exponentially with temperature; at 100°C, it might be 10s, 100s of µA.
  • Going for minimum current, leaves high impedance nodes that are more susceptible to interference as well. Some (DM) filtering on the input and output may be desirable, but perhaps shielding, CM filtering, etc. as well. How much attenuation is required, is hard to know from principles: it depends on how the opto itself responds to RF, how it's wired, PCB layout and assembly wiring, etc.

Several of these can at least be tested in the lab (mock up the circuit and test it at whatever parameters are required), though you do lose the design certainty of guaranteed datasheet values. EMC is the hardest, as design/proto labs don't usually have the hardware available to do it (i.e. RF generators and amplifiers, coupling networks, antennas, etc.).

If design assurance is top priority, consider industrial building blocks such as mains detectors. I'm aware of Contact Closure DC Input Modules | Grayhill which are basically fancy optos in a potted module, though I don't know offhand if any exist that respond fast enough to read zero-crossings (heh, after all, frequent drops in the output would be a rather annoying "feature" for a relay interface like that!). All the same, zero-cross is a very simple application, sometimes requiring nothing more than a large resistor; depending on isolation or surge requirements, perhaps such an option is available to you as well.

\$\endgroup\$
1
  • \$\begingroup\$ Only a proof-of concept work, i do not plan to do an ultra-reliable design. With only what i have, what would be the resistance value of R1 and R2 ? \$\endgroup\$ Commented Aug 1, 2024 at 17:08

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.