Shop OBEX P1 Docs P2 Docs Learn Events
Reading Line Voltage — Parallax Forums

Reading Line Voltage

Larry~Larry~ Posts: 242
edited 2009-05-29 01:31 in BASIC Stamp
I need to read line voltage 100 to 125 vac what are some of the ways I can condition the voltage?
transformer·/ voltage divider
I will be using an ADC not sure which one yet I will see what I have on hand, 8 bit.
using Bs2 processor
I would like to read in one volt increments.

and yes I did a search and just had a hard time finding anything.

Thanks
Larry

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2009-05-20 18:08
    The safest way is to use a wall wart ( just the cheap kind, not regulated, DC output 5 to 10 volts).

    Use a resistor voltage divider so that your adc will not be over-voltaged when the line voltage is at maximum.

    As to resolution, an 8-bit adc gives you a count of 0 to 255. At 125 volts input, that should be 125/255 or 0.49 volts per count bit. The readings will be a bit twitchy without some additional filtering. I usually use a 12-bit LTC1298 which works nicely with the stamp and gives you a second channel as well.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Larry~Larry~ Posts: 242
    edited 2009-05-20 21:13
    Thanks
    I will try all my old wallwarts with a variac and do some testing
    sounds like a great and cheep way of making this work quickly
    and I just may be able to use the wallwart for stamp power also.
  • Alan BradfordAlan Bradford Posts: 172
    edited 2009-05-22 23:14
    Hi,
    The isolation provided by the transformer in the wall wart, will also add a safety factor.
    Make sure the output of the wall wart is AC and not DC or Regulated DC.
    The·transformer output voltage·will rise and fall with the input voltage.
    I also use the LTC1298 A/D chips and they are easy to use.
    Math is not my strong point, so I have found that if you take 100 readings and divide by 100 you will get pretty close to the·actual reading.
    Good Luck



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Alan Bradford

    Plasma Technologies
    Canaan NH 03741
    www.plasmatechnologies.com
  • Alan BradfordAlan Bradford Posts: 172
    edited 2009-05-23 12:09
    Hi Again,

    It just dawned on me that you are reading an AC Signal. my read 100 divide by 100 works for noisy dc voltages (like you get with a plasma torch or welder).
    To read an AC signal you need to get the RMS value (the value of DC that will do the same amount of work).

    That we will nead a bit of help from some of the smarter members of the group.

    Thanks,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Alan Bradford

    Plasma Technologies
    Canaan NH 03741
    www.plasmatechnologies.com
  • Larry~Larry~ Posts: 242
    edited 2009-05-23 21:52
    Well I am reading AC but there is a diode in line making it DC for the stamp. I am using a resistor voltage divider, may use a zener resistor divider to set the low output at 0vdc @ 100 vac input. I have a varaic and I'm testing the output voltage when the input voltage is 100vac and up to 130vac. Will drop the output to 0 at 100 vac and then I have about 2.5 volts output 0 to 2.5volts.
    I'm looking at either using a amp to get 0 to 5 vdc or just scaling the ADC to read full scale at 2.5 or 3volts. I will check how low the the ADC will go.

    Thanks everyone for the help
  • $WMc%$WMc% Posts: 1,884
    edited 2009-05-23 22:12
    Hello All

    If the high voltage (AC) is transformed down to TTL level voltage(AC), Then Rectified to (DC) Then sampled 60 times a sec. and divided by 60. This reading or value would be the peak average.

    All thats left is to multiply the peak DC average by .707 for the RMS value.

    or Am I missing something?


    ________________$WMc%________

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············································ BoogerWoods, FL. USA
  • FranklinFranklin Posts: 4,747
    edited 2009-05-23 22:18
    $WMc%_ you are missing the fact that even though the voltage id rectified so there is no negative values it is not at a constant voltage but fluctuates from 0 to (max voltage).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • FearTurtlesFearTurtles Posts: 89
    edited 2009-05-24 12:14
    @Franklin

    So you can sample 120 per second Add and Divide to get average, Multiply agian by 2 to get average Peek voltage then again by .707 to get average RMS value right?

    Edited: Nope that won't work because it will average out to 0 never mind.

    Post Edited (FearTurtles) : 5/24/2009 12:25:10 PM GMT
  • $WMc%$WMc% Posts: 1,884
    edited 2009-05-28 01:46
    Franklin

    I assumed the NEG. half would mirror the POS. half. And from there an average of the POS. peaks / by .707 would give the RMS value After a set of samples was taking.

    I know from working with welding machines that the reverse polarity half can far exceed the straight polarity half. But I don't see this happen here. I see the NEG half's just being the opposite of the POS. half's. in current flow, etc.?

    Could You explain a little more in detail how My application posted earlier is off. I don't doubt that I'm wrong. I would just like to know what I did wrong in the Math?

    ___________$WMc%__________

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············································ BoogerWoods, FL. USA
  • FranklinFranklin Posts: 4,747
    edited 2009-05-28 03:06
    If you sample once or twice per cycle you run the risk of getting data points that are not at the top of the wave and in fact could be at the zero points. You need to sample approx once a milisecond for 17 samples to get a complete wave of 60 cycle ac and with that you can figure the actual voltage more closely.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • $WMc%$WMc% Posts: 1,884
    edited 2009-05-29 01:31
    Thanks Franklin

    Its more than obvious now that You have explained it.
    With My method, I could get stuck somewhere below 90degrees(top of wave) from 0 volts and never see the peak voltage.

    Thanks again

    __________$WMc%________

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············································ BoogerWoods, FL. USA
Sign In or Register to comment.