Solid State Relay to control Spindle

Hey MPCNCers,

I’ve just watched another youtube video of someone who builds a MPCNC and I really liked the video.
He is talking about a ‘solid state relay’ to turn off and on his spindle via laptop (he’s using an Arduino).
Now I’m wondering if I can do that too, I’m using a MKS Sbase with Marlin.

Here’s the video:

At 22:31 he talks briefly about the solid state relay.

This is what I can find about the MKS Sbase:

I don’t know anything about electronics, so I have no clue…

Sure. A regular relay works too. What kind of spindle do you have?

Hey Jeffe, I have a Makita RT0700C.

You might look into something like this since you say you don’t know electronics
https://www.amazon.com/Iot-Relay-Enclosed-High-Power-Raspberry/dp/B00WV7GMA2

The relay is in a neat package so you don’t have to mess with wiring mains voltage.

2 Likes

Thanks, I’ve seen that one as well someone mentioned it here:


But how do I connect it to the MKS Sbase and do I have to do something in the firmware?

Here I see one connected (to the ‘hot bed’ pins):

I’m guessing the MKS is using marlin firmware?

I looked up a pinout diagram, it shows ports for fans.

On the rambo I wired the fan pins to the relay and then used gcodes M106 and M107 to switch the relay.

Yes I’m using Marlin.
In the pinout diagram there’s ports for BED, E1, E2 and FAN.

In the last picture in my post it’s connected to ‘BED’

Oke I understand why you use M106 and M107, I just looked it up… it controls Fan speed.
Can you program this for example in the Fusion 360 post processor?

This option is great I think, but it doesn’t have European plugs :frowning:

Someone from the Dutch Cnczone website asked me if I can use the M03 and M05 commands in Marlin so I looked it up… and yes that’s possible.

But then the question… where do I connect the SSR on the board? This might be better so I can use it in the post processor???
What do you guys think?

If it can be controlled by a 5V signal, you can assign the spindle enable to one of the 5V pins. If it needs 12V, you can use the fan pin and either just use M106/M107 or reassign the fan pin as the spindle pin and then use M3/M5.

The 12V fan pin is the easiest. No need to change the software. Just use M106/M107 to turn it on and off.

Thanks for the reply, so I have multiple options… great!

What would be the difference between a regular relay and a solid state relay?
What would be better/easier?

The regular (mechanical) relay is generally cheaper. They can usually handle more current and they don’t care as much about AC/DC. A solid state relay doesn’t have any moving parts, but if you aren’t toggling quickly, a mechanical relay can toggle enough times for it to not matter. Mechanical relays can toggle a few tens of thousands of times, so you will have a hard time breaking them if you turn them on and off at the start/end of a job.

1 Like

Thanks Jeffe, and what about wiring… it’s the same as a solid state relay?

I don’t really feel comfortable teaching about the relay wiring. If you know, then that’s fine. If you don’t know, then you should know that AC can hurt you, and I don’t feel right trying to explain everything you need to do it safely.

If you don’t know how to wire it, then you can search iot relay on amazon and come up with one that has the AC all isolated and in protective case, and you can just wire the trigger to the fan port.

2 Likes

Hey Jeffe, I respect it! So a SSR is less dangerous?

No.

Take a look at this:

https://www.amazon.com/Iot-Relay-Enclosed-High-Power-Raspberry/dp/B00WV7GMA2

All the A/C is contained inside the plastic. The little green plug connects to the controller on the fan port, and you don’t have to change the firmware. There’s not any more chance of hurting yourself than a regular power strip.

These are mechanical relays, and they are a lot cheaper:

These will work. But they are controlled by 5V, and you have to cut the power cord that carries 120VAC. The result is a lot more dangerous. If you knew the dangers, and you were taking responsibility, then it’s fine. But if you’re asking about wiring, I would feel a lot better if you chose the power strip version.

The SSRs are very similar to the second choice.

2 Likes

Thanks! Yes I’ve seen the power strip version… but I live in Europe and it’s not an European plug + 230V. I would have preferred it as well.

I will put everything in an official electronics enclosure. I’m just not an electronics guys, but I would like to learn. I am aware off the danger.

I do have wire strippers, crimpers and that kind of stuff. That’s what I’ve learned already :wink:

To answer your question, the difference between a SSR and a EMR is that the SSR is effectively a transistor. The advantages are that it quieter, and generally the use less power to activate and can turn on and off faster. Disadvantages are they are more expensive and more sensitive to voltage spikes.
EMR (ELECTRO MECHANICAL RELAY) are basicly a normal switch that is activated by using an electromagnet. Advantages are that they are cheap and very reliable. Disadvantages are they are slow and louder… for this application I recommend a EMR but it will not make a substantial difference one way or the other.

And as Jeff said, be careful with the wiring. Both for your immediate safety. But also the long term safety of the system, your property, and yourself.

1 Like

Thanks for the explanation! Before I wire up everyting, I will make a drawing and let it check by others.

1 Like

just so you know, a lot of the danger comes not from how its wired (as its basically a switch) but rather the quality of the wiring. think of it like wiring an outlet for your house, its easy to put the wires in the right spot, its a lot harder to make it safe to be used. meaning things like how much insulation is stripped, loos strands of wire, the angle that the wires enter the box and relay terminal, the torque you place on the screws in the terminal block, etc. if you know someone who is familiar with house voltage (an electrician or a service tech that deals with electricity regularly) i would have them look over the device once you have it wired, before putting power to it.