## zero cross Optocoupler

15 posts / 0 new
Author
Message

Im making a simple triac lamp dimmer using an ATtiny. I need some help understanding these AC Input Phototransistor Output Optocouplers! Im looking at some from fairchild: http://www.fairchildsemi.com/sit...

I believe I understand the concept of properly biasing the optocoupler, correct me if im wrong please: You select a current limiting resistor that that works in the range of the specs and indicates a cross as close to the real zero cross as possible.

Taking the H11AA1-M for example:
If max is 60mA. When dealing with US mains you have a max of 172V, which we will safety factor to 190V. So I will pick a current limiting resistor for the emitter to keep current below 60mA, in this case a 3.1k resistor. What I don't understand is how to determine from the spec sheet at what current the emitter essentially shuts off, giving me my zero crossing signal. With a 3.1k resistor at 31 volts the current is 10mA.

Another thing that im not sure about is for 190v at 60mA that's 11.4W of power. That's a damn big resistor.

You don't gno-me!

Yes. Use a capacitor instead ;) It will shift the phase, but you can adjust for that in software.

The Dark Boxes are coming.

as in, just a cap between the mains hot and the AVR?

You don't gno-me!

Nope. You will use a capacitor instead of the humongous resistor. Check this out:

http://en.wikipedia.org/wiki/Cap...

In an AC circuit a capacitor has reactance, which is similar to DC resistance. You may use a relatively small capacitor instead of the resistor of huge wattage because a capactior will not dissipate any energy. Mind the voltage rating though.

The Dark Boxes are coming.

ohnooooooooo FFTs

You don't gno-me!

You donâ€™t need to run the LEDs in the opto at maximum intensity. The part you are interested in is when the mains cross zero and the back to back LEDâ€™s in the opto turn off. The resistor(s) need to be large enough to keep the LEDâ€™s in the opto outputting enough light to register on the phototransistor when the mains is not at the zero point.

The H11AA1 works great as a zero crossing detector. Try using two 6.8K ohm resistors (1/2 watt) on pins 1 and 2 of the opto. (in series with the line voltage) Then put something like a 1nF cap across pins 1 and 2 to keep noise down on the LEDs.

Matt

matt6ft9 wrote:
The resistor(s) need to be large enough to keep the LEDâ€™s in the opto outputting enough light to register on the phototransistor when the mains is not at the zero point.

Where/how would/do you determine this value? I dont see any min specification on the spec sheet.

As for using a cap instead of a resistor:
Using the reactance formula I THINK i calcualted a .82ÂµF cap would give me a reactance of 3.23k at 60Hz. Does that seem right?

Would a SMD ceramic like this work all rite?

You don't gno-me!

matt6ft9 wrote:
The H11AA1 works great as a zero crossing detector. Try using two 6.8K ohm resistors (1/2 watt) on pins 1 and 2 of the opto. (in series with the line voltage) Then put something like a 1nF cap across pins 1 and 2 to keep noise down on the LEDs.

Matt

wouldn't you still have to dissipate 5watts though each resistor if you did that?

You don't gno-me!

It says 250V and you have 110V mains so it should be all right? Dunno, I never used SMD ceramics with high voltages. When I played with this I used some regular film capacitor.

The Dark Boxes are coming.

If you're using an optocoupler I can assume you're using a transformer for the low voltage side. If this is the case, why not pick the ac signal of the low voltage side of the transformer?

As for the two 6k8 resistors in series - 110VRMS / 13600 = 8mA approx and 0.88W. Divide the power by two and you get 0.44W per resistor.

I am not using any transformers. Im using an off the shelf SMPS.

I thought he meant the resistors in parallel in series with the line.

You don't gno-me!

Quote:
because a capactior will not dissipate any energy

Ideal capacitors maybe, but real world ones do :)

Ok, but not nearly as much as a resistor.

The Dark Boxes are coming.