Tool Enable - M15 - IOT Relay - & Breakout board (auto turn off/on router)

Barry,
Thanks for this post. I know that most cnc users would understand your thorough explanation, but for someone like me who is new to this will usually need a visual tutorial to follow what you have done. My cnc will not come until December but will consider ordering the breakout board so I can also have the router and vac start in auto.
Looking forward for the tutorial. Cheers.

1 Like

Hello Nelson,

I plan on doing just that. Standing up a website for my woodworking and plan on doing a detailed blog post on this. I’ll update this post with that link when I have it completed.

Regards,
Barry

3 Likes

@CruversWorkshop - let me know if you need help with the website - I’ve been down that road many times :wink:

-Tom

2 Likes

Much appreciated, I’m a software developer as well, but a backend developer. I get that blank page stare when trying to do anything front end :). I have a server and using WordPress with either Divi or Elementor. I have full licenses for both, but still get need to get a starting point.

3 Likes

Roger - I use WordPress with Woocommerce. Good combo, but a little slow (at least with my ISP).

2 Likes

Here is how I wired my Makita router for automatic on off control. When I send a carving file to the machine (Click the Play Button) my spindle will turn on automatically at the speed set by the speed dial on the router and when the carving completes the router turns off automatically. I used a DB25 Breakout board that I had laying around doing nothing and purchased the Relay from Amazon for $9.82. The Relay comes in a package of 2 so the cost could be considered about $4.50. You could also use the second relay in parallel to control your dust collection if it doesn’t draw over 10 Amps AC Power. I have attached a Wiring Diagram with instructions for wiring and controller configuration that I found in CruversWorkshop post in this forum topic above.

For this to work your gcode file needs to have a M3 and a S1 command to turn the router on and a M5 at the end to turn it off. Most design packages such as VCarve will have those commands already included in your carving files. Others such as InkSkape may not.

The S command can be either before or after the M3 and can have any value assigned to it. S0 will likely turn off your spindle but don’t rely on that, use M5 instead. S1 or higher will turn it on if a M3 has already been sent or gets sent after the S1 Command.

The M3 (on command) must ALWAYS come after the spindle is raised up from Z0. Never before that and the M5 (off command) should be near the end of your file just before the X0.000 Y0.000 command to move your spindle back to its starting point. Sometimes you may find it immediately after though.

If you need to insert the M3, S1, and M5 commands manually please make sure you fully understand what you are doing. If you aren’t sure, contact me and I will be happy to review your file before you try to use it.

Download the free PDF version of this file from Triquetra CNC HERE

15 Likes

Thanks Charley - great work as always. I’m guessing the relay Barry posted can be used as well? Lot safer than having mains voltage laying around (though I’m sure it’s in an enclosure of some kind).

-Tom

Yes it is safely tucked away in an enclosure completely out of harms way. Even if it weren’t, there is virtually no exposed wire not to mention the fact that I am using the Neutral wire to go to the really even though either would work the same.

2 Likes

Can we see a picture of the actual wiring Charley?

2 Likes

Sure. I need to tidy it up, I just finished testing out my laser wiring and I have test leads going in every direction of course. It is an off brand that I picked up several years ago. Some of the folks out there have probably heard of it. It is a L-Cheapo 5.6 watt.

3 Likes

Here are the Pictures. The Laser Wiring shown is for a L-Cheapo laser and IS NOT FOR THE J-TECH LASER. If someone needs a wiring diagram for the L-Cheapo laser let me know and I will post one. If I were going to endorse a laser it would most certainly be the J-Tech Laser. The Actual wiring diagram is posted earlier in this topic and does not include the Laser Wiring in the pictures below.

5 Likes

Nice setup, I did not have to use a 3rd wire if you set the Tool to tool-type- PWM Spindle in the UI. This changes the pin 15 to carry 3.3v when the M3 S# is sent, and then cuts it when M5 is reached. Ultimately it has the same result. I still do plan on doing the blog post with images and settings within the app so it’s all in one place.

1 Like

Bit of a noob question. My original plan was to wire some switches to be able to turn my machine, router, vacuum, and lights on for an enclosure. If I set this up like this would all I need is a switch for the machine and lights as the gcode would be able to turn the router and vac on and off when needed?

Excited for your blog post as I have a lot of questions about how to setup with the stuff you linked originally as it seems like a perfect solution for both what I want to do and my novice electrical skill set

1 Like

