Author Topic: Safest way to measure AC mains 220-250 voltage?  (Read 4435 times)

0 Members and 1 Guest are viewing this topic.

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4364
  • Country: gb
Safest way to measure AC mains 220-250 voltage?
« on: July 17, 2019, 09:18:22 am »
I intend to install a DIY mains electric monitor (or several) in my distribution board / meter box.

For current I hope to use one of these:
https://www.ebay.co.uk/itm/100A-SCT-013-000-Non-invasive-AC-current-sensor-Split-Core-Transformer-ODHN/264087793339?epid=7008163687&hash=item3d7cdbeebb:g:EMoAAOSw-CpYBowr

I gather this will output a 50mA (for 100A) AC current, so I still have open questions on how to correctly sample that to get a genuine current value.

For voltage, I believe I could use an unregulated transformer based AC/DC power supply and calibrate it's unloaded output with a multi meter.  Obviously this will not allow me to measure things like power factor, apparent power etc.  but I have no requirements to do so.  A simple DC voltage, as close to linearly related to the AC input voltage as possible.  I do not expect my voltage to fluctuate that much, the lowest I have ever measured locally was 239V and the highest 245V.

I also realise that if I just assumed 240V I would get a fairly accurate figure anyway, within a few percent.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4364
  • Country: gb
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #1 on: July 17, 2019, 09:39:23 am »
I gather this will output a 50mA (for 100A) AC current, so I still have open questions on how to correctly sample that to get a genuine current value.

A quick google for example circuits and of course this should be as simple as a current sense resistor to convert the current to a voltage and a suitably sized capacitor to smooth the voltage out.

My AC is a little rusty (always has been), but if you pass 1A through a 1 Ohm resistor you get 1V, but if you then pass -1A through the same resistor you would get -1V across it, no?   Surely this would just discharge the smoothing capacitor or reverse it's polarity.  So I'm confused.  Should there not be a diode in the circuit somewhere to filter out the negative voltage across the current sense resistor?
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline richard.cs

  • Super Contributor
  • ***
  • Posts: 1201
  • Country: gb
  • Electronics engineer from Southampton, UK.
    • Random stuff I've built (mostly non-electronic and fairly dated).
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #2 on: July 17, 2019, 09:56:38 am »
You can put a bridge rectifier on the output of the current transformer then have your shunt resistor after that. The diodes introduce some extra voltage drop which is OK because the current transformer acts as a constant-current source. Your voltage across the resistor will be full-wave rectified so will be bumpy. Don't connect a capacitor directly across the shunt resistor, include it in a resistor-capacitor filter after the shunt resistor. That capacitor will then have a voltage across it that is proportional to the average current magnitude, as a reasonable approximation this is proportional to RMS current which is what you actually want.

Or, if you are feeding this signal into a microcontroller you don't need the diodes or the capacitors, instead you connect the shunt resistor directly across the current transformer, bias the signal (offset it positive so your signal goes from e.g. 1 to 3 V instead of -1 to 1 V) into the ADCs input range, and then sample multiple times per AC cycle to allow you to calculate the RMS current.
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4364
  • Country: gb
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #3 on: July 17, 2019, 10:00:33 am »
Or, if you are feeding this signal into a microcontroller you don't need the diodes or the capacitors, instead you connect the shunt resistor directly across the current transformer, bias the signal (offset it positive so your signal goes from e.g. 1 to 3 V instead of -1 to 1 V) into the ADCs input range, and then sample multiple times per AC cycle to allow you to calculate the RMS current.

Ah, yes.  For some reason I was trying to shy away from dealing with the actual AC current waveform, but as you point out, if biased correctly and sampled fast enough, the rest just becomes mathematics. 

I found this, which will help with the mathematics :)
https://learn.openenergymonitor.org/electricity-monitoring/ct-sensors/how-to-build-an-arduino-energy-monitor-measuring-current-only?redirected=true
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #4 on: July 17, 2019, 10:04:47 am »
I have several of these https://www.ebay.com/itm/113704114092 and they work fine.

