AC Measurement


Closed Thread
Results 1 to 19 of 19

Thread: AC Measurement

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    94


    Did you find this post helpful? Yes | No

    Smile

    Hello All - Thanks for the replies. Using the RMS to DC converter chip as suggested by bbarney seems like the easiest way to go, but the chip costs $15 US which significantly inpacts the overall cost of my project. SO, at least for now, I am going to investigate some other options. I may come back to this if nothing else works.

    I am considering Mister_e's suggestions - the most interesting of which is the modification of the transformerless power supply (Melanie's design):
    (http://www.picbasic.co.uk/forum/atta...1&d=1139474240)

    Steve: would you care to further elaborate on that approach? Is it possible to get the 120 AC voltage down to the 5V DC range and be able to detect 1V changes in the incoming AC? The transformerless power supply has a Zener in it - if I am not mistaken, that essentially chops off voltages above it's rating (in this case, 12V).

    Acetronics: If I gather your response correctly, it sounds like you are addressing frequency measurement. At this time, I am interested in voltage measurement. Please let me know if I misunderstood...

    Again, Thanks!

  2. #2
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    94


    Did you find this post helpful? Yes | No

    Default Melanie, you are invited, too!

    Melaine - Since this is (hopefully) a modification of your design, I thought I would invite you to participate and maybe take a break from the somewhat heated debate over fusing in the other thread... (BTW, I agree with you wholeheartedly. I was an electrical safety officer at a national laboratory here in the States, and I shut down operations at an entire facility because they used some equipment fused N:G). Aaaannywaaayy.... that's not the topic here... Can you give any comments on my objective?

    Thanks!

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Atom058
    Hello All
    Acetronics: If I gather your response correctly, it sounds like you are addressing frequency measurement. At this time, I am interested in voltage measurement. Please let me know if I misunderstood...

    Again, Thanks!
    Hi, Atom

    YES, you are ...

    the goal is to convert the mains dangerous voltage to a proportionnal frequency and THEN to use an opto coupler to transmit the info to a low voltage ( = safe ) part of the meter.

    so, you count a freq which is proportionnal to your voltage. C.Q.F.D.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Alain - My apologies! After looking at the spec sheet, this does sound like a promising prospect after all. It looks like I need to get the voltage down to 10V or thereabouts to input into this chip. Is that correct? I tried searching for LM331 to see if any others have used this but could not find any reference to it. I even tried the Google search, too. Can you recommend a good way to get my incoming AC down to a level acceptable for input into this chip?

    Thanks!

  5. #5
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126


    Did you find this post helpful? Yes | No

    Default

    I have measured 240v using this IC. I used two 240v minature transformers in series across the mains to measure the voltage. This became ~6v on the (series connected) secondary side that I then fed to the NSC RMS to DC convertor IC.

    I used the 'two transformer in series' trick as I had once read about it in Elektor as a way to improve the linearity of the small cheap transformers I was using.

    It worked real well, only issue was the cost of the ICs. I also worked on doing various half wave and full wave recification schemes, but after smoothing found the lag was an issue.

    Bill

  6. #6
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Bill - Thanks for your reply. I searched a little through the Elektor Forum and was not able to find anything like what you were describing. Can you point me in the right direction? Also, after looking at the spec sheet for the LM331, can you tell me if the circuit that they have diagrammed is necessary in it's entirety? Did you have a simpler design?

    Thanks! Atom058

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


    Did you find this post helpful? Yes | No

    Default

    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1185&stc=1&d=116343790 0">

    On a PIC with ADC and comparator on the same pin it could be possible.

    Comparator interrupt to detect the zero crossing, you wait 'till 0.707 Vpeak - x offset delay, then take an ADC reading.

    OR use 2 I/o, one INT (let's say INT0) + ADC.

    But i think the poor psu may suffer if you need many mA.... Could be handy to use high efficiency LED display.

    EDIT: another maths approach using samplings... process the long RootMeanSquare stuff... or by 0.707*Vpeak.
    Attached Images Attached Images  
    Last edited by mister_e; - 13th November 2006 at 18:09.
    Steve

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

  8. #8
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Steve - Thanks for the diagram. It looks to me to be a modification of the transformerless power supply with the addition of a resistor divider network to provide the input to my PIC. Is that correct?

    I don't intend to power my PIC or anything with this - so the current capability of the circuit is not important. I just need to know how to condition the AC so that I can read the voltage.

    I like your idea of triggering an interrupt (like for the AC Lamp Dimmer circuit you helped me out with), waiting a few uS and then start measuring the voltage on an ADC input. I would then find the highest value and from that I can calculate the voltage. However, I believe that I need to get the incoming voltage to the ADC pin to 5V or below. Isn't that correct? That seems to be the $64 question... how do I get the 120V AC input to some level that is acceptable for an ADC input? Is this accomplished with the resistor divider circuit that you presented?

    I appreciate your help!

    Thanks!

  9. #9
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Atom058
    Bill - Thanks for your reply. I searched a little through the Elektor Forum and was not able to find anything like what you were describing. Can you point me in the right direction? Also, after looking at the spec sheet for the LM331, can you tell me if the circuit that they have diagrammed is necessary in it's entirety? Did you have a simpler design?

    Thanks! Atom058
    It was in a print edition in late 80s - let me see if I can find it in the archive and scan it. It was a mains voltage monitor in UK Elektor.

    The Circuit I used actually had the Maxim MX636 (I incorrectly mentioned NSC before) version of the AD636 (I used it because it was part of the free samples that were available at the time.) I used transformers for isolation as I didn't want to blow up the PIC, the computer, or myself !

    Not sure of the merit of converting voltage to frequency rather than just doing an RMS measurement in either hardware or software after stepping the voltage down. Have a look at Circuit Celler a while back - Jeff Bachiette (sp?) did an article using the Alegro current sensors where he did some RMS measurements in software to work out the peak current at the peak of the mains cycle - it might help. He did it in a 12f873 using PBP. Let me go out to the shed and see if I can find the article. The code should be on the CC site.

    Bill.

  10. #10
    Join Date
    Sep 2006
    Location
    Florida, USA
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Bill - Thanks for your help! That would be great if you can find that Elektor article. And the pointer to Circuit Cellar - I'll be pouring over that site...

    Steve (and/or Bill?) - I have a transformer question that hopefully you can answer: Let's say I have a transformer that takes 120VAC and gives me an output of 12VAC. If I have a 2V (1.67%) drop at the input, will I have a corresponding drop at the output (12 * 0.0167 = 0.2V)? In this case, my input would be 118VAC and my output would be 11.8VAC. If so, does anyone have a feel for how linear it is? Again, my voltage of interest is only between 115V - 125V AC.

    Thanks!

Similar Threads

  1. Circuit Diagram for interfacing AC to PIC IC?
    By wellyboot in forum Schematics
    Replies: 3
    Last Post: - 8th March 2008, 19:40
  2. How to read AC mains with an inductance coil
    By KB3BYT in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 20th February 2008, 12:02
  3. AC Measurement problems
    By Charles C in forum Off Topic
    Replies: 0
    Last Post: - 25th October 2005, 17:13
  4. Special Offer AC -AC adapter
    By lester in forum Adverts
    Replies: 0
    Last Post: - 9th September 2005, 07:52
  5. Detecting AC current
    By rhino in forum Off Topic
    Replies: 8
    Last Post: - 8th July 2005, 21: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