+ Post New Thread
Results 1 to 15 of 15
  1. #1
    Newbie level 5
    Points: 73, Level: 1

    Join Date
    Oct 2017
    Posts
    9
    Helped
    0 / 0
    Points
    73
    Level
    1

    HOW TO MEASURE AND 3PHASE AC pic16f877a

    Hi everyone,
    pls i need help on this project

    i need to measure the voltage from each line and and the phase angle also will be able to select the one with higest voltage to on the load and if they are all the same voltage not less than 180 , the controller should choose any one itself.. i have less knowledge programimng

    thanks in advance.

    •   AltAdvertisement

        
       

  2. #2
    Super Moderator
    Points: 77,782, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,762
    Helped
    3590 / 3590
    Points
    77,782
    Level
    68

    Re: HOW TO MEASURE AND 3PHASE AC pic16f877a

    Hi,

    safety first: are you experienced with high voltage? Do you know about safety regulations of your country? Air gap, creepage distance?

    What voltage do you want to measure? line to starpoint? Is star point = earth GND?
    Peak? rectified average? RMS?

    Do you need an isolated measurement or is it possible to measure star_pint_referenced?
    Is it possible to connect microcontroller_GND with star_point?

    A picture could help to clarify.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  3. #3
    Newbie level 5
    Points: 73, Level: 1

    Join Date
    Oct 2017
    Posts
    9
    Helped
    0 / 0
    Points
    73
    Level
    1

    Re: HOW TO MEASURE AND 3PHASE AC pic16f877a

    Click image for larger version. 

Name:	three phase measurement.JPG 
Views:	18 
Size:	43.8 KB 
ID:	142984
    i have attached the picture . i have experience about high voltage .. but in this i want to know the voltage from each line , that is why every of my line will have its own transformer and the voltage i want to measure is 220v . thanks for your responses ..i appreciate



  4. #4
    Super Moderator
    Points: 81,409, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,346
    Helped
    4456 / 4456
    Points
    81,409
    Level
    69

    Re: HOW TO MEASURE AND 3PHASE AC pic16f877a

    I assume the primary windings are not in parallel or all the readings would be the same!

    It should work as long as nothing else is connected to the secondaries but may I make suggestions:
    The capacitor values are far too high to see anything but the slowest changes in voltage, if you want a faster response, drop them to maybe 100uF.
    You probably don't need to use a bridge rectifier, if you connect one side of the secondary windings to ground and use a single diode it should work just as well.
    For protection, add a 5.1V Zener diode across R2, R4 and R6 in case voltage surges cause the PIC input to reach >VDD level.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



  5. #5
    Super Moderator
    Points: 260,224, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,441
    Helped
    13826 / 13826
    Points
    260,224
    Level
    100

    Re: HOW TO MEASURE AND 3PHASE AC pic16f877a

    Didn't yet hear about intended transformer windings ratio. What is it?

    The present circuit is effectively measuring Vpk, which is least accurate way to measure AC voltage because it's most affected by waveform distortions.



  6. #6
    Newbie level 5
    Points: 73, Level: 1

    Join Date
    Oct 2017
    Posts
    9
    Helped
    0 / 0
    Points
    73
    Level
    1

    Re: HOW TO MEASURE AND 3PHASE AC pic16f877a

    Pls can u help with the circuit .. I dont get that part thanks



  7. #7
    Super Moderator
    Points: 77,782, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,762
    Helped
    3590 / 3590
    Points
    77,782
    Level
    68

    Re: HOW TO MEASURE AND 3PHASE AC pic16f877a

    Hi,

    there are many threads with discusiions about mains voltage measurement.
    They disscuss:
    * safety
    * isolation
    * measurement methods with benefits and drawbacks.
    * circuits and the part value calculations.
    * effort in software and herdware.
    (I took part at some of these discussions, therefore I see no need to repeat this all here in this thread)

    What else do you need?
    Thereīs nothing different whether you measure one phase-to-starpoint or three phases-to-starpoint.
    There are many more discussions in the internet, too.

    Still a lot of questions of my post#2 are not anwered yet.

    Still unclear why you donīt simply use an existing schematic.
    As said before: The transformer connection makes no sense.
    And I donīt see the use of different resistor values in "B" channel.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisement

        
       

  8. #8
    Newbie level 5
    Points: 73, Level: 1

    Join Date
    Oct 2017
    Posts
    9
    Helped
    0 / 0
    Points
    73
    Level
    1

    Re: HOW TO MEASURE AND 3PHASE AC pic16f877a

    thanks for the responses.. pls can u help with the link to the site, i av searched but havnt seen one with pic that why i put these here. thanks........ the voltage i want to measure is 220vClick image for larger version. 

Name:	corrected.JPG 
Views:	13 
Size:	164.3 KB 
ID:	142993

    - - - Updated - - -

    thanks for the responses .. pls i have search and i havent seen any..pls help me to post the thread it was discussed.
    here is the corrected one .the voltage to measure is 220v.. thanksClick image for larger version. 