If you search ebay for -- panel meter ac 300V 100A -- you can find many similar items.

You can also find power meters and energy meters.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6586
  • Country: nl
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #5 on: July 17, 2019, 10:11:08 am »
I have several of these https://www.ebay.com/itm/113704114092 and they work fine. 
I also have something similar from China for $15 but it is only powered when I am there (for my machine).
I would not like to have it 24/7 unattended in my house: if it fails what guarantees do you have it will not catch fire ?
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4364
  • Country: gb
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #6 on: July 17, 2019, 10:14:37 am »
I have several of these https://www.ebay.com/itm/113704114092 and they work fine.

If you search ebay for -- panel meter ac 300V 100A -- you can find many similar items.

You can also find power meters and energy meters.

I should have stated my original requirements better.  I already have an energy monitor, it's wireless with a current clamp and transmitter tied onto the main meter OUT "tail", and the receiver has an LCD display showing Kw, accumulated kwh and cost (if provided the KWh cost).  However this is a closed system and without reverse engineering it's signal or trying to tap the LCD signals I cannot get the data out.

I need something that will provide current and potentially (bad pun) voltage to an ESP8266 or similar Wifi capable MCU to allow me to send this data onto my home automation hub for logging, display etc.

Also, on EBay mains panel meters I have had bad experiences.  One I bought "the Internet" told me the wrong instructions where sent with some of them with completely incorrect wiring diagrams.  However I figured if I choose to ignore the instructions that came with it and trusted "the internet" and it blew up I would look stupid.  So I wired it based on the instructions that came with it.  It promptly detonated all over my carpet spraying capacitor guts and putting a burn hole in the shape of my devices cooling vents in the carpet. :(  Landlord was not happy and I lost most of my deposit, although I'm still fighting to get that back.
« Last Edit: July 17, 2019, 10:17:59 am by paulca »
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline Terry01

  • Frequent Contributor
  • **
  • Posts: 907
  • Country: scotland
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #7 on: July 17, 2019, 11:08:30 am »
I have several of these https://www.ebay.com/itm/113704114092 and they work fine.

If you search ebay for -- panel meter ac 300V 100A -- you can find many similar items.

You can also find power meters and energy meters.

I should have stated my original requirements better.  I already have an energy monitor, it's wireless with a current clamp and transmitter tied onto the main meter OUT "tail", and the receiver has an LCD display showing Kw, accumulated kwh and cost (if provided the KWh cost).  However this is a closed system and without reverse engineering it's signal or trying to tap the LCD signals I cannot get the data out.

I need something that will provide current and potentially (bad pun) voltage to an ESP8266 or similar Wifi capable MCU to allow me to send this data onto my home automation hub for logging, display etc.

Also, on EBay mains panel meters I have had bad experiences.  One I bought "the Internet" told me the wrong instructions where sent with some of them with completely incorrect wiring diagrams.  However I figured if I choose to ignore the instructions that came with it and trusted "the internet" and it blew up I would look stupid.  So I wired it based on the instructions that came with it. It promptly detonated all over my carpet spraying capacitor guts and putting a burn hole in the shape of my devices cooling vents in the carpet. :(  Landlord was not happy and I lost most of my deposit, although I'm still fighting to get that back.

 :-DD Sorry but that's some funny chit!  :-+
Sparks and Smoke means i'm nearly there!
 
The following users thanked this post: austfox, paulca

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4364
  • Country: gb
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #8 on: July 17, 2019, 02:22:48 pm »
So thoughts on measuring the mains voltage?

a)  Don't bother, just hard code 240V and power might be off by a few watts.
b)  Ebay special mini-transformer module and calibrate
c)  9V Transformer unregulated wall wort

