Community
OpenEnergyMonitor

Community

Can EMON tell if current flow has been interrupted on a circuit?

Tags: #<Tag:0x00007fa335a7a438> #<Tag:0x00007fa335a7a2f8>

Hello, I have 0 experience.
I am working on a project to measure current across all of my homes circuits (that feeding the over, the lights, the garage door etc.) I only want to tell whether the power is on/off, so that I can automatically detect an outage on a circuit.

I have the impression that to do this I will need to attach a CT to every single circuit?
Given that the maximum CT clamps you can attach is 4 I thought this might not be feasible?

Could someone tell me if I can get this function to work with just 2CT and an Emon device?

Thank you

Hi Yann, welcome aboard.

A CT will not necessarily detect an outage, unless used on a circuit that always draws current. The CT will only indicate the level of current and from that the power is determined, a circuit that is switched off but still live will appear the same as a circuit during a power outage ie 0 amps 0 power.

It is the voltage that you need to detect for recognising an outage. The emonTx does have an AC detection circuit, so you could sense a single AC circuit, although you are limited to those circuits that have sockets to accomadate your wall wart unless you use another sensor style (eg hardwired component transformer.). With the emonTx, you then have to look at an alternative battery or UPS 5v power supply because it gets it’s power from the AC:AC adatpter usually. So when the circuit in question is not powered, the emontx will not be able to report that unless there is an alternative power source.

There have been various other ways of sensing if a circuit is simply on or off here on the forums (mainly the archived forums IIRC), my favourite is simply to use a mains neon and a light sensor taped together, this gives you a level of isolation, mandatory when sensing mains AC.

And that, when combined with an Arduino with multiple inputs (therefore not an emonTx), would allow you to monitor many individual circuits very cheaply.

But Paul’s point about power is important: If power to your monitoring device fails, you will never know about it.

Ah wow right I hadn’t even thought of that.
If it’s not too much to ask, could you help me understand what hardware I’ll need to achieve my goal? “Identifying outages on an electrical circuit.”
I’d like to identify this outage not on the mains but the individual circuit the problem has occurred on.
I did not quite understand whether the EmonTx would be the best choice? Especially given Roberts comment below.
I’d be glad to get in touch via e-mail too! As this is pretty hard for me to get my head around haha

Best wishes, Yann

I think an emonTx is probably a poor choice - but we shall see.

What you need to do first is decide what you actually want to achieve.

So:
What is an outage? Is it a blown fuse or a tripped circuit breaker that you are worried about?
How long must the outage last before you want to know about it?
How many circuits do you want to monitor? Do they all come together at the same place, e.g. are they outgoing ways from your distribution board?

We prefer not to do that. It might be the case that someone at some time in the future wants to do exactly the same thing, then they can search for and read this thread, and they will be very happy (we hope).

Great. And good thought on the thread.
So update:
I want to know whether a circuit breaker / differential circuit breaker is in ON or OFF mode.
I want to know this for every circuit inside my distribution board.
I’d like to identify why the breaker turns off (but that’s not a priority right now; all input is much appreciated)

I am thinking of using the following set up:
Attach a Magnetic Probe Tip to each breaker to see whether there is tension
Attach all probes to the Arduino (applying a resistance that brings down my voltage)
When there is no tension on a circuit, have the Arduino trigger a notification for it.

I’m still unsure whether this setup will be practical, given that it’ll require close to or more than 20 Probes and hence a lot of wiring.

For your personal safety, you cannot connect your Arduino or any other electronic device directly to mains electricity. You MUST use something like the neon lamp and light sensor so that there is no direct electrical connection, as Paul (pb66) said. The cost in money is small. If you do not do as we recommend, it could cost you your life, or the life of one of your family.

"I’d like to identify why the breaker turns off"
If you are using the voltage, you will never know whether someone has turned it off or whether it has tripped. You must continuously measure current, most likely for every breaker, in order to know that. When the voltage disappears, you must analyse the current for a period of time - tens of seconds - before the trip to determine whether it was a continuous overload - meaning the breaker was tripped by the thermal element, or whether it was an instantaneous overcurrent - meaning the breaker was tripped by the magnetic element. This will mean a current transformer on every circuit and some very clever software, and that means a processor with at least one analogue input for each circuit. In reality that means at least two of the most powerful Arduinos, because you must continuously measure the current in all 16 inputs. Our emonTx/Arduino Uno can only measure 4 currents plus one voltage - 5 in all. If you try to connect any more, it will not run fast enough to measure the current in a short circuit before the breaker trips.

For a processor, I think you need an Arduino Mega or Arduino Due. Those have enough Digital I/O pins for many more than 20 circuits.

In your software, you will need to scan every sensor input at least 200 times per second, and if the light is off for more than 20 ms continuously, then you can say the breaker is open.

Uses the same 328 microcontrolller the Arduino Uno does.
Given that, would it still be a viable choice?

According to
https://learn.sparkfun.com/tutorials/arduino-comparison-guide/totally-tabular
the Arduino Mega 2560 R3 has 54 DIO, but I doubt whether it would do the analogue currents as well, if Yann decides to go ahead with that aspect.