Name:	corrected.JPG 
Views:	6 
Size:	164.3 KB 
ID:	142994



  9. #9
    Super Moderator
    Points: 81,409, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,346
    Helped
    4456 / 4456
    Points
    81,409
    Level
    69

    Re: HOW TO MEASURE AND 3PHASE AC pic16f877a

    The last schematic is completely wrong!

    You only need ONE diode in each secondary to make a half-wave rectifier so short out D2, D4 and D5.
    Diodes D3, D9 and D6 should be ordinary silicon rectifiers. Assuming the peak secondary voltage is < 10V you can use any of the 1N400x types.
    Diodes D1, D7 and D8 should be the 5.1V Zener diodes. The idea is they don't conduct at all unless the voltage is too high for the PIC.

    As pointed out, this is not the most accurate way to measure the phase voltages but it will give a fairly close approximation of it. The R, Y and B voltages will be approximately 0.7 of the RMS secondary voltages so ideally you want it to be no more than VDD/0.7 = 7.14V.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



  10. #10
    Super Moderator
    Points: 77,782, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,762
    Helped
    3590 / 3590
    Points
    77,782
    Level
    68

    Re: HOW TO MEASURE AND 3PHASE AC pic16f877a

    Hi,

    Links:
    do a search on "AC voltage measurement"
    https://www.edaboard.com/showthread.php?t=355515
    https://www.edaboard.com/showthread.php?t=358780

    Please review your circuit:
    From post#4:
    "a single diode it should work " --> but you use two diodes (plus a zener)
    "add a 5.1V Zener diode across R2" --> but you put the zenere else where

    ***
    connect secondary side of transformer (dot) to GND
    connect secondary side (non dot) to diode-Anode
    connect diode-cathode to capacitor
    connect zener in parallel to R2

    **
    Then you have a peak voltage measurement (as said, itīs prone to errors)
    Tau = 100uF x 20k = 2s (this is slow. This may be good or not - it depends on your requirement)
    With a mains frequency of 50 Hz you may expect a rippe of more than 0.5%

    ***
    I recommend you to use some free simulation tool, like LTspice.

    Klaus

    - - - Updated - - -

    Hi,

    I just did a measurement at our mains voltage:
    We have a peak voltage of 318.2V with an RMS voltage of 229.4V
    --> The ratio is 1.387, while one expects 1.414.
    This is because the top of the sine is "flattened" somehow by rectifying load. (Although we have a very stable mains voltage)

    This gives an accuracy error of about -2%.
    But if you have some dimmer circuit nearby you may have the error to the opposite side, caused by some switching noise.

    Iīd say with your circuit you canīt guarantee a precision-error better than +/-5%.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  11. #11
    Newbie level 5
    Points: 73, Level: 1

    Join Date
    Oct 2017
    Posts
    9
    Helped
    0 / 0
    Points
    73
    Level
    1

    Re: HOW TO MEASURE AND 3PHASE AC pic16f877a

    thanks for your responses here is the corrected diagram.. wat can i do to make it error freeClick image for larger version. 

Name:	3PHASE.JPG 
Views:	9 
Size:	174.9 KB 
ID:	143071



  12. #12
    Super Moderator
    Points: 81,409, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,346
    Helped
    4456 / 4456
    Points
    81,409
    Level
    69

    Re: HOW TO MEASURE AND 3PHASE AC pic16f877a

    Your schematic is now correct except for maybe one thing: You have to press the switch to start it running because the PIC uses an external reset but you are not providing one until the switch closes. What you need to do it ensure the reset line is low until VDD is high enough for the PIC to run normally. There are many ways to monitor the VDD voltage but the simplest is just to assume it will rise cleanly when you switch on and add a delay in the MCLR voltage following it. You can do that by modifying the circuit around the MCRL pin like this:

    1. change R10 to 10K.
    2. add a diode across it, preferably a small signal type like a 1N4148 or a BAT85, cathode end to VDD.
    3. add a capacitor of say 22uF from MCLR to VSS. This is to delay the voltage rising as it charges through R10.
    4. add a resistor of 100 Ohms in series with the switch (ONLY the switch).

    The MCLR will now follow VDD with a short delay, the current flowing into the capacitor as it charges will keep MCLR low for a brief time. The diode does nothing in normal operation but it ensures there is a safe path for the capacitor to discharge when you switch off. Without it, if VDD drops suddenly it will discharge into the MCLR pin and risk damaging the PIC. The 100 Ohm resistor is to limit the current through the switch, without it the capacitor would be directly shorted out by the switch when it was pressed which could damage it's contacts.

    The accuracy of the measurement depends on what you want it to do. At the moment it will give you a reasonable measurement of the voltage on each phase with respect to neutral. If that is all you want the design is finished. The effect of rectifying each phase to DC before measuring it is you lose the shape of the waveform and any phase information. To get a more accurate result you have to analyze the AC waveform which is far more complicated to do and requires rapid sampling by the ADC (many times per AC cycle) and software to monitor the shape of the results.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



  13. #13
    Super Moderator
    Points: 77,782, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,762
    Helped
    3590 / 3590
    Points
    77,782
    Level
    68

    Re: HOW TO MEASURE AND 3PHASE AC pic16f877a

    Hi,

    what do you expect?
    Someone to do your job?

    We gave all necessary informations and links to informations. But it seems you didnīt read it.
    We asked questions about your requirements, but you didnīt answer them.

    You give statements that canīt be fulfilled: "error free". There is nothing that can be considered error free. You may minimize them. How? --> read through the given links

    Klaus

    - - - Updated - - -

    ****
    I often see zener diodes to protect ADCs inputs from high voltage.

    I doubt this is a good solution.
    * they cause unlinearity. This means errors (mainly DC) and distortion (mainly AC).
    * the zener current is noisy
    * there is no positive overvotage protection when ADC is powered OFF

    I did some measurements on diode current vs diode voltage.
    Here the results.
    * I only had a BZX85C5V1 by hand, but I think it is comparable.
    * For error calculations I used 6700 Ohms which equals the source resistance of the OPīs circuit
    Click image for larger version. 

