Zero-crossing detector?


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ardhuru View Post
    Personally, I find the software easier to write if I have positive going transitions for each half-cycle. But to achieve this, you'd need to use an opto with 2 diodes in anti-parallel. I find the PC814 ideal for this.
    Thanks for the suggestion! I had thought about using a garden-variety opto and getting half the cycle, but your idea is definitely better.

    It looks as if, using the PC814, I could maintain isolation from the mains. If the output goes to a Schmitt trigger input on the PIC, that should do very nicely.

    How do you factor the opto's diode drop (Vf) into the timing? I think I saw something about this in an article or app note but can't find it now.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  2. #2


    Did you find this post helpful? Yes | No

    Default opto

    I like to use isolation, cheap and reliable with ac opto coupler. AC opto gives + and - cycle detection with 1, 4-pin device and 2 resisters. can get pos or neg pulse at zero Xing.

    don
    amgen
    Attached Images Attached Images  
    Last edited by amgen; - 10th August 2009 at 02:40.

  3. #3
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    Thanks, Don.

    I placed a parts order earlier this evening, so I included a dozen of the PC814s.

    Russ
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  4. #4
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by RussMartin View Post
    It looks as if, using the PC814, I could maintain isolation from the mains. If the output goes to a Schmitt trigger input on the PIC, that should do very nicely.
    Remember, since you want a transformerless supply, using an opto is still not going to give you mains isolation. BE CAREFUL!

    Regards,

    Anand

  5. #5


    Did you find this post helpful? Yes | No

    Default transformerless

    you are right, with no transformer, any part of your circuit could be 100 to 200 volts to ground since you can never be sure if the wall plug/receptacle is reversed, (a shock hazard). But that won't matter if no parts of your circuit are exposed to touch.
    I made a nice simple Xformer-less supply for push button pic/fan timer that picks up a 10amp relay. Has worked well over a long time.

    don
    amgen
    Attached Images Attached Images  

  6. #6
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Thats a good circuit Don, but i'd also use a 47E resistor in series with the 0.1 uf cap.

    Anand

  7. #7
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    I guess I wasn't very clear . . .

    I don't need a transformerless power supply for the PIC circuit and associated glue; I was looking just for a transformerless zero-crossing detector.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  8. #8
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Simple but works

    Hi,

    You can also use a NPN inverter from the rectified DC for sharper (inverted zero cross).
    Attached Images Attached Images  
    Last edited by sougata; - 11th August 2009 at 08:39. Reason: If you use a transformer this could be handy
    Regards

    Sougata

  9. #9
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Recently ive been using this idea. That page describes how to run an LED from the mains but with just the capacitor and resistor you can run an AC input darlington opto. Ive been using this method for detecting the presence of AC but it should work fine to detecting a zero crossing too.

    I always use an opto for safety. I did try a huge resistor feeding directly into the PIC which seemed to work fine till i connected the PIC to my laptop through serial and the laptop turned itself off.

    My prefered method is to use the 12V coming from the supply transformer. If you can use a transformer for the supply then you only need 2 extra diodes and a resistor to feed into the PIC.

    As for the code, i dont like using oninterrupt but i do use the interrupt flags. The program doesnt have to check the interrupt after each command that way. It checks it when you want.

Similar Threads

  1. Replies: 6
    Last Post: - 10th September 2008, 10:04
  2. Crossing Page Boundary - Solution
    By Darrel Taylor in forum FAQ - Frequently Asked Questions
    Replies: 1
    Last Post: - 24th November 2007, 02:52
  3. IR detector
    By geckogrotto in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 30th August 2006, 03:16
  4. Crossing Page Boundary .....
    By turkuaz in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 20th March 2006, 07:57
  5. error on compiling
    By parker in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 16th June 2005, 14:31

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts