LowPowerLab Forum

Hardware support => Projects => Topic started by: Roger2016 on October 26, 2016, 10:24:34 AM

Title: How about developing a PlugMote? [solution]
Post by: Roger2016 on October 26, 2016, 10:24:34 AM
How about a Moteino version of this ancient X10 plug module?

http://www.smarthome.com/x10-am466-x10-3-pin-appliance-module.html?src=Froogle&gclid=Cj0KEQjwqMHABRDVl6_hqKGDyNIBEiQAN-O9hNWGF0XjACoRonq2G6obIkh2-GwdtaC5gwZ66SBtJbAaAjMh8P8HAQ

I've used X10 for decades, but I've always had reliability issues.  Especially recently with CFL & LED bulbs I suspect are adding noise to the power line.

It would be cool to have the ability to control & log data, have 2 way communication to verify the device actually turned on.  While you are at it add a current sensor to log the power draw.  Seems like a reconfigured SwitchMote would do the trick.  Keep the button to add local control.
Title: Re: How about developing a PlugMote?
Post by: Felix on October 26, 2016, 10:57:13 AM
It would be cool to have the ability to control & log data, have 2 way communication to verify the device actually turned on.  While you are at it add a current sensor to log the power draw.  Seems like a reconfigured SwitchMote would do the trick.  Keep the button to add local control.
Not sure what you mean by "Reconfigured".
Switchmotes can already do all that, except the power draw logging. That's a whole different can of worms and it's a hard problem to do right and put in a tight neat package. Doing it the crude way with CTs for measuring current and a voltage transformer for Voltage means this won't fit inside a single product case. Doing it with a shunt and voltage dividers is more feasible but many will object to that for various reasons, not safe etc.
That's why I didn't try to overengineer the SwitchMote to attempt power monitoring since it was going to add a lot more complexity and cost, would not be so DIY friendly with all through hole parts.

I think a compromise would be to add a separate mote that just measures the power, a sort of inline plug. Many ways to approach this, all have their pros and cons.
Title: Re: How about developing a PlugMote?
Post by: Roger2016 on October 26, 2016, 11:04:41 AM
I totally understand about the power measurement.

What I mean by reconfigured is a device like I linked above were it plugs into the wall and an appliance or light plugs into it as apposed to the switchmote which is mounted in the wall at the switch side.

(http://www.smarthome.com/media/catalog/product/cache/1/thumbnail/64x64/9df78eab33525d08d6e5fb8d27136e95/_/2/.2.jpg)


Title: Re: How about developing a PlugMote?
Post by: Felix on October 26, 2016, 11:39:08 AM
I see what you mean now, yes that would be cool.
Some kind of current sensor (current flowing sensor) should not be too hard to add in that case however it might not be very accurate.
The challenge with this type of device is finding an off the shelf case with the mains pins ready to plug or solder into a PCB.

An afterthought is that you can do this today in a different way:
Go to home depot and buy a standard 2 plug electrical box and plug socket with cover. Inside you can place a SwitchMote2x10A PSU including Moteino for wireless control. The input can be a standard cord to the supply plug. The output is wired/screwed to the two input plugs. Then you have 2 controllable plugs. Not super aesthetic but I guess you could mount this in the wall directly too.
And if you get a double size box, the face plate of the SwitchMote with 3 buttons and status LEDs could mount into that other slot. So that way you can control them locally also. Very doable :)
Would look like this, two buttons could control the plugs, the other would be general purpose:

(http://i.imgur.com/ppzWT6L.png)
Title: Re: How about developing a PlugMote?
Post by: WhiteHare on October 26, 2016, 12:03:38 PM
I use this:  https://www.amazon.com/Iot-Relay-Enclosed-High-power-Raspberry/dp/B00WV7GMA2/ref=lp_8313265011_1_1?srs=8313265011&ie=UTF8&qid=1477497774&sr=8-1

There's also this:  https://www.amazon.com/POWERSWITCHTAIL-COM-PowerSwitch-Tail-II/dp/B00B888VHM/ref=sr_1_2?ie=UTF8&qid=1477497751&sr=8-2&keywords=POWERSWITCHTAIL.COM

Either one is easily controlled by a Moteino, though neither is as compact or as fully integrated "out of the box" as what the OP is suggesting.
Title: Re: How about developing a PlugMote?
Post by: perky on October 26, 2016, 12:23:08 PM
Microchip do power sensors such as MCP3905, there's even a dev kit for it:
http://www.microchip.com/wwwproducts/en/MCP3905
Mark.
Title: Re: How about developing a PlugMote?
Post by: Felix on October 26, 2016, 01:29:36 PM
Here's a mockup I've done with a SM2x10A and double plug:
And the video of putting this together in a post below.

(http://i.imgur.com/qZ0OWIm.png)
Title: Re: How about developing a PlugMote?
Post by: Roger2016 on October 26, 2016, 01:45:58 PM
Thanks All, 

I think for now I'll start with a DIY Similar to Felix's suggestion.  The Whitehare solution is so close, but too bad they don't have 5V out to power the Moteino.

That MCP3905 looks interesting Mark.  I'll have to read the data sheet,  I would like to add a load logging/metering device to my Bridgeport CNC Mill.  I'd like to measure & Log the RPM and load to see if the spindle slows at all when taking heavy cuts.  With CNC everything goes so wrong so fast, if you aren't data logging all you know is you trashed the tool, the part or usually both.  So Many projects!  and they quickly exceed my skill level.  I'm an "electronics wanna be" Never had a class.

Felix,  No doubt you can conjurer up a nice clean solution. 

I wonder if I coulden't just hack an X10 module to be controlled by a Moteino?

Thanks All, but I better get back to work and stop thinking about this stuff for a few hours.
Title: Re: How about developing a PlugMote?
Post by: Felix on October 26, 2016, 01:56:35 PM
Felix,  No doubt you can conjurer up a nice clean solution. 

I wonder if I coulden't just hack an X10 module to be controlled by a Moteino?
I was thinking more of the ACS712 sensors, see this instructable for a suggested implementation: http://www.instructables.com/id/Simplified-Arduino-AC-Current-Measurement-Using-AC/?ALLSTEPS
Many others out there.
Oops this is for DC not AC :P
Here's TomWS's excellent AC 'honest' load monitor: https://lowpowerlab.com/forum/projects/wireless-four-channel-'honest'-rms-ac-power-monitor/
(https://lowpowerlab.com/forum/projects/wireless-four-channel-'honest'-rms-ac-power-monitor/?action=dlattach;attach=556;image)


Even this type of compact CT sensor might work OK and it's non invasive: http://www.kr4.us/non-invasive-current-sensor-30a.html?gclid=CMWRoe6D-c8CFQyEaQodMTcAEg


In terms of X10 - no experience with that at all, if it offers a 5V and tap into it's relay control, then you may be able to do it.
Title: Re: How about developing a PlugMote?
Post by: WhiteHare on October 26, 2016, 03:16:21 PM
The Whitehare solution is so close, but too bad they don't have 5V out to power the Moteino.

A lot of people have complained about that.  If you read the buyer comments on Amazon, there's a way to modify it so that one of the outlets is always on.  Then you can plug-in a DC power source to that to run your Moteino.  It's functional, but I wouldn't call it streamlined.

You may also want to look at JoeLucid's foot warmer project.
Title: Re: How about developing a PlugMote?
Post by: Roger2016 on October 26, 2016, 03:39:11 PM
Of course, but that's just clunky!  They probably already have 5v internally already to run the switching.  Hate seeing products get so close, but not quite!
Title: Re: How about developing a PlugMote?
Post by: Felix on October 28, 2016, 10:43:08 PM
Ok and here's my solution:

Title: Re: How about developing a PlugMote? [solution]
Post by: TomWS on October 29, 2016, 09:05:21 AM
ISTM that a SwitchMote with an ACS712 would do the trick.  The ACS712 can measure AC currents and provide 2.1KV electrical isolation (when fabbed correctly).  Zero current output is VCC/2 so you can measure AC current relative to the midpoint value.  I use the ACS712 in my DC (Dust Collector) Remotes posted somewhere on this forum...

Tom
Title: Re: How about developing a PlugMote? [solution]
Post by: Roger2016 on October 30, 2016, 07:58:53 PM
Felix,

I'll be making a couple of these, but perhaps some day you can design a smaller version.  When you have nothing else better to do.

Thanks!

Tom,

That ACS712 looks nice!  Small and inexpensive.  Do you think this would work measuring current for a 2 HP 220 Volt motor on my CNC as a load indicator?

Thanks!
Title: Re: How about developing a PlugMote? [solution]
Post by: TomWS on October 30, 2016, 09:32:10 PM
That ACS712 looks nice!  Small and inexpensive.  Do you think this would work measuring current for a 2 HP 220 Volt motor on my CNC as a load indicator?
Yes and no.  It depends on the accuracy you're looking for.  The ACS712 would easily handle 2HP 220V current range (6-7A), but the tricky thing will be calibrating 2HP induction motor current into %load (or whatever metric you're after).  If you're just looking for a qualitative measurement, then absolutely yes.  If you want to have a direct readout of 'load'... well, you might need to do some work to get this.   

Key is: the ACS712 WILL tell you, at any instant, how much current is flowing through it.  And that current can be easily monitored by an Arduino device as low voltage analog signal with sufficient isolation to be safe and reasonably accurate.  If you can turn that voltage vs time value into something useful, you've got what you want.

Tom
Title: Re: How about developing a PlugMote? [solution]
Post by: perky on October 30, 2016, 10:33:41 PM
As Tom says, power is dependent on 'power factor', i.e. the phase of the current wrt the voltage. If you can measure current and voltage then you can calculate power.
Mark.
Title: Re: How about developing a PlugMote? [solution]
Post by: Roger2016 on October 31, 2016, 08:48:48 AM
Power factor, so basic Amps * Volts = Watts correct. 

to complicate things,  I'm running a Variable Frequency Drive (VFD) to adjust spindle speed.  It's 220V single Phase input and 3 phase output to the motor, so I could measure before the VFD or after the VFD.  Also the frequency I'm running will affect the load.  If I'm running 20Hz my spindle will stall way easier than if I'm running 100Hz, so to be useful I should somehow include Hz into the calculation.  I should also measure spindle RPM to see if i'm loosing RPM.  Nothing is ever easy!
Title: Re: How about developing a PlugMote? [solution]
Post by: perky on October 31, 2016, 09:44:06 AM
Just to be clear, power is instantaneous volts times amps, and total power will need to be averaged over a complete cycle.
Mark.