Searching \ for '[PIC]: zero crossing idea, comments?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/microchip/devices.htm?key=pic
Search entire site for: 'zero crossing idea, comments?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: zero crossing idea, comments?'
2003\12\09@170611 by Eisermann, Phil [Ridg/CO]

flavicon
face
       I have the following idea to detect zero-crossing on an AC line
reasonably close. Looking for comments/feedback on any other ideas that
might be implemented.

       110V input throught two 10K resistors in series an H11AA814A
optocoupler. collector of optocoupler pulled to 5V via a 22k resistor.
collector fed into GP2 a 12F629. the PIC is running on interal clock. GP is
configured as an external interrupt, so it should be a ST. I expect the
pulse length to vary between devices due to variations in current transfer
ratio of the opto. To get a better reading of the actual zero crossing
point, I would measure the typical pulse length before the application does
anything. Half of the pulse length should get me pretty close to the true
zero crossing point.

       The application will remain in service maybe 10 to 20 minutes before
it is powered down. would the oscillator frequency remain stable enough
during this point, or am I making this too complicated? It is for phase
control, and I will always be switching "very soon" after the zero-crossing
point; I do not need a large control range.

       Thanks for any feedback

Phil Eisermann
Electronics Engineer
The Ridge Tool Company
(440)329-4680


--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\12\09@181517 by llile

flavicon
face
I would recommend sensing zero crossings every time:

1.  You;ve already spent the money to sense them, it costs no parts to
sense them again.

2. Your first measurement might be a noise hit, why be wrong twice?

3. You can get fancy and gate your measurements after the first, if the
zero crossing is not at the right time, it is spurious.  this is probably
overkill.

4. You really really can sense zero crossings with a 2meg resistor to the
PIC pin.  Unless you have regulatory requirements for isolation (being
Ridge Tool CO I assume you do) this is very simple.   But the questions
is, would the 2meg resistor provide enough isolation?  Or two 1meg
resistors, for redundant safety? I've done this and had success with it.
Mchip has an app note on the technique. resistors must be rated for 120V
service, 0805's don't have enough creepage distance.  I used 1/4 watt
resistors to maintain plenty of creepage.

5. It is easy to filter a 2meg resistor, a small ceramic cap in parallel
makes a nice low pass filter that eliminates noise hits.  Put the pole of
the filter at about 300 Hz and it will kill off all that noise from your
motor brushes without generating too much phase shift.


BTW, where is Ridge Tool Co Located?

-- Lawrence Lile





"Eisermann, Phil [Ridg/CO]" <spam_OUTpeisermaTakeThisOuTspamRIDGID.COM>
Sent by: pic microcontroller discussion list <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU>
12/09/2003 04:03 PM
Please respond to pic microcontroller discussion list


       To:     PICLISTspamKILLspamMITVMA.MIT.EDU
       cc:
       Subject:        [PIC]: zero crossing idea, comments?


       I have the following idea to detect zero-crossing on an AC line
reasonably close. Looking for comments/feedback on any other ideas that
might be implemented.

       110V input throught two 10K resistors in series an H11AA814A
optocoupler. collector of optocoupler pulled to 5V via a 22k resistor.
collector fed into GP2 a 12F629. the PIC is running on interal clock. GP
is
configured as an external interrupt, so it should be a ST. I expect the
pulse length to vary between devices due to variations in current transfer
ratio of the opto. To get a better reading of the actual zero crossing
point, I would measure the typical pulse length before the application
does
anything. Half of the pulse length should get me pretty close to the true
zero crossing point.

       The application will remain in service maybe 10 to 20 minutes
before
it is powered down. would the oscillator frequency remain stable enough
during this point, or am I making this too complicated? It is for phase
control, and I will always be switching "very soon" after the
zero-crossing
point; I do not need a large control range.

       Thanks for any feedback

Phil Eisermann
Electronics Engineer
The Ridge Tool Company
(440)329-4680


--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics



--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\12\09@185151 by Tom Deutschman

