AC Voltage Waveform Sensing

Discussion in 'The Projects Forum' started by growerdick, Oct 8, 2012.

  1. growerdick

    Thread Starter New Member

    Oct 8, 2012
    13
    1
    I am automating a shrub and tree nursery which is off grid. I am using solar panels and cheap inverters from Harbor Freight. I recently had problems with 120vac pumps failing and when I looked at the output of one of the 2000 watt inverters it was totally screwed up with huge voltage surges.

    I want to monitor the waveform of the 120vac output by feeding it into a micro A to D and sensing it, and then comparing it to a perfect one and shutting down the inverter if problems are seen.

    My problem is getting the voltage into the range of the 5v micro A to D. Dividers put a constant load on the output but are the only thing I can think of so far. I have a Harbor Freight multi-meter that cost $1.98, so I know there must be affordable ways to get the voltage to a usable level and read it accurately, but I need some help in finding them.

    Thanks in advance for any suggestions.
     
  2. link555

    New Member

    Oct 4, 2012
    3
    0
    Could not use a simple peak detection, either analog or in the micro if you like, to trip a contractor or relay?
     
  3. link555

    New Member

    Oct 4, 2012
    3
    0
    A simple voltage divider will work, use 2.5/170Vp = r2/(r2+r1)
    Try R1 = 50k and R2 = 3.3Meg

    Use a 5Volt TVS to protect the micro input...


    For a peak current draw of 50uA through the divider
     
    Last edited: Oct 8, 2012
  4. wayneh

    Expert

    Sep 9, 2010
    12,088
    3,027
    +1

    But be careful and think about the power supplies for your micro and the inverter; you shouldn't just connect their grounds together without first checking to see if they share a common ground. If not, very large currents can move along the "ground" connection. It's easy to overlook how much damage might be done by hooking up just one wire. Start with, say, a 200Ω resistor in between the two grounds and look for an AC voltage across it. Reduce the ohms value in increments until you're satisfied there is little or no current flowing.
     
  5. growerdick

    Thread Starter New Member

    Oct 8, 2012
    13
    1
    Thanks for the inputs. The micro is powered by the 12vdc of the batteries driving the inverter. Nothing is grounded to actual soil. I am having trouble visualizing what would be best to achieve a common ground.
     
  6. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,969
    744
    Use a transformer for isolation, 120V to 12v say and then a resistor divider, but your input would be AC, would that not damge your micro?
     
  7. wayneh

    Expert

    Sep 9, 2010
    12,088
    3,027
    The output of your inverter is not likely a pure sine wave, unless the inverter was very expensive. Could be a square wave if it was cheap.

    Either way, you're essentially wanting to look at a 60Hz wave so this is very much like an audio project. You can use a coupling capacitor (in addition to the voltage divider) to prevent any DC current on the input.

    That does not solve the ground issue. It seems likely to me that "ground" for your inverter is battery ground, but of course you'll want to check that.
    Using battery ground as V- for your micro should be fine in that case.
     
  8. growerdick

    Thread Starter New Member

    Oct 8, 2012
    13
    1
    The inverter output is not as bad as I thought before I looked at it but still pretty square.

    I plan to go through a small bridge rectifier before sampling.

    I also want to feed the input into the input of a differential receiver so I can turn things on and off during the zero crossing. I am using RS485 for communication between the micros and will have a spare set in the SN751178 I am using for that.
     
Loading...