Controling stepper motors with arduino due

Hello everybody, I'm new to this form.
I'm building a large cnc that i want to controle with arduino due and grblhal.

What i'd like to know, is there anay wiring diagram available on how to connect my stepper driver directly to the due, (without using any kind of shield)

Thank you for your help.

You can't drive a bare stepper directly from an Arduino without a suitable stepper motor driver.

Which one out of hundreds of different ones?

The driver is a DM542T

Rami Safi
Interior Architect
VFX artist

What I ment is in this link but for due
https://search.app.goo.gl/RY3KimD

This driver needs at least 5V input, but the Due is a 3.3V board. So you definitely need some extra HW. You cannot connect the driver directly.

I know that, i won't be powering the drivers from the due, all i want to know is, in which pins i need to plug my axis, limit switches and so on.
Thank you for your reply

I didn't talk about powering the driver ( the DM542T needs much more than 5V as power source ). I talked about the connections to the step/dir/enable inputs of the DM542T. You cannot connect them directly to the Due - no matter what pin you use.
Which pin is used for step/dir/enable depends on the sketch, not the driver you use.

The OP may use the level shifter (Fig-1) between DUE and Driver.
levelShifterPic
Figure-1:

These level shifters are designed for bidirectional I2C bus connections. I don't think they are a proper solution to drive the optocoupler at the DM542 input. The OP needs a 5V buffer IC with TTL compatible inputs.

P.S. A guess: the grblhal pins for the due maybe the same as for the MEGA, as both have the same pin layout.

They can also be used for uni-directional purposes. I use the same level shifter for level shifting the SCL line (uni-directional) of UNO.

Yes, but are they able to drive the LED of an optocoupler?

I have no such experinece.

This is the schematic (Fig-1) of one section of the level shifter. If you provide the part number or link of the opto-coupler, I can check if the level shifter can drive the device.


Figure-1:

You must use a motor driver module/shield in between.

Well, it's the input circuit of the DM542T stepper driver. It's the optocoupler LED in series with a 270Ohm resistance, and needs 5V for reliable operation.
[EDIT]That's about 13mA ( depending on the saturation voltage of the LED ). Even if you use it as LOW activ, the shifter cannot provide any current - the current must be provided by the MCU. The max sink current depends on the pin and is 6mA or 9mA max - depending on the pin.

Ok! I understand that the driver's input circuit is an opto-coupler to facilitate using it in High Voltage environment.

I am doing an experiment (hopefully, I will find one opto-coupler in my drawer) and will report the result.

So I can conclude that it's not feasible by using due by itself.
Thank you all for your help.

Datasheet says control input current is 7 ~ 16mA, I would use an NPN transistor to pull the - input to ground (2N3904 or equivalent) as in datasheet page 4, figure 2. With 3.3V a 680 ~ 820Ω base resistor should work.

https://www.omc-stepperonline.com/download/DM542T.pdf

@MicroBahner

I have found the 2501 opto-coupler in my drawer at the very first look; but, I am late to report the test result owing to my engagement in the kitchen to prepare dinner for my two sons (35, 25) as my wife has gone for pleasure trip with my daughter and two grandsons (37, 31/2, 11/2). They will come back tomorrow inshallah.

Here is the static test setup using the isolated 2501 opto-coupler, and the result is positive -- I mean the device responds as I chnage the input logic to 3.3V and then to GND. (I could not series connect the 270 R resisitor due its unavailability; however, it's value is low compare to 10 k pull-up at the HV1' side of the level shifter.)


Figure-1:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.