zero cross Optocoupler

Go To Last Post
15 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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

The Dark Boxes are coming.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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

You don't gno-me!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ohnooooooooo FFTs

You don't gno-me!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
because a capactior will not dissipate any energy

Ideal capacitors maybe, but real world ones do :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, but not nearly as much as a resistor.

The Dark Boxes are coming.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Like Matt says, optos can operate low led currents. Think of the device as being similar to a transistor. There is a certain amount of current gain from the led through the photo-transistor. At a "lower" led current, your maximum collector current will be lower as well. With an appropriate value collector pull up resistor, it will work fine. At 120 volts, even 20k or more, will still give you plenty of led current to work with.

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Attached is a schematic. I used the 4N25 schematic symbol instead of the H11AA1. (I got lazy) Try using a higher value of 1/2 watt resistors, if you want.

Attachment(s):