AC voltage measurement with 16F77


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    May 2011
    Posts
    3

    Default AC voltage measurement with 16F77

    hello, I want something conprendre conserne measuring an AC voltage based on a 16F877 and I'll post it on an LCD, a voltage is 400V MAX



    N : nombre d’échantillons
    Ui : valeur de l’échantillon i.
    What are the basic conditions to calculate the RMS value ???
    good I want someone to explain a bit with knowledge in electronics
    This formula is used to measure the effective value of a variable voltage or not??
    whether the value measured by this formula is not the real value of tension is what I will multiply rapprort division transformer bridge and go to the pure real value?
    give me the basic points to measure tension via a 16F877 and found an acceptable image
    Please can someone explain to me one!

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: AC voltage measurement with 16F77

    Translation if it helps anyone:

    comprendre = understand
    nombre d’échantillons = number of samples
    valeur de l’échantillon = value of sample
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: AC voltage measurement with 16F77

    Rms voltage is just equal to .707 of the peak, filter ac long enough to get peak voltage on a cap, (with resistance voltage divider), read and mult by .707. Good for a standard sine wave.

    don
    amgen

  4. #4
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: AC voltage measurement with 16F77

    You need a two resistor potential divider to drop that 400V down to 5V, so for 400V (lets call them units)...

    top resistor needs to drop 395 units
    bottom resistor needs to drop 5 units

    therefore,

    3.95K R1 (top resistor)
    .5k R2

    or

    7.9k R1
    1k R2

    etc, & so on (use 1% tolerance resistors or better)

    Ok, now you've got 5V AC peak to peak...you need to get that to RMS.

    If you wnat a reasonable degree of accuracy, then personally, I'd feed the resulting 'to be measured' 5V AC into an ADC pin via an opamp to rebias it at mid point of 2.5V DC ....then use the PIC's special event trigger & 'sample' at a sufficiently high enough rate (presumably you're only thinking of measuring 50Hz/60hz AC)... to extract 'peak' in real(ish) time ...then it's a simple enough conversion, just multiply the result by 0.707 (though you'll need to get creative to work around PICbasics lack of decimals!)

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: AC voltage measurement with 16F77

    Quote Originally Posted by Acetronics View Post
    [.... insert crap here]

    PS: Sorry for the forum friends, but really much too difficult to translate that into our beloved Cambridge Pure English.
    Les nerfs le béret... pis après ça on me dit que mes post sont inutiles et on les "édite".... pfffff...
    Last edited by mister_e; - 15th May 2011 at 21:33.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: AC voltage measurement with 16F77

    HankMcSpank, Wow, With values like that, you sure like to waste power.... 7.9k R1
    1k R2 will yield 17.9775 peak watts or 12.71 watts RMS... Better use 50+ watt resistors... Maybe you can heat your house with this voltage divider...

    Dave Purola,
    N8NTA

  7. #7
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: AC voltage measurement with 16F77

    Do you know what... I edited my original post - checked last night ...it/I hadn't posted!! Then I did a short follow up post last night (along the lines of "those resistances aren't recommendations but just to show the thought process...."). just checked in here again...that follow up post never made it either! I've also noticed that my R2 resistance value was out by a factor of 10! (must do better) ....anyone dabbling in 400V AC, must surely beconfident enough of what they're doing & not just roll with one dodgy/casual post!

    To be clear...I was outlining the process behind dropping 400V AC down to 5V AC...not the actual resistors to use....(that's why I showed two examples stepping up in magnitude).... in practise I'd go for much higher resistors eg 395k & 5k @ 200V peak (cos the 400V AC anticipated is peak to peak) , that's about 500uA through the two resistors ....and a power dissipation of about 100mW.
    Last edited by HankMcSpank; - 16th May 2011 at 13:53.

  8. #8
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: AC voltage measurement with 16F77

    Be careful! Connecting to the AC Mains with only resistors is dangerous. I would strongly recommend some type of isolation.


    I built a circuit that may do what you are attempting. It was a voltage detector that output voltage via RS-232 and would also detect and report single-cycle dropouts. I needed a power supply for the circuit, so a small transformer was an obvious choice.

    The transformer that I used had two secondaries. One secondary powered the PIC. The other secondary was the "measurement secondary".

    The transformer was about 4X the size it needed to be for the current provided. This over-sizing was necesary because the bridge rectifier + cap + LM7805 regulator for the PIC only consumed current near the peaks of the AC waveform, which caused distortion on the peaks. This distortion (almost like "clipping") was easily visible on a scope on the secondary that fed the PIC, but was barely noticeable in the second secondary, which is why I needed the dual-secondary part. I used a Tamura 3FD-316 (dual 8V@150mA). The unloaded secondary (the measurement secondary) needed a small load in order to produce perfectly sinusoidal output (1K ohm) . The PIC A/D input is fed from the wiper of a 10K trimpot also across the measurement secondary (the CAL pot). One end of the measurement secondary is connected to a 499 ohm/499 ohm divider from the PICs supply. This biases it up to 2.5V, so the PICs A/D can read both half-cycles.

    The device works perfectly, and is safe due to the transformer isolation.
    Charles Linquist

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