Measuring Voltage between Neutral and Ground, Earth

Discussion in 'Embedded Systems and Microcontrollers' started by Ravi Patel 1, Aug 18, 2018.

  1. Ravi Patel 1

    Thread Starter New Member

    Apr 22, 2017
    14
    0
    Hello All,

    I am trying to design a controller which can measures voltage difference between Neutral and Ground. Very low information I found on Google and on AAC regarding this topic.
    Here is my situation. I have Three wires, Live(L), Neutral(N) and Ground(G), as supply for controller. Circuit will get Power from Live and Neutral. It has ATmega328P Chip operating at 5VDC, 8MHz. I need to measure RMS value of potentiate difference between N and G. I have constrain for ATmega328P Chip but free to use any other supporting ICs like ADC etc.

    N will surely have AC behavior with respect to G in unbalanced conditions. I can measure AC Signal's RMS value using ATmega328P's Single ended ADC OR External Differential ADC after necessary conditioning. I need more help in Signal Conditioning and Protection. My expected Input Voltage Difference between N and G is +-10VAC MAX.

    Please give me some hints, Ideas or reference designs (If possible) before I decide which path to go for prototyping.

    Thanks to ALL. Please do ask for any Query.
    upload_2018-8-18_12-58-50.png
     
  2. Hymie

    Active Member

    Mar 30, 2018
    701
    184
    Electrical noise on the neutral/earth lines can extend into the MHz range – so besides deciding on the maximum voltage you expect to encounter, you need to consider the bandwidth of your voltage measurement.

    I suggest you take a look at typical voltages with a good quality scope, before designing your measurement circuit.
     
  3. LesJones

    Well-Known Member

    Jan 8, 2017
    2,304
    693
    Is this homework ? The fact that you have the restriction with no explanation why that an ATmega328P must be used makes me think it is homework.

    Les.
     
  4. Ravi Patel 1

    Thread Starter New Member

    Apr 22, 2017
    14
    0
    No its not Homework. Actually I have designed few projects with ATmega328P and I know it very well to Code complex algorithms. So its just for ease, nothing else. If I must have to upgrade to achieve objective then ATMEL SAMD and SAMC Series Arm M0+ are next.
     
  5. Ravi Patel 1

    Thread Starter New Member

    Apr 22, 2017
    14
    0
    I am new to analog circuit design and still not have a scope. I am in process of buying one and soon will see those signals into it. Thanks for Reply.
     
  6. Alec_t

    Expert

    Sep 17, 2013
    10,267
    2,511
    You should assume that some idiot will swap Live and Neutral, so you would need to protect agains full mains voltage being on the Neutral line.
     
    nsaspook likes this.
  7. Ravi Patel 1

    Thread Starter New Member

    Apr 22, 2017
    14
    0
    Ok, Its good to have Protection for Live on Neutral. Controller will be used in a Machine where a Live Drop OR Live Swap Protection is added. But its good to take such case into consideration.
     
  8. Ravi Patel 1

    Thread Starter New Member

    Apr 22, 2017
    14
    0
    Can I filter High Freq Noise, as I don't need them to measure, and let pass LOW Freq, typically let Freqs around Line Supply Freq, 50Hz, to go to measurement? Will my objective be still valid after doing so or NOT?
     
  9. Alec_t

    Expert

    Sep 17, 2013
    10,267
    2,511
    We don't know what your precise objective is. You said you want to measure the RMS value of Vng: so that would include all frequencies.
     
  10. Hymie

    Active Member

    Mar 30, 2018
    701
    184
    You could make a simple low pass filter, then look at the voltage trace with a scope both pre and post the filter to see the difference.
    Bear in mind that any high frequency noise may not be present at all times, generated by other energised equipment in close proximity.
     
  11. -live wire-

    Active Member

    Dec 22, 2017
    873
    73
    Here is my recommendation. Get a PS that's completely isolated from mains. Power your μC with it. Now use a LC bandpass filter between N and G. Amplify that with a low noise low offset op amp. You will want a dual power supply to get AC on the output. Then maybe try using a MOSFET bridge rectifier.
    [​IMG]
    Use a fast ADC chip and feed that into your μC. Look for one that is low noise and has many pins, so it can get a high resolution and good bandwidth.
     
  12. Ravi Patel 1

    Thread Starter New Member

    Apr 22, 2017
    14
    0
    I was thinking of similar approach to this problem but there are some differences. Please give your thoughts about it.
    upload_2018-8-21_16-48-18.png
    With the use of a 1:1 and 0.25VA Potential Transformer as connected in diagram, I can isolate signal and Measure. After protection of MOV, signal can be converted from bipolar to uni-polar. Clamp it to MAX 10V. Filter out high freqs with LOW PASS filter as I only need to monitor on Line Freq, which is 50Hz. Reduce this to 5V Scale by voltage divider. Fed to ADC for measurement. There will be some room to calibrate ADC for added losses on signal conditioning. A good sampling rate will unable me to have acceptable readings.

    Please share your views about this approach. Thanks for your Reply.
     
  13. Hymie

    Active Member

    Mar 30, 2018
    701
    184
    You are connecting neutral to ground via the 1:1 transformer - for most installations this will cause the ground fault interrupter (earth leakage device) to operate. You need to consider some other method of isolating your measurement circuit from the mains (neutral).
     
    -live wire- likes this.
  14. -live wire-

    Active Member

    Dec 22, 2017
    873
    73
    Why not use a bandpass filter instead of a low pass filter? It will probably reduce 1/f noise, and other low frequency stuff. Maybe put it first so the noise doesn't get amplified later. Also, the voltage should normally be in the 10s-100s of mV range. It may be greater, but that will be the usual range. Also, it may be able to supply very little current without leading to issues. So even an unloaded transformer could possibly draw too much. And it could be a source of EM noise. I'd just make sure my PS for everything is 100% isolated from mains.

    Then I'd use a rail to rail low noise low offset CMOS op amp with a dual rail supply to amplify the signal. I'd set up as an inverting amplifier with a variable gain with transistors that can bypass resistors. So whether it's 20V or 20mV, it will get amplified to be within the same range. And if the gain is too high, it will just swing fully to V+ or V-. Then it can be given a DC offset so that it's only positive. If the op amp supply is +-5V, then add 5V to the signal to get 0-10V. There may be some clipping at a And because of your variable gain, you will Then you can use a fast and precise ADC and feed that to the μC.
     
  15. -live wire-

    Active Member

    Dec 22, 2017
    873
    73
    Also, I did some tests with my true RMS meter, and most of my outlets appear to have .2-.3V between neutral and ground. This was with essentially zero load on them. The meter displayed close to zero volts when not connected, so it is working fine. But there did appear to be some of noise, as when I went to look at the frequency, it displayed some frequencies between 5Hz and 80Hz (rough estimate) before getting to 60Hz. Then again, it could just be poor contact with the probes or issues with the meter itself.
     
  16. BobaMosfet

    AAC Fanatic!

    Jul 1, 2009
    746
    182
    OP:

    Topics dealing with MAINS are unfortunately off-limits here.

    However, and without providing actual 'information' so as to skirt this TOS issue, I think you need to consider a more general aspect of electronics when dealing with large currents and large voltages-

    Never deal with more than you absolutely must- In other words, use every means- resistors, capacitors, opto-isolators, etc, to reduce the amount of energies that you are dealing with by a _scaled_ amount. Scaled, meaning you know that (for example), you're reducing the actual values by a factor of 100, so only dealing with 1/100th of the original dangerous energies. Then use proper isolation techniques to protect your circuit, and yourself if one of these scaling limiter components (resistor, cap, etc) fails.
     
Loading...