1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Phase lock loop question

Discussion in 'General Electronics Chat' started by boro3, Nov 26, 2017.

  1. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,370
    Likes:
    974
    Location:
    Loveland, CO USA
    ONLINE
    This is why we can't help.

    Here we have 110VAC 50 or 60hz. Not 100hz. Not 5V.
    The output is 0 or 5v to go to the computer.
    upload_2017-12-2_10-5-3.png
    I can build a circuit that works like this but you will get a (+)edge at one crossing and a (-)edge at the other.

    This next circuit will give you a 200nS pulse (interrupt) at any zero crossing.
    upload_2017-12-2_10-12-49.png
    Now about phase:
    In software you will need to measure the frequency. (you need to know 50 or 60hz) Depends on where you live.
    Because you get two pulses/cycle then you really will get numbers like 100 or 120 hz.
    10mS or 8.3mS
    I do not know what you want to do and you are not going to say.....but
    I will pretend you want to turn on a SCR like a lamp dimmer.
    Measure from one pulse to another = 10 (8.3mS).
    If you want the lamp at 1/2 power them after the interrupt, delay 5mS (4.15ms) and turn on the SCR.
    This is how you set the phase. (measure time)
     
  2. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,370
    Likes:
    974
    Location:
    Loveland, CO USA
    ONLINE
    From MicroChip application note AN236:
    upload_2017-12-2_10-34-6.png
    From this you will get a square wave at 50/60hz. You will need to respond to each edge. (or be cleaver)
    This will be slightly off from "zero". It will detect 4V and 1V not zero volts. But out of 120 volts that error is probably OK.
     

Share This Page