3 Stepper motors and a solenoid

So I have 3 NEMA 17 stepper motors and a 12v solenoid which I need to control. I am using an arduino uno r3 with a CNC shield to do this. Controlling the motors and the solenoid apart from each other is no problem. But I was wondering if it is possible to have them all connected to the shield simultaneously and control them all together. For the solenoid I also have an MOSFET irf520. To power it I'm using a 12v adapter.

That may not be suitable. It may overheat and fail, depending how much current the solenoid requires. Choose a logic level MOSFET like IRLZ44.

1 Like

Yes. Grbl does it every day.

You could treat your solenoid as a “coolant pump” and use grbl unmodified.

Would it also not be enough if I run the stepper motors before I move the solenoid, while all 4 are connected to the arduino? Because the stepper motors work when the solenoid is not connected and vice versa. Like they dont hove to run at the exact same time

You may have simply been lucky, but that MOSFET is not logic-level, so may not fully switch on with only 5V on its gate. This might lead to a higher than wanted voltage drop across the MOSFET, causing it to dissipate a lot of heat, and reducing the current flowing through, and so the strength of the solenoid. But if the solenoid current is quite low, these effects may not be a problem in practice.

1 Like

The solenoid is 300mA and the stepper motors are 1.7A

To check if your PSU is sufficent, you must calculate how much power you need. Especially be aware that the steppers need power even if they don't move. As far as I remember with the CNC shield you can disable only all or none.
To see if your PSU is sufficent for all the steppers you have to calculate the power they need ( not only the amps). You need the rated current and the resistance or the rated voltage per coil. Then you can compute the power per motor. Your PSU should be able to deliver about twice as much as all three steppers need.

1 Like



In the pictures you can see the setup I was thinking of. I have an arduino uno r3 with a cnc shield on top. On this cnc shield there are 3 stepper motors (NEMA 17, 1.7A) connected (next to the stepper drivers). In addition I've connected a IRF520 MOSFET module to this cnc shield, to which a 12V, 300mA solenoid is connected via the V+ and V-. I was wondering if this is a setup I can safely use to control these three steppers and the solenoid when having a single 12V adapter as the power input. It is not necessary to have all four run at the same time, for my purpose it is enough to move two steppers at the same time, then the solenoid, and then the third stepper for example. Would this be possible? Or would I for example need to use a 2nd adapter for the solenoid?

Use IRL, logic level MOSFETs. IRF might not switch well enough.

Okay, would this setup work apart from the mosfet? Like would there be enough power to control the solenoid and the steppers etc.?

I was also able to control the solenoid using this irf mosfet

Haw many Amps is the 12V adaptor?

It is 2A

That enough for only 1 motor.

So it could be possible to move one stepper, then another, then the solenoid, and then the third stepper. Also before, when I didn't have the solenoid connected, I was able to control all three steppers simultaneously. Why would that not work anymore when the solenoid is connected?

What was the current limit set to on the drivers?

I don't know honestly, I got the cnc shield with the drivers delivered to me and never changed anything. Any way I could find out?

Need to know the part number for the driver, should be in the datasheet/instruction manual.

Looking the driver type up online I'm finding 1A

What is the driver type?