I'm leaning towards option a at the moment.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6586
  • Country: nl
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #9 on: July 17, 2019, 03:05:04 pm »
If you do choose a, than I would suggest measuring the voltage with a true rms multimeter.
I don't know how it is in the UK (probably location dependent) but here in NL we have a rather steady voltage BUT it is never 230VAC as it should be.
In my house it is 228VAC +/- 1V during the daytime. If you know that than you at least have a more accurate number to start with.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #10 on: July 17, 2019, 03:52:39 pm »
My energy monitor is powered by a small AC output unregulated wall wart, it's just a transformer. That's the safest way I can think of and it works well enough. As long as the load on the transformer is not too variable the result should be quite accurate.
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #11 on: July 17, 2019, 06:08:14 pm »
If what you want is a transducer that will output a standard 0 - 5 V or 4 - 20 mA you can find commercially built units and unless they are very expensive you are better off just buying something off the shelf.

https://www.set-transducer.com/CurrentTransducer.html?RC=5

You can also find them for voltage and other physical magnitudes.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #12 on: July 17, 2019, 06:11:01 pm »
I intend to install a DIY mains electric monitor (or several) in my distribution board / meter box.

You shall start reading electricity meter reference designs:

http://www.ti.com/solution/smart-e-meter-amr-ami
https://www.st.com/en/applications/metering/single-phase-meter.html
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #13 on: July 17, 2019, 08:27:54 pm »
The proper device is called a potential transformer, however in practice any ordinary mains frequency power transformer is likely to be good enough. It only needs to be accurate over a range of say +/-20% at most.
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #14 on: July 18, 2019, 06:41:58 am »
I may be mistaken but I believe the OP is looking for transducers which will convert AC voltage and AC current into DC signals proportional to the RMS values of the originals and which can then be fed and measured.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4364
  • Country: gb
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #15 on: July 18, 2019, 06:54:29 am »
I may be mistaken but I believe the OP is looking for transducers which will convert AC voltage and AC current into DC signals proportional to the RMS values of the originals and which can then be fed and measured.

True, but as the device (MCU) will be doing nothing much else it can probably sample a 50Hz waveform fast enough to calculate the RMS values.

I bought SCT current clamp, took note of the warning about clamping it to anything while un-burdened!  I'll start with just a periodic measurement of my mains voltage and calibrate it using something like a 100W incandescent lightbulb on the bench before putting it in the meter box.

The OpenEnergyMonitor project has lots of gudies and code libraries that will help.

Last night I dusted off my soldering iron which has been boxed up for months due to house move.  Took an hour to make a temp sensor for my living room using an ESP32.  Next job is the energy monitor.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #16 on: July 18, 2019, 03:06:16 pm »
There are many ways to go about this depending mostly on what you need. If you need to know polarity that is one thing. If you just need to know absolute magnitude that is different.

If just magnitude is enough then optoisolators can come in handy.

If you need polarity and do not want to handle negative voltages then you can have an input of -2.5 to +2.5V and offset it by +2.5V which gives you 0 - 5 V.

All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4364
  • Country: gb
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #17 on: July 18, 2019, 06:02:25 pm »
All I'm after is a fairly accurate electrical usage figure, so I can display it, log it and graph it with my home data logger system.

As power is current * voltage I figured I'd need a safe way to measure the mains voltage with a 5V MCU, well actually a 3.3V MCU.

However as pointed out by others if the mains voltage is stable, and it pretty much is here, there is no real need to measure the voltage, just add it as a calibration configuration value.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #18 on: July 18, 2019, 06:42:15 pm »
That won't work because you need instant value. Phase counts.

You need to measure voltage and current at least several hundred times per cycle and multiply those values.

Or how would you measure the power used by a bridge rectifier followed by a capacitor where you get very short bursts of current?

You would probably be better off getting a specialized IC. You are aware that these things are sold off the shelf commercially.


« Last Edit: July 18, 2019, 06:47:37 pm by soldar »
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4364
  • Country: gb
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #19 on: July 18, 2019, 07:44:08 pm »
You would probably be better off getting a specialized IC. You are aware that these things are sold off the shelf commercially.

Do you have an example?
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #20 on: July 18, 2019, 10:42:05 pm »
Sorry, I expressed myself very poorly. I am sure there are specialized IC for this type of job because that is what Energy meters would use.

