Newsgroups: comp.robotics,sci.electronics
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!udel!gatech!howland.reston.ans.net!news.sprintlink.net!news.indirect.com!seeker
From: seeker@indirect.com (Stan Eker)
Subject: Re: AC zero crossings into microcontroller?
Message-ID: <D78sv6.KDz@indirect.com>
Sender: usenet@indirect.com (Internet Direct Admin)
Organization: Internet Direct, indirect.com
Date: Tue, 18 Apr 1995 18:04:18 GMT
References: <mark.stephens-1704951112570001@mstephens.gsfc.nasa.gov>
X-Newsreader: TIN [version 1.2 PL2]
Followup-To: comp.robotics,sci.electronics
Lines: 43
Xref: glinda.oz.cs.cmu.edu comp.robotics:19908 sci.electronics:128516

mark stephens (mark.stephens@gsfc.nasa.gov) wrote:
: I need to control a few AC power devices from a microcontroller (HC11).  I
: have working a typical triac circuit controlled by a zero crossing
: opto-isolator ( MOC3040 <-> 10K resistor <-> triac gate ).  This works
: fine for turning a device on or off from one of the HC11's ports.  

 Woops.  I blew it on the other drawing.  It won't work worth beans.

  Here's one that definately will, and is still cheap and reliable.
 It will output a brief high pulse at each zero-crossing in the hi
 uS range.  The bridge rectifier can be either one of the potted
 variety or just built out of 1N4148s.  You don't need power diodes.
 One of the little 4-pin mini-DIPs that Digi-Key sells will work OK.
 None of the values are critical - they're what I had on hand to try.

                  bridge rect.
           R1      ---------     1 --------- 5          R2
   AC ---/\/\/\----|~     +|-------|a     c|------+---/\/\/\--- +5V
         22K 1W    |       |       |       |      |     10K 
                   |       |     2 |       | 4    |_______________ output
   AC -------------|~     -|-------|k     e|---,
                   ---------       ---------   |
  for 220AC, use                   4N25       gnd
  39K 1W for R1                 or equiv.

  If you need to shift the pulse slightly earlier, just hang a 200V cap
 across R1 to shift the current into the LED in the 4N25.  Something small
 should do the trick, maybe around .01uF or so.  Also, if you need to
 stretch the pulse out, increasing R2 will get a little longer width.
 Going more than 2X probably won't do much to increase it.

  This circuit maintains 1500V+ isolation from the AC line, dependant on
 the V(iso) of the optocoupler used.  For any microprocessor/microcontroller
 type of design, I'd strongly recommend the isolation unless you like smoke.

  One thing I've seen done on a number of optocoupler designs is a slot in
 the PCB under the opto, along it's axis down the centerline, extending just
 slightly past the ends and about 1/10" wide.  I suppose the air gap has a
 higher isolation value than the epoxy-fiberglass.  If you're doing a
 production design (or need UL approval) you might want to look into it.

             Wire it up and let me know how you like it.