Name:	zener-error.png 
Views:	0 
Size:	10.7 KB 
ID:	143076
    You see
    * at 2.7V about 1% error
    * at 3.6V about 10% error

    Therefore I recommend to use
    * a signal diode to GND (for negative input voltages)
    * a signal diode to VCC (for positive vervoltages)
    * capacitors at VCC to GND (big enough to handle ESD energy)
    * for high energy or low value capacitors I additionally recommend an overvoltage protection at VCC

    Improvements:
    * use schottky diodes for lower voltage drop
    * use "low leakage current" diodes for even less error
    * use an additional series resistor (maybe 100 Ohms) between diodes and ADC input ... to limit input current.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisement

        
       

  14. #14
    Newbie level 5
    Points: 73, Level: 1

    Join Date
    Oct 2017
    Posts
    9
    Helped
    0 / 0
    Points
    73
    Level
    1

    Re: HOW TO MEASURE AND 3PHASE AC pic16f877a

    hi ,
    you asked of the voltage i wanted to measure .. which i said is 220v, you also asked of isolation measuremnt whic is yes... i want it to be isolated cause i will like to power the pic through a battery of 24v.
    i dont want any othe information apart from the pic showing only the voltages of each face and if it reaches a certain level say 180 , the output of the pic to on a led and select that voltage.



  15. #15
    Super Moderator
    Points: 77,782, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,762
    Helped
    3590 / 3590
    Points
    77,782
    Level
    68

    Re: HOW TO MEASURE AND 3PHASE AC pic16f877a

    Hi,

    measuring AC voltage and donīt care about waveform and accuracy is easy: use your circuit and you are done.

    Measuring AC voltage accurately is somehow difficult.
    * you need to define "how" accurate you want it (in percent)
    * you need to define what value of the AC you want to measure: Peak (like your circuit) - or rectified average - or true RMS
    often one wants RMS.
    But calculating the RMS_voltage from measured_peak_voltage is only possible if you have a known and stable waveform.

    example: If the input is a clean sine waveform then V_RMS = V_peak / 1.414.
    But if the sine is distorted somehow: noise, overtone, unsymmetry, peaks ... then accurate calculation is not possible anymore. The factor "1.414" is not valid anymore.
    --> We donīt know the expected accuracy, we donīt know about waveform. So we canīt give an error-free solution.

    But maybe you donīt want RMS....and indeed you want the pek value, then your circuit is good.
    --> We donīt know what value you want to measure. "220V AC" is not enough information.

    But things becomming worse with "isolation".
    More distortion, more errors, less accuracy...

    ****
    Isolation:
    Running the PIC from a battery doesnīt need isolation.
    Connecting the battery "minus" with earth GND is safe. If your star point is earth_gnd, too, then I see no problem.
    But we donīt know if your star point is earth_GND .. therefore we must believe in you, that you need isolation.

    On the other hand, if you need isolation between battery and star point... then you may use an isolating DC/DC converter. So even if the star point voltage is dangerous you may touch the battery.....but you must not touch the PIC_GND in this case. But if you use a transparent plastic case then you can see the display inside, but you canīt touch it. Safe.

    Isolating the analog signal while maintaining high accuracy is very difficult - and thus I avoided this over 20 years of engineering precision industrial measurement equipment.

    ****

    The problem with me is: I donīt want to spend time with guessing (maybe in the wrong direction). I donīt like "trial and error".
    I need to know the requirement, the specifications and the environment before ..then calculate - then design - then it will work. Till now: always.

    Other engineers have their own way to design electronics - and this is OK, too.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



--[[ ]]--