But when I wrote the second phrase what I meant is that maybe you could buy some cheap power or energy meter and hack it so you could get the info out. They can probably do most, if not all, of what you are trying to do.

Although, unless you are trying to do something very specific, energy counters, like the ones power companies use, can do pretty much everything, including interfacing with other devices.

The one my company has installed is Landis & Gyr but I'd have to check the model.

I also have about a dozen electro-mechanical meters which were to be dumped some years ago when they replaced them with the electronic remote control ones.

The old ones have a spinning disk and it would be simple to install a photodiode to check how fast it is spinning. Not to mention that it totals the energy right there. I have several installed in several devices just to check how much appliances use.

Again, it depends a lot on what you are trying to do and whether you are trying to be efficient or trying to have fun designing something.

http://www.ti.com/solution/smart-e-meter-amr-ami
https://www.st.com/en/applications/metering/single-phase-meter.html
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #21 on: July 19, 2019, 12:46:44 am »
There was an IC made by Austria Microsystems for kWh meters but I don't know if it was widely used. It's not uncommon to use a standard microcontroller, a friend of mine did some experiments and using a 8 bit AVR he was able to capture fast enough to digitize a 50/60Hz sine wave and then calculate the RMS, power factor, crest factor, etc. For monitoring the voltage the power transformer powering the device was used.
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4364
  • Country: gb
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #22 on: July 19, 2019, 06:38:29 am »
So the energy meter I have with it's wireless LCD display has no voltage tap, just the current clamp.  So it obviously assumes the voltage waveform.

I realise without a voltage tap I would be left assuming the voltage and current waveforms are exactly the same and thus I would miss account anything with a power factor not equal to 1.  That would include inductive loads like washing machines, dryers, fridges, freezers etc.  and capacities loads, which other than start up bursts of most things with capacitors would, I assume not be very common in a domestic setting.

I would also have to sample the current waveform, determine it's peaks, and crossing points to put my virtual voltage waveform in phase with it.

Or I could try and source a transformer that outputs 3V pp AC from 240V RMS mains.  There are ebay modules as I suggested in my original post.  Although any solution would need to be fused to prevent any significant current being able to pass through it, so that in the worst case, of say, a short in the device cannot possibly cause fire.

EDIT:  I do have a little dual tap 18V sealed 100mA transformer and I could always tap it and run it through a divider to get 3V pp.
« Last Edit: July 19, 2019, 06:43:32 am by paulca »
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3595
  • Country: es
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #23 on: July 19, 2019, 07:51:30 am »
I can't see how an energy meter can work without measuring the voltage.

As discussed in another thread, the shape of the voltage is far from being a perfect sine.

And the shape of the current in devices with rectifier bridges is tiny bursts at the peak of the voltage.

To have any kind of accuracy you would need to sample V and I hundreds of times per cycle and then multiply.

And make sure you got them right because using a normal voltage transformer will introduce phase shift in the signal.

This issue is more complex than might seem at first sight.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline paulcaTopic starter

  • Super Contributor
  • ***
  • Posts: 4364
  • Country: gb
Re: Safest way to measure AC mains 220-250 voltage?
« Reply #24 on: July 19, 2019, 10:25:25 am »
But you are assuming a very high level of accuracy.  A home energy monitor is probably not that accurate.  it might be out of 10% of so. 

I can't find a link to the one I have, but here is an example similar to it:
https://www.amazon.co.uk/Micro-CM180-Wireless-Energy-Monitor/dp/B007W0SQ3Y/ref=lp_1938287031_1_16?s=diy&ie=UTF8&qid=1563531804&sr=1-16

You will note it only has a current clamp.  So unless it can measure voltage via that and not just current, then it is assuming the voltage waveform.

If you google you will find dozens of similar devices with a current clamp and a transmitter.  Some integrate with smart home monitors, some with battery powered LCD displays.
"What could possibly go wrong?"
Current Open Projects:  STM32F411RE+ESP32+TFT for home IoT (NoT) projects.  Child's advent xmas countdown toy.  Digital audio routing board.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf