+ Post New Thread
Results 1 to 10 of 10
  1. #1
    Full Member level 2
    Points: 916, Level: 6
    M.Rehan's Avatar
    Join Date
    Feb 2016
    Posts
    129
    Helped
    33 / 33
    Points
    916
    Level
    6

    AC current direction Measuring circuit

    Any Circuit diagram to measure direction of AC current using PIC microcontroller (18Family) ?
    i.e,

    If direction of current changes the output of circuit should be changed from (high to low) OR (low to high)

    Thanks

  2. #2
    Super Moderator
    Points: 73,950, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,997
    Helped
    3418 / 3418
    Points
    73,950
    Level
    66

    Re: AC current direction Measuring circuit

    Hi,

    With AC the current changes twice per period.
    With a 50 Hz it is 50 times per second in one direction and 50 times per second in the other direction.

    If you want to see this you could use a comparator, one input to GND, the other to the current signal.
    But what signal do you expect when there is no current?
    What direction should it show.
    And at what threshold should it recognize the presence of current?

    Maybe you should give more informations.

    Klaus



    •   AltAdvertisment

        
       

  3. #3
    Full Member level 2
    Points: 916, Level: 6
    M.Rehan's Avatar
    Join Date
    Feb 2016
    Posts
    129
    Helped
    33 / 33
    Points
    916
    Level
    6

    Re: AC current direction Measuring circuit

    I mean the direction of power flow

    i.e current is flowing from grid to inverter OR inverter to grid



  4. #4
    Super Moderator
    Points: 73,950, Level: 66
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,997
    Helped
    3418 / 3418
    Points
    73,950
    Level
    66

    Re: AC current direction Measuring circuit

    Hi,

    A comparator for voltage. This signal controls a analog mux as controlled rectifer for current signal.
    Filter the mux output. If signal is positive, then power is in one direction, if negative, then power is in opposite direction.

    Klaus



  5. #5
    Full Member level 2
    Points: 916, Level: 6
    M.Rehan's Avatar
    Join Date
    Feb 2016
    Posts
    129
    Helped
    33 / 33
    Points
    916
    Level
    6

    Re: AC current direction Measuring circuit

    Can you explain with circuit diagram and calculations?



  6. #6
    Advanced Member level 5
    Points: 16,186, Level: 30

    Join Date
    Nov 2012
    Posts
    2,968
    Helped
    717 / 717
    Points
    16,186
    Level
    30

    Re: AC current direction Measuring circuit

    If direction of current changes the output of circuit should be changed from (high to low) OR (low to high)
    In AC, the direction of current changes twice per cycle. The voltage changes in the same fashion (if you pass the current through a resistor.

    Select a suitable resistor so that you will get a voltage drop of 1-3V. You feed this voltage to a comparator IC. The other end of the voltage comparator goes to a reference voltage (say 1.2V).

    The output of the comparator will change everytime the voltage across the resistor becomes more than, or less than, the reference voltage. You can certainly modify this basic concept.



  7. #7
    Super Moderator
    Points: 51,537, Level: 55

    Join Date
    Apr 2011
    Location
    Minneapolis, Minnesota, USA
    Posts
    12,650
    Helped
    2517 / 2517
    Points
    51,537
    Level
    55

    Re: AC current direction Measuring circuit

    Quote Originally Posted by M.Rehan View Post
    I mean the direction of power flow

    i.e current is flowing from grid to inverter OR inverter to grid
    I guess this is to make sure the grid does not overpower your inverter? Your inverter has to put out equal or greater amplitude at every point in the cycle. If it cannot do that then it needs to disconnect, or else your inverter fries.

    The hard part is for your monitoring device to know which is the correct direction for current to flow at any time in the cycle. It needs to know whether the grid waveform is positive or negative polarity. Somehow your device needs to ignore your inverter's waveform. A method to do this does not appear easy.



  8. #8
    Advanced Member level 5
    Points: 16,186, Level: 30

    Join Date
    Nov 2012
    Posts
    2,968
    Helped
    717 / 717
    Points
    16,186
    Level
    30

    Re: AC current direction Measuring circuit

    Quote Originally Posted by BradtheRad View Post
    Your inverter has to put out equal or greater amplitude at every point in the cycle. If it cannot do that then it needs to disconnect, or else your inverter fries.
    Do you mean that the inverter output is connected to the grid, like some of the solar cell panels? In that case, not only the amplitude but the frequency and phase also must match. And once the grid goes down, so is your inverter, else you will be feeding power to the whole city!



  9. #9
    Advanced Member level 5
    Points: 13,005, Level: 27

    Join Date
    May 2015
    Location
    Melbourne, Australia
    Posts
    2,213
    Helped
    752 / 752
    Points
    13,005
    Level
    27

    Re: AC current direction Measuring circuit

    Quote Originally Posted by M.Rehan View Post

    If direction of current changes the output of circuit should be changed from (high to low) OR (low to high)
    You need a zero crossing voltage comparator to turn sine wave voltages into square waves.
    You need a zero crossing current comparator that turns the current into square waves.

    Feed the two above comparator outputs into an exclusive OR gate.
    If voltage and current are exactly in phase XOR output will be continuous low.
    If voltage and current are exactly 180 degrees out of phase, XOR output will be continuously high.

    High or low indicates direction of power flow.
    But.....
    There will always be some extra phase shift present due to reactive power factor, so there is not likely to be a steady high or steady low. But there will "almost" be a continuous high or low with some maybe narrow pulses due to the slight phase shift.

    What you then do is integrate the output of the XOR gate to get a steady dc voltage, and feed that into yet another voltage comparator, referenced to half way between logic high and low.

    That will then give a very reliable logic level indicating power flow direction, and it will still work with up to 90 degrees of possible additional phase error.
    Cheers, Tony.



  10. #10
    Super Moderator
    Points: 255,159, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    44,463
    Helped
    13543 / 13543
    Points
    255,159
    Level
    100

    Re: AC current direction Measuring circuit

    To know the inverter power (magnitude and direction), you'll multiply and voltage and current (instantaneous power) and average the product. Under circumstances, it's sufficient to form sign(P) = sign(V) xor sign (I), needs only two comparators.

    The inverter can also "source" or "sink" reactive power, in this case sign (P) will flicker with double the mains frequency. Averaging sign(P) filters the real power direction.

    - - - Updated - - -

    I'm late, the same thing verbosely explained by Warpspeed.



--[[ ]]--