flavicon
face
> 4. You really really can sense zero crossings with a 2meg
> resistor to the PIC pin.  Unless you have regulatory
> requirements for isolation (being
> Ridge Tool CO I assume you do) this is very simple.   But the
> questions
> is, would the 2meg resistor provide enough isolation?  Or two
> 1meg resistors, for redundant safety? I've done this and had
> success with it. Mchip has an app note on the technique.
> resistors must be rated for 120V service, 0805's don't have
> enough creepage distance.  I used 1/4 watt resistors to
> maintain plenty of creepage.
>
> 5. It is easy to filter a 2meg resistor, a small ceramic cap
> in parallel makes a nice low pass filter that eliminates
> noise hits.  Put the pole of the filter at about 300 Hz and
> it will kill off all that noise from your motor brushes
> without generating too much phase shift.

The app note is here:

http://www.microchip.com/download/appnote/devspec/16c5x/00521c.pdf

Also note the following from the app note::

----
The user needs to be aware that the circuit required to connect the
T0CKI input to an AC power line is slightly different than the other I/O
pins. Each of the I/O pins has two diodes for input protection whereas
the T0CKI pin has only one protection diode connected to Vss (Figure 3).
Therefore, it is necessary to connect a diode externally between the
T0CKI pin and VDD in order to clamp the voltage on the T0CKI pin to VDD
+0.6V (approximately). See Figure 4. It is also recommended that
resistor R be at least 2M ohm.
----


Tom Deutschman

Wizbang Designs, Inc.
1629 W 8TH AVE
Spokane, WA  99204

Phone: (509) 251-4814
http://www.wizbangdesigns.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\12\09@191023 by Harold Hallikainen

face picon face
In a product I designed, I used the full-wave rectified transformer
secondary driving a PIC pin through a current limit resistor. This worked
great with the 16C74 and 18C452. However, when I moved to the 18F452, it
stopped working. It apparently does not like even current limited
over-voltage on a pin. I finally added a transistor and drove the base of
it with the current limited full wave rectified AC. The collector then
pulls down the PIC pin.

Harold


{Quote hidden}

--
FCC Rules Online at http://www.hallikainen.com/FccRules/

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\12\09@193136 by Tom Deutschman

flavicon
face
>
> In a product I designed, I used the full-wave rectified
> transformer secondary driving a PIC pin through a current
> limit resistor. This worked great with the 16C74 and 18C452.
> However, when I moved to the 18F452, it stopped working. It
> apparently does not like even current limited over-voltage on
> a pin. I finally added a transistor and drove the base of it
> with the current limited full wave rectified AC. The
> collector then pulls down the PIC pin.
>
> Harold

I have T0CKI connected through a 2.2M resistor to the AC side of a
bridge (24VAC source) with a diode to VCC. Increments timer 0 at a 30Hz
rate. Since I'm using the internal RC oscillator, I use this to keep
real time. The first time I power up the product, it calibrates itself
to the power line, storing a constant in EEPROM. The constant is used
when AC power is lost and I need to keep reasonably accurate time until
the AC is restored (running off of backup 9VDC battery). Not great over
temperature but ok for this application.

Schematic at http://www.wizbangdesigns.com/images/Timer2B.PDF

Tom Deutschman

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\12\09@194056 by Tom Deutschman

flavicon
face
Oh, also have a program time option to set for 50Hz power :-)

Tom

