# Auto-power switch for router?

**URL:** <https://forums.maslowcnc.com/t/auto-power-switch-for-router/406>\
**Category:** Technical Details\
**Created:** [August 7, 2017, 7:04pm UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406 "2017-08-07T19:04:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rich](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/rich/32/253_2.png) [@Rich](https://forums.maslowcnc.com/u/Rich)\
**Post date:** [August 7, 2017, 7:04pm UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/1 "2017-08-07T19:04:36Z")

</div>

Are there any plans to develop a smart power switch so that the Maslow can turn the router off when it’s done? I want to get mine to the point it’s “fire and forget” - but I can’t as long as I have to turn the router off when it’s done.

---

<div class="post-metadata">

**Author:** ![aluminumwelder](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/aluminumwelder/32/9362_2.png) [@aluminumwelder](https://forums.maslowcnc.com/u/aluminumwelder)\
**Post date:** [August 7, 2017, 8:14pm UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/2 "2017-08-07T20:14:12Z")

</div>

I would love to have this happen as well! I have a sound activated relay that I bought off ebay for $5. if the cutting program could make a beep via the headphone jack then it could basically be wired up to cut off the router. [AHK.com](http://AHK.com) could be used to program this easily. problem is I’m not a programmer.

another option is to have a timer switch, but this would only work if you knew how long the cut time was to take, and I dont’ think that is given is it?

---

<div class="post-metadata">

**Author:** ![dlang](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/dlang/32/859_2.png) [@dlang](https://forums.maslowcnc.com/u/dlang)\
**Post date:** [August 7, 2017, 8:16pm UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/3 "2017-08-07T20:16:53Z")

</div>

No, Bar has made the explicit decision that he does not want to control the  
router power for liability reasons.

There are GPIOs available, but using them for this purpose would require changes  
to the firmware, and someone would have to maintain these changes in the face of  
the rapid firmware development that’s taking place.

David Lang

---

<div class="post-metadata">

**Author:** ![TomTheWhittler](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/tomthewhittler/32/29_2.png) [@TomTheWhittler](https://forums.maslowcnc.com/u/TomTheWhittler)\
**Post date:** [August 7, 2017, 8:26pm UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/4 "2017-08-07T20:26:38Z")

</div>

I understand about liability but as long as Bar is not selling a control or including a control in the kits then he would not be liable.

If Bar would allow just one control pin to be used then we could use one of these all-in- one AC/DC control relays at our own peril. (can take 3.3-60 VDC or 12-120 VAC for control signal)

[http://www.ebay.com/itm/AC-DC-control-relay-/253064590101?hash=item3aebd33315:g:6GUAAOSwawVZeLCL](http://www.ebay.com/itm/AC-DC-control-relay-/253064590101?hash=item3aebd33315:g:6GUAAOSwawVZeLCL)

or here is the direct from manufacture link

> **[IoT Relay](https://dlidirect.com/products/iot-power-relay)**
>
> Create the Internet of Things with safe, reliable power control.    Universal control voltage 3-60VDC or 12-120VAC connects to Arduino, Raspberry Pi, PIC or other micro. Or connect directly to a 12V to 48VDC or even 120VAC circuit. High...

---

<div class="post-metadata">

**Author:** ![blurfl](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/blurfl/32/9_2.png) [@blurfl](https://forums.maslowcnc.com/u/blurfl)\
**Post date:** [August 7, 2017, 8:36pm UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/5 "2017-08-07T20:36:00Z")

</div>

There are six control pins! See AUX1-6 on the board. Each position has ground, a gpio pin, and 5V. It will be up to you to add something to control the pin you choose 😉. Pro tip - if you’re using the beta version of the board, don’t use AUX5 or AUX6, as those were connected to the serial Tx and Rx lines. Voice of experience…

---

<div class="post-metadata">

**Author:** ![TomTheWhittler](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/tomthewhittler/32/29_2.png) [@TomTheWhittler](https://forums.maslowcnc.com/u/TomTheWhittler)\
**Post date:** [August 7, 2017, 8:41pm UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/6 "2017-08-07T20:41:43Z")

</div>

So there are extra control pins so this could be implemented. Since Bar put these additional control lines in I presume he was going to have some firmware way to control them.  
Some sort of G-code command would be nice. That way people can add a GCode line to start the router and another to turn it off the after completion on the run.  
I would vote for adding it to the firmware as part of the main fork so the user can decided to implement the hardware control with a pair of simple wires and one of the relays above…

---

<div class="post-metadata">

**Author:** ![grajohnt](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/grajohnt/32/2318_2.png) [@grajohnt](https://forums.maslowcnc.com/u/grajohnt)\
**Post date:** [August 7, 2017, 8:42pm UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/7 "2017-08-07T20:42:04Z")

</div>

I have one of these - should work fine:

> **[IoT Power Relay - COM-14236 - SparkFun Electronics](https://www.sparkfun.com/products/10747)**
>
> Do you want to control a standard wall outlet device with your microcontroller, but don’t want to mess with the high-voltage wiring? The IoT Power Relay

Just use one of the unused pins…

---

<div class="post-metadata">

**Author:** ![TomTheWhittler](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/tomthewhittler/32/29_2.png) [@TomTheWhittler](https://forums.maslowcnc.com/u/TomTheWhittler)\
**Post date:** [August 7, 2017, 8:46pm UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/8 "2017-08-07T20:46:23Z")

</div>

So now we have a least two different I/O controlled switches available and we have available I/O pins.  
Seems like we should see if Bar would implement a control.

---

<div class="post-metadata">

**Author:** ![Rich](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/rich/32/253_2.png) [@Rich](https://forums.maslowcnc.com/u/Rich)\
**Post date:** [August 7, 2017, 9:32pm UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/9 "2017-08-07T21:32:02Z")

</div>

Just a “job done” signal. That can’t come with liability, surely? Then we can use it for anything we like… at our own risk. 🙂

@bar - is that possible?

---

<div class="post-metadata">

**Author:** ![mooselake](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/mooselake/32/6218_2.png) [@mooselake](https://forums.maslowcnc.com/u/mooselake)\
**Post date:** [August 7, 2017, 10:00pm UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/10 "2017-08-07T22:00:18Z")

</div>

SSRs (solid state relays) are available on eBay, Amazon, and elsewhere, no fancy IoT device required. All it would take is a command to toggle the aux lines. Call it light bulb control to avoid liability. Used one to control the spindle on my Zenbot Mini for several years.

---

<div class="post-metadata">

**Author:** ![dlang](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/dlang/32/859_2.png) [@dlang](https://forums.maslowcnc.com/u/dlang)\
**Post date:** [August 7, 2017, 10:02pm UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/11 "2017-08-07T22:02:18Z")

</div>

Remember that the Arduino doesn’t have the concept of ‘job’, it just executes  
lines as it receives them

That said, once there is a way to toggle these aux lines, you can manually edit  
the g-code to use them.

To make it clear to everyone, I think Bar is being paranoid about this and that  
it’s actually safer with a spindle control. I’m just reporting his statemetns  
and policies.

---

<div class="post-metadata">

**Author:** ![TomTheWhittler](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/tomthewhittler/32/29_2.png) [@TomTheWhittler](https://forums.maslowcnc.com/u/TomTheWhittler)\
**Post date:** [August 7, 2017, 10:30pm UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/12 "2017-08-07T22:30:29Z")

</div>

mooselake wrote : “SSRs (solid state relays) are available on eBay, Amazon, and elsewhere, no fancy IoT device required.”

That is true but for less than $30.00 you have a nice package that all you have to do is plug in power, plug in device, and attach two control wires. It is also “Safety CPI tested”.  
I could also build my own out of a SSR but by the time I buy the parts and throw my time at it it will be over $ 30.00.  
I have one of these [IOTRELAY.COM](http://IOTRELAY.COM) relays and it is nicely built. There is no way I could build one that nice. I purchased it with the intent that MaslowCNC router could be controlled at some future date. Now I just have to find some time to put my MaslowCNC together.

---

<div class="post-metadata">

**Author:** ![TomTheWhittler](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/tomthewhittler/32/29_2.png) [@TomTheWhittler](https://forums.maslowcnc.com/u/TomTheWhittler)\
**Post date:** [August 7, 2017, 10:38pm UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/13 "2017-08-07T22:38:15Z")

</div>

So if Bar could implement M4 and M5 to turn on/off spindle (router) as one of the I/O pins controls then all that would be need to be done is to edit ones gcode to control the router.

---

<div class="post-metadata">

**Author:** ![mooselake](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/mooselake/32/6218_2.png) [@mooselake](https://forums.maslowcnc.com/u/mooselake)\
**Post date:** [August 7, 2017, 11:38pm UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/14 "2017-08-07T23:38:54Z")

</div>

$3 for a slow ship or $5 for USA seller, but go with you like best.

Doubt we’ll see Bar do M4/5 but maybe he could consider something like Marlin’s M42. I’d be happy if there was a way in GC to turn the spindle on and only M4 to turn it off. Ianal, but moving a fast spinning bit on a couple chains seems more dangerous than turning the router off and on and we have no problem with that. I’d sign a liability release to get on/off control

---

<div class="post-metadata">

**Author:** ![mdcoley5](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@mdcoley5](https://forums.maslowcnc.com/u/mdcoley5)\
**Post date:** [August 8, 2017, 1:09am UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/15 "2017-08-08T01:09:00Z")

</div>

I’m currently using a SSR on my X-Carve which is controlled by gcode. Best modification I have done so far. However, the X-Controller has specific ports for the wiring.

This design was modeled by Philjohnson and the thread can be found [here](https://discuss.inventables.com/t/main-power-control-box-and-solid-state-relay-control/33634/26)  
.

![image](https://canada1.discourse-cdn.com/flex031/uploads/maslowcnc/original/1X/74a7e3b940a220d887c3bcd77748e9d23d34b50e.jpg)

---

<div class="post-metadata">

**Author:** ![blurfl](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/blurfl/32/9_2.png) [@blurfl](https://forums.maslowcnc.com/u/blurfl)\
**Post date:** [August 8, 2017, 2:01am UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/16 "2017-08-08T02:01:01Z")

</div>

Are M4 and M5 the correct gcodes to use?  
Which AUX line should they associate with - AUX1?  
So M4 would set AUX1 high, M5 would set it low, and the machine would always set it low on a reset?

---

<div class="post-metadata">

**Author:** ![mooselake](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/mooselake/32/6218_2.png) [@mooselake](https://forums.maslowcnc.com/u/mooselake)\
**Post date:** [August 8, 2017, 2:31am UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/17 "2017-08-08T02:31:59Z")

</div>

M3 spindle on CW  
M4 spindle on CCW  
M4 spindle off

Off on reset sounds right. Any port in a storm but it should be easy to solder to.

I like that IoT switch and the multiple outlets, MOV, etc are nice, but the extra cost is a couple of router bits. 3 if they’re Bar’s (anybody try those yet?)

---

<div class="post-metadata">

**Author:** ![blurfl](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/blurfl/32/9_2.png) [@blurfl](https://forums.maslowcnc.com/u/blurfl)\
**Post date:** [August 8, 2017, 4:12am UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/18 "2017-08-08T04:12:09Z")

</div>

Another idea would be to use the Bxx codes specific to the Maslow for the AUX gpios. Something like B2n to turn AUXn off and B3n to turn it on. Bar has used many of the Bxx codes below B12 for program controls, so choosing a series higher up to avoid conflict. This wouldn’t preclude a proper implementation of the M codes later, but could get control of the gpio pins without having to do that.

---

<div class="post-metadata">

**Author:** ![dlang](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/dlang/32/859_2.png) [@dlang](https://forums.maslowcnc.com/u/dlang)\
**Post date:** [August 8, 2017, 4:24am UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/19 "2017-08-08T04:24:59Z")

</div>

we really need both, BXX codes for arbitrary control of all the extra GPIOs, and  
M codes that can be configured to control one of the GPIOs so that systems that  
generate M codes as part of the gcode will ‘just work’

David Lang

---

<div class="post-metadata">

**Author:** ![blurfl](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/blurfl/32/9_2.png) [@blurfl](https://forums.maslowcnc.com/u/blurfl)\
**Post date:** [August 8, 2017, 4:59am UTC](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406/20 "2017-08-08T04:59:32Z")

</div>

In order to achieve directional control like the M3/M4 pair, we’re going to have to wait for additional circuitry. I think the Bxx option will get TomTheWhittler switched sooner 😉.  
Presently the gpios all come up as tristate on reset. I’d suggest we leave them alone unless a Bxx code specifically addresses one, then set that one as an output as the first part of an ‘on’ or ‘off’ command. I don’t believe there is a down side to re-configuring an output as an output - anyone have input on this?

[Next page](https://forums.maslowcnc.com/t/auto-power-switch-for-router/406.md?page=2)