The simplest method would probably be to go with the IOT relay that CruversWorkshop referred to. The controller software configuration is the same for the IOT relay and the smaller board relays I use. The IOT only needs two wires coming from your controller to turn it on and off and the relays I use requires three wires. Aside from that here are some other differences.

The IOT Relay:

  • Cost approximately $26.95 usd on Amazon

  • Controlled with two wires from the db25 breakout board.

  • Looks like a power strip with 4 outlets

  • 1 outlet is always on

  • 1 outlet is normally ON and can be switched off with the logic signal.

  • 2 outlets are normally OFF and can be switch on with the logic signal.

  • Maximum load capacity is 12 amps at 120vac combined total between all outlets that are ON at any given time.

  • Does not require any modification to the power cord of a device being controlled.

  • Format: Stand Alone unit

  • Size is about 5"x7"x2"

  • Response time not listed

  • Additional Requirements: DB25 Breakout Board

Relay Boards:

  • Cost $9.82 on Amazon (Package of 2)

  • Requires 3 wires to control. 3 vdc + and - to power the board and 1 signal wire. All three come from the db25 Breakout Board.

  • Maximum load capacity is 10 amps @ 30vdc/120vac/250vac.

  • If you use both relays that come in the package you can control 2 devices at 10 amps max each for a total of 20 amps.

  • Does require modification of the power cord going to the device being controlled. (1 lead goes directly to the device and one goes through the relay)

  • Format: Circuit Board

  • Size: 70mmX17mmX20mm each

  • Response time: 20 milliseconds

  • Additional Requirements: DB25 Breakout Board

Conclusion

The IOT will cost you a little more but is a simpler method and is very reliable. I have one on a different cnc machine that I have been using for years without issue. The relay board I installed on the OneFinity is a little more involved to setup and needs to be inside an enclosure but is a fraction of the cost. There are other models available that can provide multiple outputs instead of just one per circuit board. Both methods will control your spindle equally well. I believe that CruversWorkshop is going to post a wiring diagram for the IOT so I will leave that to him. Whichever way you choose to go will definitely make your life better. With both of these methods, your router switch is always in the on position and power is supplied and removed at precisely the right time through G-code commands. The commands are typically inserted automatically by most project design packages such as Fusion360 and V Carve. It turns on at the start of a carve and turns off when the carving is finished. No intervention required.

9 Likes

Wow, absolutely amazing write up! Super helpful. Helps tremendously understand which would be best for me. Not having to modify the power cables would be a good thing for me, leaves open the ability to adjust and change things with little complication.

Thank you

Barry,

Thank you so much for great write-up. It took me about 7 min to wire up the breakout board and plug everything in… a simple M3 S1 later and like magic, my shopvac & spindle were humming away… hit an M5 and silence.

I was able to plug everything into the same double outlet so no issues with the noise causing the controller and power switch to be on separate.

-Alex :metal:

Okay… one slight issue.

That worked great and I set both the Tool & the I/O to your stated settings. The cave worked perfect, probed, turned on, carved turned off.

However, once I hit ANY of the directional keys after that (even when the carve us totally done) the spindle and vac turn back on. If I hit the “Stop” button (not e-stop, the one next to Play) it shuts them off… any ideas where I went wrong?

T1 M6
G20
G90
M3 S1
G1 Z0.15000 F9.0
G0 X2.31680 Y3.16656
G1 Z-0.12500 F15.0
G1 X2.32224 Y3.17157 F60.0
G1 X2.32086 Y3.18051 F60.0

(Then M5 on my last line of Gcode)

Thanks again,
-Alex

1 Like

Hmmmmm, I just tried my IOT relay I had from my previous machine and I don’t seem to be getting the same results. I also used the same (PIN 15 tool enable and PIN 25 GND) but it doesn’t enable my IOT relay.

Hey Alex,

That is odd, haven’t see that behavior. Have you disabled the load-1 and load-2 under the I/O area? And set the spindle to PWM under Tool and set tool-enable-mode set to lo-hi? Maybe also try putting the controller on a different outlet if you haven’t done so already.

Regards,
Barry

Hello Jason,

Have you done the other steps of changing the setting under Tool to PWM spindle and set tool-enable-mode set to lo-hi. Then under I/O disable load-1 and load-2. You can test the setup by using the MDI table and sending M3 S1 and it should turn on the router (already have it powered on), then M5 to shut it down. If this works then it’s just modifying the post processor to add the M1 [S] in my previous comment in this thread. This is if you use VCarve/Aspire, I’m not familiar with the other software offerings to know where insert the gcode for them.