Author Topic: AC current detection (not measurement)  (Read 12340 times)

lukash

  • NewMember
  • *
  • Posts: 11
  • Country: us
AC current detection (not measurement)
« on: March 11, 2016, 09:23:58 AM »
Hey everyone!

I'm trying to make a sensor that would detect if an appliance is running by detecting current in the wire to the appliance. I don't need to measure how much current the appliance is drawing, I just want to detect if it's ON or OFF.
I want this to be contact-less .. I want to monitor basic home-like 120V single-phase things up to stuff in our wood shop (2 or even 3-phase devices (table saw, planer, jointer)). So I don't want to mess with high voltage.

Solutions I came up with and their drawbacks:

Current transformer
PROs: very reliable, precise, can even measure, contactless
CONs: can't just attach it to the cable itself, has to sit on hot (or neutral but not both) wire (as there is neutral and hot running in same cable and they cancel each other out, so CT shows nothing)

EMF reading
PROs: no wire stripping, contactless
CONs: unreliable? I haven't found a good-enough EMF reading sensor (or a technique I wouldn't have to spend weeks on tweaking) to be sure this won't be triggered by random interference.

I want to keep this as simple as possible and I'd like to just stick something to the 3-wire cable (hot, neutral, ground) and detect electromagnetic field in it to know the appliance is on.

IMHO EMF reading is best for this - anybody seen something better than a 2Mohm resistor and a wire to analog input of arduino and yet not a 2-month project thing?  ::)

I think this might be a nice addition to the home-automation in general and will be more than happy to try to make this a moteino-shield design.

Thanks!
Lukas

ssmall

  • Full Member
  • ***
  • Posts: 158
  • Country: us
Re: AC current detection (not measurement)
« Reply #1 on: March 11, 2016, 10:00:52 AM »

lukash

  • NewMember
  • *
  • Posts: 11
  • Country: us
Re: AC current detection (not measurement)
« Reply #2 on: March 11, 2016, 10:14:35 AM »
Both of these solutions use Current Transformers which require measuring current on a hot OR neutral but won't work on a cable with all 3 wires in one cable scenario :-\

Thanks for the pointers though, I appreciate it. If we won't come up with anything better I guess I'll go with that, but it makes the whole solution not so user-friendly  :(

I'd love to have tom EMF probe that just sits on a 3-wire cable without any stripping or otherwise altering the wiring of the appliance itself.

emjay

  • Full Member
  • ***
  • Posts: 119
  • Country: nl
Re: AC current detection (not measurement)
« Reply #3 on: March 11, 2016, 12:01:44 PM »
@lukash,

A C.T. is useless if you can't easily break out a single conductor to monitor and connecting up to sense the V will pose a safety hazard. You can try the this technique https://moderndevice.com/product/current-sensor/ - it uses the fact that very close to the conductors, the flux doesn't sum to zero.

john4444

  • Jr. Member
  • **
  • Posts: 71
  • Country: us
Re: AC current detection (not measurement)
« Reply #4 on: March 11, 2016, 02:02:57 PM »
Hi Lukash,
Modern Device makes a "non-contact" but tie-wrap-on current sensing device.
see: https://moderndevice.com/product/current-sensor/
It would not be very precise for current measurement but looks as if it would work for detection.

WhiteHare,
The Home Depot type voltage sensors are very unreliable and prone to lots of false signals.
I don't trust them for verifying that the household power is off.
I've been lied to a couple of times by those devices.
John AE5HQ

lukash

  • NewMember
  • *
  • Posts: 11
  • Country: us
Re: AC current detection (not measurement)
« Reply #5 on: March 11, 2016, 02:27:15 PM »
Very cool! ;D

They even share a schematic: https://moderndevice.com/wp-content/uploads/2012/11/MD_CurrentSensorSchematic.pdf
Some additional explanation about 3.3V circuits: https://moderndevice.com/uncategorized/the-modern-device-current-sensor-at-3-3-volts/

And last but not least, this is what they use there: https://moderndevice.com/product/a1324-hall-effect-sensor/
They even say in the description the sensor itself seems to be enough to detect if a 100W bulb is ON or OFF ..

Ordered both, will give it a try to see if the A1324 itself can be "precise" enough even for smaller loads.

Will report back on my experiences.

lukash

  • NewMember
  • *
  • Posts: 11
  • Country: us
Re: AC current detection (not measurement)
« Reply #6 on: March 11, 2016, 02:37:26 PM »
would you mind linking to some of those sensors? Not quite sure if I know what devices you mean .. I'd be curious what they use for detection, so I may just run to home depot and get a few to break them while modern devices stuff arrives :-)

emjay

  • Full Member
  • ***
  • Posts: 119
  • Country: nl
Re: AC current detection (not measurement)
« Reply #7 on: March 11, 2016, 06:38:32 PM »
I thought the objective was to detect a running appliance?  If only the power cord is accessible, then usually you need to know that current is flowing - voltage present doesn't get you very far.  And voltage is what most of those "find the wires in the stud wall" devices are about.  High gain amp, peaked for 50/60Hz, capacitive pickup, level comparator.

msjfb

  • NewMember
  • *
  • Posts: 28
  • Country: ca
Re: AC current detection (not measurement)
« Reply #8 on: March 12, 2016, 10:34:07 PM »
Here is an interesting read on current detection:
https://users.ece.cmu.edu/~agr/resources/publications/buildsys-10.pdf

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: AC current detection (not measurement)
« Reply #9 on: March 12, 2016, 10:45:01 PM »
Here is an interesting read on current detection:
https://users.ece.cmu.edu/~agr/resources/publications/buildsys-10.pdf
@msjfb, Thanks for the post.

From the paper:
Quote
We show that accurately detecting 100W loads from 10 cm away is possible while maintaining multiple-year battery life from a coin-cell battery.
Ok Joe, the gauntlet's been thrown.  You'll need to do multi-decades now!

Tom

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: AC current detection (not measurement)
« Reply #10 on: April 01, 2016, 11:08:14 PM »
Very cool! ;D

They even share a schematic: https://moderndevice.com/wp-content/uploads/2012/11/MD_CurrentSensorSchematic.pdf
Some additional explanation about 3.3V circuits: https://moderndevice.com/uncategorized/the-modern-device-current-sensor-at-3-3-volts/

And last but not least, this is what they use there: https://moderndevice.com/product/a1324-hall-effect-sensor/
They even say in the description the sensor itself seems to be enough to detect if a 100W bulb is ON or OFF ..

Ordered both, will give it a try to see if the A1324 itself can be "precise" enough even for smaller loads.

Will report back on my experiences.

@lukash Did you have a chance to try it yet, and if so, how well does it perform?

syrinxtech

  • Sr. Member
  • ****
  • Posts: 347
  • Country: us
    • Syrinx Technologies
Re: AC current detection (not measurement)
« Reply #11 on: April 11, 2016, 11:08:16 AM »
I recently ordered one of the Modern Device units.  It seems to perform as advertised.  We tested it with a lamp and several other househould appliances.  As others have mentioned it works great as detection but I wouldn't trust it for measurement.

Hopefully we can figure out a way to attach without having to tie wrap it to the power cord. 

lukash

  • NewMember
  • *
  • Posts: 11
  • Country: us
Re: AC current detection (not measurement)
« Reply #12 on: April 13, 2016, 02:01:20 PM »
@WhiteHare - yes, the moderndevices sensor seems to perform quite well.

But i'm not 100% satisfied with it, it draws a lot of current, 10mA on 3.3V, 15mA on 5V. And it costs $19.
We need couple sensors for our shop (maybe 10 or more) and this is unnecessarily expensive. Also I'd like to post my finished sensor and hopefully go as far as shield for moteino, so I'm trying to make it as good as possible.

With some op amp(s) and an inductor (like it's described in the "Contactless Sensing of Appliance State Transitions Through Variations in Electromagnetic Fields", https://users.ece.cmu.edu/~agr/resources/publications/buildsys-10.pdf) I can get down to about 580uA of current which is awesome.

The problematic part is I have not made it work reliably just yet ;D Have been studying hard for past week a lot of trial and error but it's still pretty random.

I'll post back about the progress - I believe the opamp(s)+inductor is the best solution to this, I just have to figure it out.  :-\

If somebody would like to help out I'll appreciate that ::)

Lukas

lukash

  • NewMember
  • *
  • Posts: 11
  • Country: us
Re: AC current detection (not measurement)
« Reply #13 on: April 13, 2016, 09:59:28 PM »
Good news! Got some progress :)

I wired up instrumentation amplifier (home-baked, did not have any in-chip ready, I've used MCP6004, later tried swapping it with LM324 .. also works but MCP6004 seems to be a bit better):



I've found not all of the inductors work well, I've got some 1mH, some 10mH .. and the value is not the attribute :) my 10mH inductors have only very few windings using kind of thick wire, while the 1mH use very thin wire and a lot of windings .. those work better. well, they work. The 10mH basically don't.

This is a measurement with an extension cord next to the inductor but no current being drawn (so only electrical field is present):

  • yellow channel is directly on the inductor - pin 5 of the op amp on schematics
  • purple channel is the output of the op amp (marked OUT on the schematics)



and this is with 60W bulb plugged into the extension cord:



Now I just need to circuitry going so that this can be fed directly to some digital input + add a trimmer to set the gain of the amplifier .. or maybe this can be fed into an analog pin and the threshold can then be set in software, not yet sure what's better.
« Last Edit: April 13, 2016, 10:01:27 PM by lukash »

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Re: AC current detection (not measurement)
« Reply #14 on: April 14, 2016, 08:07:28 AM »
This looks promising.  Good job.

One question, are you sure channel 3 had a 1X probe?  It seems as if the output is clipped on the low side, as if the op amp ran out of head room, which might be the case with 2.1VPP rather than 0.210VPP...

Tom

lukash

  • NewMember
  • *
  • Posts: 11
  • Country: us
Re: AC current detection (not measurement)
« Reply #15 on: April 14, 2016, 03:33:34 PM »
Not 100% sure so I measured again .. now it's 100% sure 1X probe with 1X compensation .. but it's very similar, I think the "problem" yesterday was that I shifted channel 3 to the bottom part of the screen so the measurements on top would not cover it (see where the little arrow with 3 is on the left - that's middle/zero of channel 3).

Here are some more pics from today..

1. No load


2. Extension cable w/ 60W bulb - about 1/2 inch away from the inductor


3. Extension cable w/ 60W bulb - very close to inductor


I also ordered some 10mH and 47mH inductors with a lot of windings, the publications said it might provide better distance, this has to be quite close. INA now has gain of about ~910 .. maybe I can even raise that .. some fine tuning will be needed  :)

What I'm trying to achieve now is to map that AC signal of 20mV - 150mV approximately to DC 0-3.3V so we can read it with analog input of moteino .. ideas for something easy? It'd be perfect if it was possible to do with just on op-amp (the remaining one of the quad MCP6004), we'd just have that opamp and that's it.

damonb

  • NewMember
  • *
  • Posts: 26
Re: AC current detection (not measurement)
« Reply #16 on: April 14, 2016, 06:39:24 PM »
You might find the current article series at JeeLabs of interest:
http://jeelabs.org/2016/04/analog-explorations/
http://jeelabs.org/2016/04/real-op-amps/

mikebar

  • NewMember
  • *
  • Posts: 2
Re: AC current detection (not measurement)
« Reply #17 on: July 17, 2019, 04:35:37 PM »
Hi Lukash, did you go any further with this project ? Have you connected it to an ADC? If so, could you share the schematics?
Thank you very much.

lukash

  • NewMember
  • *
  • Posts: 11
  • Country: us
Re: AC current detection (not measurement)
« Reply #18 on: July 17, 2019, 05:27:51 PM »
Hey Mike,

unfortunately life happened and I was not able to finalize this as far as I'd like. I hope I can add "yet".

I have made it to revision 0.3 :D Made a prototype board, got a few pieces from OSH park, assembled the prototype and it seemed to be working except one caveat I did not manage to debug due to lack of time (and skill I think too, lol).

The caveat being once AC current triggers the second opamp (output high) and it (sometimes) keeps the output high even after the AC current from the coil is gone - not quite sure why, to be honest I don't exactly remember that much anymore.

I have found the schematics + the board (Eagle .sch and .brd files) + BOM I made at the time and shared it on my Google Drive here: https://drive.google.com/drive/folders/0B_Qu9F7qJpuHNVlERmVCNGdpRnM

If you'd spot the bug and/or improved the design I'd really appreciate if you let me know, either here or lukash@backstep.net, also feel free to write me if you have questions, I'll answer what I'll be able to remember. I'd love if this could be finalized as I still do plan to use it in the future in my woodworking shop to turn on dust collection automatically.

Have fun!

mikebar

  • NewMember
  • *
  • Posts: 2
Re: AC current detection (not measurement)
« Reply #19 on: July 20, 2019, 08:59:30 AM »
Thank you for sharing it.
I'll give it a try to see what's going.
What I'm trying to do is a "sensor" able to feel the 50Hz (or 60Hz) from a powered solenoid valve.
Of course, I cannot touch the wiring of the solenoid and not even use a Clamp type Current Transformer (CT).
So, the only option left is to catch the AC "noise" from the solenoid when it is powered.
If you have any idea, it will be really appreciated.
Thank you.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6867
  • Country: us
    • LowPowerLab
Re: AC current detection (not measurement)
« Reply #20 on: July 21, 2019, 06:50:41 PM »
How about this?