{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\12\09@194058 by Harold Hallikainen

face picon face
The fact that you're using RA4 probably helps, since it's an open
collector output and does not include a clamp diode to Vcc, so you get no
on-chip clamp diode current (which seems to mess up the F chips but not
the C chips). I was using RB0 and generating an interrupt on a negative
edge, just prior to zero cross. I've now inserted the transistor and doing
an interrupt on a positive edge, still just before zero cross. I use the
capture compare register to figure out when to turn on a triac. I also do
a 50/60 Hz check on power up, then use different tables to figure out what
to use in the capture compare register. I'm detecting every zero cross
since I'm using full wave rectification.

Do you really have a 30 Hz line?

Harold

{Quote hidden}

FCC Rules Online at http://www.hallikainen.com/FccRules/

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\12\09@201451 by Tom Deutschman

flavicon
face
>
> Do you really have a 30 Hz line?
>
> Harold

No, it is a 60Hz line. All references I've made to 30Hz should be 60Hz.
But, now I'm confused, must have been late at night when I wrote this
part of the code. When timer0 overflows, I reload it with a count of 226
decimal. Keeps perfect time.

Tom

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\12\09@202114 by Tom Deutschman

flavicon
face
> >
> > Do you really have a 30 Hz line?
> >
> > Harold
>
> No, it is a 60Hz line. All references I've made to 30Hz
> should be 60Hz. But, now I'm confused, must have been late at
> night when I wrote this part of the code. When timer0
> overflows, I reload it with a count of 226 decimal. Keeps
> perfect time.
>

OK, I have the timer0 prescaler set. Too many late nights...

Tom

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\12\09@204021 by Russell McMahon

face
flavicon
face
> > In a product I designed, I used the full-wave rectified
> > transformer secondary driving a PIC pin through a current
> > limit resistor. This worked great with the 16C74 and 18C452.
> > However, when I moved to the 18F452, it stopped working. It
> > apparently does not like even current limited over-voltage on
> > a pin.

I'd be interested in knowing the original value of the current limiting
resistor that did work and the voltage of the transformer secondary?

I imagine that you tried increasing the resistor value to see if it would
work.
If so, how high did it go and still not work for you?

Unfortunately you can never tell how far out of spec you can get away with.
The same result could just as well have occurred with a die change to the
16C74 or 18C452.


       Russell McMahon

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\12\10@034400 by

picon face
Eisermann, Phil [Ridg/CO] wrote :

> 110V input throught two 10K resistors in series an H11AA814A
> optocoupler. collector of optocoupler pulled to 5V via a 22k resistor.

Or use the "weak pullup" and save a resistor...

> collector fed into GP2 a 12F629. the PIC is running on
> interal clock. GP is configured as an external interrupt,
> so it should be a ST. I expect the pulse length to vary between
> devices due to variations in current transfer ratio of the opto.
> To get a better reading of the actual zero crossing point, I would
> measure the typical pulse length before the application does
> anything. Half of the pulse length should get me pretty close
> to the true zero crossing point.

So you'd detect the start of the zero-crossing, and then wait for
half of the the former calculated zero-crossing width ? Seem OK.

Note that you can flip the INTEDG on each interrupt to capture
*both* edges using interrupts.

>
> The application will remain in service maybe 10 to 20
> minutes before it is powered down. would the oscillator frequency
> remain stable enough during this point,

Stable enough for what ?
Are you thinking on "free wheeling" during this 10-20 min period
without further zero-crossing detection ?

> or am I making this too complicated? It is
> for phase control, and I will always be switching "very soon"
> after the zero-crossing point;

What are you switching ? And what is "very soon" ?

For a Triac, you must at least wait until there is enough current
to hold the Triac conducting.

> I do not need a large control range.

What is "a large range" ? Or rather, what is "not a large range" ?

Jan-Erik.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\12\10@093558 by Eisermann, Phil [Ridg/CO]

flavicon
face
llile@saltonusa.com wrote:
> I would recommend sensing zero crossings every time:
>
> 1.  You;ve already spent the money to sense them, it costs no parts
> to sense them again.
>

yes, that is my intent.

> 2. Your first measurement might be a noise hit, why be wrong twice?
>

I would average the readings over several cycles. say 32 or 64

> 3. You can get fancy and gate your measurements after the first, if
> the zero crossing is not at the right time, it is spurious.  this is
> probably overkill.

That's a good idea. Will have to see if it becomes necessary.

{Quote hidden}

yes, PICREF-4. I started on that path, figuring that would make a
good starting point. However, this project actually has two PICs in
it, so it is easier in this case to put the phase control on the
isolated side. And we do have mandatory regulatory requirements.

regardless of whether Mchip has published this app note, it's out
of spec. You're relying on the protection diodes to clamp the
voltage, and that means they are conducting. I agree if you limit
the current enough, it will probably work most of the time. But
i don't get paid to design products that probably work most of
the time :)