I had a similar problem to solve and happened across a different solution, although it’s a bit bespoke to my setup and may not work for yours. We have a tariff here known as “T33 - Controlled Load”. The grid manager remotely turns that meter on/off throughout the day to help balance their peak loads. Loads connected to that meter must be hardwired so you can’t game the system by just plugging it in elsewhere when they turn it off. It’s ideal for loads that you don’t much care when in the day they run. From memory I think they guarantee it will be powered for at least 18 hours per day and they rarely change the run times from day to day - only during grid emergencies, and perhaps twice a year to change between winter and summer settings. I’ve got my pool and hotwater (mostly solar thermal) boost connected to it.

I wanted to log when it was energised, mostly so I could program the pool timer around it but there was no easy way to directly measure the voltage. It turns out the first component in the pool plant (hardwired as per the regulations) is a small thermal safety cutout box with a green LED to show when it’s operating normally. That box draws just enough current that I can use it to determine when the meter is energised:

That in turn lets me create a T33_ON feed/LED based on a 16mA threshold on that circuit:

And with a bit of emoncms maths:

I can create a T33_VOLTS graph - only because I know my T33 volts are the same as my T11 (always on) volts:

So if you have enough always-on devices on your circuits of interest, and they’re reactive enough even when not being used, you may be able to deduce whether the circuit is energised by looking at the Irms reading.

Safety instructions are very much appreciated!
I’ve gotten a bit confused, since you mentioned earlier that if I just measure current I won’t be able to tell if the breaker is off or that there just isn’t any power being drawn?
If I’ve understood you right you recommend measuring current on each breaker as well as voltage, and using those two inputs to determine what the cause of the breaker OFF position is?
Is there a way to do this with one sensor? Or will I need two different ones?

As for the Arduino Mega, I didn’t understand your point about “whether it would do analogue currents as well”. I thought I could attach either a current or voltage sensor to the DOI and have the analogue input translated to digital by the ADC?

Best, Yann

Yes, that is exactly right. If there is a break in the circuit anywhere - either a control switch or the breaker, no current will flow. All you know then is there is no current, you have no means to find out why.

Yes. Voltage will tell you if the breaker is open or closed. Current before the breaker opens should normally give you an indication why. (E.g, zero current immediately before the breaker opens means a manual opening.)

No, you need both, if you want to know why.

There might not be enough power in the processor to do both tasks. The Due is much more powerful and I think that would be able to carry out both tasks - but if you want to measure the current on each circuit, you will need two. Measuring current on many circuits simultaneously and sampling quickly enough to catch and analyse a fault will require a lot of processing power. But I’m not an Arduino expert, so I could be wrong.

Okay great. Very happy with the response format, super clear.
So:
To sense current I should take a CT clamp?
To sense voltage I should take …?

The CT clamp will connect to my breaker phase and have two wires, I’ll connect them each to an Arduino DOI?
The voltage “sensor” will connect to … and have two wires? and I’ll connect them each to an Arduino DOI?

Hope that’s clear. Thank you for the help again.

What @pb66 Paul suggested - a neon lamp and a photo-receptor. Hopefully, he’ll be along and give you the components he used, and how to wire it.
(I know how I’d do it, but as he’s done it and it works, why re-invent it?)

Not quite. You thread the outgoing wire from the breaker through the centre hole in the c.t. The two wires from the c.t’s secondary winding need to go to a conditioning circuit exactly like we have inside the emonTx, then to the analogue input of your Arduino. You can either look at the circuit diagram of the emonTx, or at Learn→Electricity Monitoring→CT Sensors→3. Interfacing with an Arduino→CT Sensors - Interfacing with an Arduino. You’ll need to assemble the components for that on a separate prototype circuit board - my favourite is stripboard. You can save many components if you supply the mid-point bias voltage like this: Learn→Electricity Monitoring→Current & Voltage→5. Buffered Voltage Bias→Buffered Voltage Bias

I read about it many many moons ago and tried it out a couple of years ago for a specific test, I actually used short pieces of rubber hose and pushed the neon and LDR into each end, I think the article I read used a cut up Bic pen body IIRC. If I did it again I would probably just use a ridged heat shrink tubing to hold the neon and LDR, that way it could be a pretty tidy device with just 2 wires hanging out each end of a piece of heat shrink tubing.

As for the components, I just used a neon I had kicking around and ordered a LDR off ebay. At the time I used a ADC input so it was fairly adjustable in software, next time I would probably play with the pull-up/down resister and try and get a output level that can be read directly by a digital input.

I think you would probably be far better informed about what are the correct component values, I would resort to a bit of web searching mixed in with a bit of trial and error if I had too. The only thing that immediately springs to mind is get the lowest power neons you can, a handful of them running 24/7/365 can add up, most common are 250mW but I’ve seen some readily available 120mW so that halves the consumption (and heat) straight off.

