An alternative method of measuring the mains voltage waveform for a PV controller

This method of monitoring mains voltage that is safe, accurate and does not require a transformer. It breaks two “rules”.

The first rule to be broken is not to connect directly to the mains. However, we have to “invade” the mains anyway to make a controller, so I thought another instance would be ok as long as it can be done safely – which it can, provided all necessary precautions are taken.

The second rule to be broken is not to conduct any current from the mains to the earth. I did some internet research and found that this is, in fact, both acceptable and commonplace. More justification for this is given below.

Using this circuit, the Arduino is close to earth potential and is safe to touch. It can be connected to a computer, for power and monitoring, or the system can be powered using a mains usb charger adapter.

The system is safe only if the mains earth connection is good – but the same applies to a washing machine and a microwave.

The circuit measures the difference in voltage between the live and neutral. Any voltage between neutral and earth is filtered out.

The circuit provides input protection - the inputs to the opamp and the ADC remain within limits (i.e. the rails) even if 1000V spikes appear on the mains (either live or neutral).

Here are the circuit elements. The first is a 2.5V rail as used elsewhere.

The components inside the dotted line should be mounted on a separate board (see below).

Construction

In order to make the circuit safe, the following precautions must be observed.

  • Do not attempt this unless you are confident you know what you are doing.

  • Do not put mains voltage on the same board as the 5V circuitry.

  • Stripboard is not suitable for mains voltage

  • Construct a separate “mains voltage sender” board comprising the four resistors inside the dotted line.

  • Connect the mains inputs directly to the 1MΩ resistors, and insulate the joint with heatshrink sleeving. This renders the rest of the circuit safe to touch, provided the earth is connected.

  • Before connecting to the mains, do a continuity check from the mains earth to the circuit earth.

  • Before connecting to the mains, measure the resistances with a meter to confirm that the circuit is correct.

  • After connecting to the mains for the first time, carry out checks with a mains tester to ensure that no dangerous voltages are present.

The photo below shows the mains voltage sender ready for connection to the breadboard

 

Here is a close up of the pcb. When this photo was taken, the final piece of heatshrink sleeving covering the whole assembly was not in place. However, the joints between the mains wires and the 1MΩ resistors are insulated with heatshrink sleeving. The rest of the circuit is at or close to earth potential and so is safe to touch.

At the time of writing the circuit has been tested on a breadboard. The present intention is to use the other opamp in the LM358 to generate a zero crossing signal, and the other opamp in the TS912 for the CT input.

This is the mains waveform as measured using this circuit, in Arduino ADC units (not yet calibrated).


 

Earth leakage

First, we should be aware that it is unintended earth leakage that causes problems, not “designed earth leakage” as here. My internet search on the subject uncovered this:

earth leakage should be below 3.5mA”

here: http://openenergymonitor.org/emon/node/841?page=1

and this:

RCDs trypically trip at 30mA. 10MA is considered sensitive.”

Any item of equipment with a switched-mode power supply will have designed earth leakage, recommended design figures are in the order of 1mA.”

here:
http://www.electriciansforums.co.uk/electrical-courses-electrical-nvqs/22447-can-you-help-rcd-regs-earth-leakage-questions.html#ixzz26NRqeg54

So I concluded that 0.24mA of designed-in earth leakage would be acceptable.