>
> BTW, where is Ridge Tool Co Located?

We are worldwide, but headquartered in Elyria, OH. About 20 min
west of Cleveland.

Thanks for the feedback everyone.

Phil Eisermann
Electronics Engineer
The Ridge Tool Company
(440)329-4680

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\12\10@095439 by Eisermann, Phil [Ridg/CO]

flavicon
face
pic microcontroller discussion list wrote:
> Eisermann, Phil [Ridg/CO] wrote :
>
>> collector of optocoupler pulled to 5V via a 22k
>> resistor.
>
> Or use the "weak pullup" and save a resistor...
>

that's a thought.

{Quote hidden}

that's what I had in mind, actually. I would set INT to trigger
on the rising edge. when the interrupt occurs, start TMR0. Flip
INTEDG to trigger on falling edge. the next interrupt stop TMR0.
half of TMR0 should be pretty close to the actual zero crossing.

The problem I'm trying to address is that the interrupt pulse
generated by the opto will start before the actual zero crossing
and end after the zero crossing. the above described technique
should allow me to determine how long after the interrupt the
true zero crossing occurs.

I hope I explained that correctly.

>>
>> The application will remain in service maybe 10 to 20
>> minutes before it is powered down. would the oscillator frequency
>> remain stable enough during this point,
>
> Stable enough for what ?
> Are you thinking on "free wheeling" during this 10-20 min period
> without further zero-crossing detection ?

No, i would still detect the zero crossing. But I would not
re-calculate the length of the pulse. I would think the internal
oscillator would not drift enough in this application to deviate
more than a few usec.

> For a Triac, you must at least wait until there is enough current to
> hold the Triac conducting.
>
>> I do not need a large control range.
>
> What is "a large range" ? Or rather, what is "not a large range" ?
>

Well, that still needs to be fine-tuned, but initial calculations
indicate a conduction angle range between 120 and 180 degrees. That
means worst-case I would be firing 60 degrees from zero crossing.

Phil Eisermann
Electronics Engineer
The Ridge Tool Company
(440)329-4680

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\12\10@101104 by

picon face
Eisermann, Phil [Ridg/CO] wrote:

> > Are you thinking on "free wheeling" during this 10-20 min period
> > without further zero-crossing detection ?
>
> No, i would still detect the zero crossing. But I would not
> re-calculate the length of the pulse. I would think the internal
> oscillator would not drift enough in this application to deviate
> more than a few usec.

Well, "a few usec" is a very short time when talking about 50/60 Hz
AC. After "a few usec" I'm not sure there are enough voltage/current
to keep a Triac conducting. Anyway, we still don't know *what* you
are triggering :-)

And the intosc will more probably "jitter" in the sort run, and
maybe drift (depanding on the temp, this should be mounted
outside, right ?) in the longer run. But in 10-20 minutes, the
temp drift will maybe not be that large.


> Well, that still needs to be fine-tuned, but initial calculations
> indicate a conduction angle range between 120 and 180 degrees. That
> means worst-case I would be firing 60 degrees from zero crossing.

60 deg *before* z-c, not ?
Or 120 deg *after* z-c ?
The 120-180 deg range are the *last* 60 deg of one half-cycle ?

Or did I missunderstand this ?

Anyway, "a few usec" is still very little in this regard.

Jan-Erik.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\12\10@104714 by Eisermann, Phil [Ridg/CO]

flavicon
face
Jan-Erik wrote:
>
> Anyway, we still don't know *what* you
> are triggering :-)
>

I'm using an alternistor to trigger a transformer. The transformer
supplies the voltage to a 3-phase brushless motor. In normal mode
of operation, the alternistor is on for the full 180 degrees. The
phase angle is adjusted under certain conditions to reduce the motor
voltage. Main purpose is to limit the current to prevent the motor
from burning out. The motor draws 10A@36V under full load. Using linear
control on the secondary side would require significant heat sinking.

