Go to main site 3dtek.xyz

Relay control of router

Would this setup work for the AIO hooked into the direction port and using M4 and M3 to switch on and off?

By default, the dir port is 0V on m3 and 5V on m4 - which is kind of backwards for the logic you will want.

It can be fixed with a compile-time option in GRBLs config.h file, simply uncomment the line below
// #define USE_SPINDLE_DIR_AS_ENABLE_PIN // Default disabled. Uncomment to enable.
so that it looks like this
#define USE_SPINDLE_DIR_AS_ENABLE_PIN // Default disabled. Uncomment to enable.

Then your DIR pin on the AIO will be 5V High for M3 and 0V Low for M5. Which is a good signal for controlling a relay?

Next issue is that the DIR pin can only supply max 40ma @ 5V so you would have to check if that relay can be controlled with so little power. I can’t see much of the model number on that solid state relay but I doubt that it will be enough power to turn it on.

You will have to choose a relay carefully and consider:

  1. What control side input voltage and current are required to turn it on.
    As mentioned you have 5V @ 40ma. It’s intended to be used as a signal not to drive a load, which a relay will be. We have not put a current limiting resistor on this pin and so the full 40ma should be available however should you try to draw more… the Atmel processor will be destroyed. So put a resistor on this output when connecting to a load.

  2. What voltage and current it can handle on its switched side.
    What voltage and current are listed on the spindle. If its a Makita, DeWalt or other hand routers then 10 @ 240v is plenty for your switched side.

  3. What kind of relay. The old click clack switched type (the ones you hear clicking away when your turn indicators are on in the car) are inductive loads and when switching on and off can damage the control card. Good discussion here: https://arduino.stackexchange.com/questions/17022/reasons-why-it-is-not-ok-to-connect-a-relay-directly-from-an-arduino-digital-pin

What I think you should be looking into is a relay board designed for this task.
They have a very small solid-state relay or transistor that works on 5V with maybe 10ma, and this little switch switches a much higher power relay that manages the 240V.

Regardless you will have to chop up the routers power cord and do some 240V wiring and so without offence (usually said before offending) if the question needs to be asked then its probably something that needs to be requested of an electrician. Remember it’s not just about getting it working or not dying in the process - it’s about anyone who comes into contact with the equipment in the future who may be put at risk.

So can I instead recommend a consumer product for the task: http://dataprobe.com/iboot-io/
These are available in Australia, we have bought them from zantech.com.au in the past.
They are going to allot more expensive than the schematic you have shown in your post but they will not damage your control board or hurt anyone so have a look at them.

If you find a cheaper or better alternative please post it here in the forum.

Lastly - if you do go this route, be very careful. When Gcode controlling a VFD spindle you have a few seconds to pull your hand away when they power up before they are going very fast and they have very little torque in comparison on startup. The trim router motors on the other hand spring to life without warning when power is applied and so you want to test the hell out of your setup before using it to make sure there is no way that the router is going to come alive while you have a spanner on the collet nut.

Thanks for the info. Lots to think about.
I’ll have a think about it all and let you know what I come up with

Would something like this work???

No, its only good for 2 amps @ 220V. Look for something bigger!

The Makita will have its current requirements on the label.
Choose a relay with a rating of 1.5 x this current requirment