The test circuit I did previously was actually wired across switch terms to report the switch activity using the line feed to the switch and finding a path to neutral via the load, so the neon was only lit when the switch was off, that approach probably cannot work in this instance since the load would need to be permanently connected and switched on to provide a path to neutral if the CB is tripped or manually switched off. If the circuits had reliably permanent loads then a simple CT would suffice and no neon+ldr would be needed, so it has to be assumed that all neons will be lit permanently unless there is a fault condition (open CB).

I just did a quick bit of searching and found these to start with

https://cpc.farnell.com/sli-ebt/16-50sb/neon-lamp-6mm-wire-ended-standard/dp/SC00436

https://cpc.farnell.com/advanced-photonix/nsl-19m51/light-dependent-resistor/dp/RE05271

The neon datasheet says a 330K resistor is needed for 240VAC operation, maybe

https://cpc.farnell.com/multicomp/mf25-330k/resistor-0-25w-1-330k/dp/RE04995

you could probably get away with a 0.125W but perminantly in use and wrapped in heatshrink, I would stick with 0.25W and metal film have a more stable temp coefficient ?

As for the pull-up/down resister I would need to read up or resort to trial and error (or both!) to try and get the switching level right for a DIO (and that value would be different for a 3V3 or 5V MCU too), but I would again go for a more stable type of resistor if mounting within the heat shrink, we don’t want false triggers due to temperature changes and resisters are so cheap you don’t need cheap resisters.

Is that anything like what you had in mind?

That’s very much what I had in mind. But my real hope was that you had known-to-work component part numbers and values. I’ll try to work out how much light you get out of a neon, but I rather think it’s got to be trial and error, and it’s going to be heavily dependent on how the neon lamp and LDR come together. End-on - not so much, maybe white sleeving could be used inside the heat-shrink tubing?

The emonGLCD has one of these:
https://www.mouser.co.uk/ProductDetail/SparkFun/SEN-09088?qs=WyAARYrbSnbNBfpKra%2FIvQ==

Not having either of the components @pb66 mentioned, I used the first neon lamp I came across (it happened to have a 680 kΩ series resistor attached) and the LDR in an emonGLCD.

With those two coupled together by a tube of Blu-tack (the CdS cell looking at the end of the neon), I got this picture:

The highest ‘dark’ or ‘off’ voltage [S] is 180 mV, or 0.054VCC;
the lowest ‘light’ or ‘on’ voltage [E] is 1.38 V, or 0.418VCC.

In the emonGLCD, the series resistor is 10 kΩ:
1

That means that the ‘light’ resistance ≈ 14 kΩ, and the ‘dark’ resistance ≈ 173 kΩ.

The 10 kΩ series resistor is clearly too low in value for this application - the Atmel data sheet (for the '328P) gives the lowest voltage guaranteed to be seen as a logic ‘high’ as 0.6 VCC.

By my calculations, for this application the series resistor needs to be at least 24 kΩ, I’d suggest 27 kΩ, but no higher than 33 kΩ, because the maximum voltage guaranteed to be recognised as a logic ‘low’ is 0.2VCC and 33 kΩ should give about 0.16 VCC ‘dark’.

The CdS cell has quite a slow response, which makes the software a lot simpler - there’s no need to check every half-cycle of the mains, the input can be checked a quickly or as slowly as you wish.

Unfortunately not.

I hadn’t really thought about it much when I first tested it, and when it worked had no reason to question it, but yes, end on might not be the brightest idea :slight_smile: But I do like the “2 wires hanging out each end” approach to keep things safe and easy to understand the arrangement.

The neon I used was just pulled from a fused spur type switch so I have no idea what value it was or how bright it is compared to others.

My thought on the “tube” was that there was no where else for the light to go and zero chance of any ambient light.

Good idea, white would aid directing the light to the LDR, you can get stiff white heatshrink sleeve so it can possibly still be done in one layer.

I found the same thing, IIRC I just checked it once before sending (every 5-10s?).

If it’s “Sparkfun” there should be oodles of blogs, posts and guides on using it in different scenarios I would of thought?

Quite so - that’s how I set it up, and as I got meaningful results I didn’t try any other way, for exactly the same reasons.

But no credible data sheet that I could find, so we’ve no idea how far individual devices might deviate from the value I measured, or indeed how representative the one I measured is. It would seem that “select on test” for the resistor will be the only guaranteed method using that device.

No idea how “credible” this one is but did you see https://cdn.sparkfun.com/datasheets/Sensors/LightImaging/SEN-09088.pdf

from this page (https://www.sparkfun.com/products/9088) where the features are listed as

  • Light resistance : ~1k Ohm
  • Dark resistance : ~10k Ohm
  • Max voltage : 150V
  • Max power: 100mW* 2 x 4 x 5mm
  • 4mm between pins
  • 31mm lead length

Although that datasheet states it is in fact a a GL5528 part, that part number turns up a different datasheet https://static.rapidonline.com/pdf/58-0134_v1.pdf (from https://www.rapidonline.com/truopto-gl5528-light-dependent-photoresistor-58-0134) and also this https://www.kth.se/social/files/54ef17dbf27654753f437c56/GL5537.pdf.

Wow! You can also buy them £1.30 for 20 pieces (6.5p each!) incl postage! (the usual risks apply when buying this way of course)