Yes, there are other (perhaps better) ways to do this. I am taking
over an existing design, and many design decisions were based on
product cost. Sound familiar? A buck on the secondary side was
considered, but cost analysis showed it was cheaper to use
phase control.

>> Well, that still needs to be fine-tuned, but initial calculations
>> indicate a conduction angle range between 120 and 180 degrees. That
>> means worst-case I would be firing 60 degrees from zero crossing.
>
> 60 deg *before* z-c, not ?
> Or 120 deg *after* z-c ?
> The 120-180 deg range are the *last* 60 deg of one half-cycle ?
>

I mean 60 degrees *after* zero crossing. That would give me a
conduction angle of 120 degrees. I will be firing anywhere from
continuously (180 degrees) to 60 degrees after zero crossing.

Phil Eisermann
Electronics Engineer
The Ridge Tool Company
(440)329-4680

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\12\10@105744 by Josh Koffman

flavicon
face
I'm not an engineer, but don't you have to be careful about phase
controlling a transformer?

Josh
--
A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete
fools.
       -Douglas Adams

"Eisermann, Phil [Ridg/CO]" wrote:
> I'm using an alternistor to trigger a transformer.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\12\10@110333 by Eisermann, Phil [Ridg/CO]

flavicon
face
pic microcontroller discussion list wrote:
> I'm not an engineer, but don't you have to be careful about phase
> controlling a transformer?
>

yes, you do. It's not quite like dimming a light bulb :)

Phil Eisermann
Electronics Engineer
The Ridge Tool Company
(440)329-4680

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\12\10@111409 by llile

flavicon
face
I actually did a gated zero cross design, out of necessity.  It was in a
system that generated lots and lots of noise, so false hits were common. I
would wait for a zero cross, then time the next zero cross, and if it was
"half of 60Hz" later, then it was a valid zero crossing.  We were firing a
relay that had to open, switch, and bounce all within a half cycle.  To
get it to work it had to be energized a few hundred microseconds before a
zero crossing.  There was a long list of reasons why Triacs could not be
used, too involved for this discussion.

You are also going to fight noise.  Get ready for:

Ground planes under your PIC
decoupling caps on your MCLR line
Get rid of those 1n4004 freewheeling diodes on your coils and replace them
with a faster, lower Vf schottky.
You may even need to use a RESISTOR as a freewheeling diode.  It actually
does a good job believe it or not.
0.1uf+10ohm snubber across various coils, power inputs, and so on
Separate digital and power grounds joined at one point
ferrites in your power supply leg (not in your ground leg)
AND
wierd problems that happen once in a blue moon and can't be replicated
easily but give you ulcers at midnight.

The system I was working on used all the above tricks, plus some software
tricks as well.  It was designed to fail safe in various ways, designed so
the unit would shut off in a safe way if it never detected a zero cross
due to hardware failures, had some feedback mechanisms in some of the I/O
to determine if they were working properly.  WDT of course was there, and
if a reboot was due to a WDT it would shut down safely.  You can even add
a sanity check periodically - set several registers to a value on startup,
later if those registers have changed, your PIC is not sane and should be
shut off.   Finally, in unprogrammed memory locations the default is to
execute instructions that eventually loop around to zero.  If these can be
set to "GOTO $" or some other opcode that is harmless and triggers a
watchdog, then if the PIC is out in the weed patch executing those
instructions it will shut down safely.

Agreed that 2meg resistors are out due to leakage hazards.  Having been
nearly shocked to death by a handheld tool, I am all for safety systems
that work every time, not most of the time.


-- Lawrence Lile





"Eisermann, Phil [Ridg/CO]" <.....peisermaKILLspamspam.....RIDGID.COM>
Sent by: pic microcontroller discussion list <EraseMEPICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU>
12/10/2003 08:34 AM
Please respond to pic microcontroller discussion list


       To:     PICLISTspamspam_OUTMITVMA.MIT.EDU
       cc:
       Subject:        Re: [PIC]: zero crossing idea, comments?


@spam@llileKILLspamspamsaltonusa.com wrote:
> I would recommend sensing zero crossings every time:
>
> 1.  You;ve already spent the money to sense them, it costs no parts
> to sense them again.
>

yes, that is my intent.

> 2. Your first measurement might be a noise hit, why be wrong twice?
>

I would average the readings over several cycles. say 32 or 64

> 3. You can get fancy and gate your measurements after the first, if
> the zero crossing is not at the right time, it is spurious.  this is
> probably overkill.

That's a good idea. Will have to see if it becomes necessary.

{Quote hidden}

yes, PICREF-4. I started on that path, figuring that would make a
good starting point. However, this project actually has two PICs in
it, so it is easier in this case to put the phase control on the
isolated side. And we do have mandatory regulatory requirements.

regardless of whether Mchip has published this app note, it's out
of spec. You're relying on the protection diodes to clamp the
voltage, and that means they are conducting. I agree if you limit
the current enough, it will probably work most of the time. But
i don't get paid to design products that probably work most of
the time :)

>
> BTW, where is Ridge Tool Co Located?

We are worldwide, but headquartered in Elyria, OH. About 20 min
west of Cleveland.

Thanks for the feedback everyone.

Phil Eisermann
Electronics Engineer
The Ridge Tool Company
(440)329-4680

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.



--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\12\10@135814 by M. Adam Davis

flavicon
face
I've used that very successfully, but my design used two optos, anti
parallel on the diode side and parallel on the transister side.  This
way I got 120 pulses.  I didn't worry about noise - it wasn't something
I ran into, and if I got a bad zero cross it didn't have more than a 1/2
cycle delay before getting a correct timing, and I've yet to see a lamp
filament that can react that fast.

There are other methods to zero cross.  The only other isolated method
I'm aware of is using the output of the transformer that's powering the
PIC.  I suspect a simple op-amp or at most comparator circuit would give
you the exact zero crossing.

For my application I calculated the time the LED would turn off in the
opto, and found it reasonably close to later measurements.  This way I
knew when the zero cross would occur before it actually occured, and I
ignored the trailing edge.  This could be made automatic, as you
suggest.  If you'd like the same capability with knowledge beforehand,
you can time it each time, and apply it to the next zero cross.

Good luck!

-Adam

Eisermann, Phil [Ridg/CO] wrote:

{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\12\10@143515 by Bob Axtell
face picon face
While the idea of direct triac drive is appealing- and yes, I've tried it
once- in practice it is safer and more treliable to drive an optoSSR or
optoTRIAC with built-in zero-crossing features.

General notes: In motor drives, use an MOV or Transorber (something FAST)
to absorb inductive spikes. On driving 110/220 to a PIC pin, two+ resistors
in SERIES is much better than a single resistor, unless the resistors and
their creepage path is plastic coated. I like two 1M 1/4w rather than a
single 2M 1/2w. A small cap at the PIC pin will be needed to prevent
lightning or static from damaging the PIC (100pF seems OK).

--Bob

At 09:13 AM 12/10/2003, you wrote:
{Quote hidden}

--------------
Bob Axtell
PIC Hardware & Firmware Dev
Tucson, AZ
1-520-219-2363
"I lose some on each sale but make it up in volume."

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\12\10@171805 by Jinx

face picon face
> 110V input throught two 10K resistors in series an H11AA814A
> optocoupler. collector of optocoupler pulled to 5V via a 22k resistor.
> collector fed into GP2 a 12F629. the PIC is running on interal clock

I use something similar, works fine

http://home.clear.net.nz/pages/joecolquitt/txless.html

In your actual application you'll need to quantify when the PIC
reacts to the zero-cross pulse (ie when the z-c pulse passes
through the transition voltages to cause a "1" or "0"). This would
be most easily done with a dual trace scope. z-c pulse on one
channel, PIC reaction pulse on the other

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...