Need help with stepper motor driver wiring. Please help.

Hello, i am working on a arduino based cnc and using nema 23 stepper motor rated at 2.8 amp. I only have basic knowledge of arduino and electronics and thus require help with wiring. I will be using this stepper driver,

I'm using Arduino Uno R3. Can anyone please make a wiring schematic (detailed) showing where to connect each wire ? Would be really helpful.

Also if you could show how to wire limit switch - this one -

https://www.google.co.in/search?q=limit+switch&espv=2&biw=1366&bih=653&site=webhp&source=lnms&tbm=isch&sa=X&ved=0ahUKEwihxP2Fo8XJAhUMCI4KHTBwDeYQ_AUIBigB#imgrc=jYS0RLIAfsf0BM%3A

Thanks!

You'll see on the driver the three pairs of inputs labelled PUL+/-, DIR+/- and ENA+/-.
These are opto-isolated inputs (ie electrically 3 LEDs with series resistors). For 5V operation you
would simply connect DIR-, PUL-, ENA- to Arduino GND, and drive DIR+, PUL+, and ENA+ from
Arduino pins. PUL+ means the step input, DIR+ is the direction input and ENA+ the enable
input.

Try out the AccelStepper library, this takes a step and direction pin, so you'll have to manage the
enable pin yourself.

You need to determine which pairs of wires from your motor correspond to each winding and pair
these correctly into the A and B motor outputs. Its doesn't matter which way round you connect the
wires so long as both wires from one winding go to the A outputs and from the other to the B outputs.

Also you need motor supply connected to the driver. The daigrams printed on the case make this
clear I hope. The manual for the driver is a Google search away - "psd5042-2p"

BTW that's the cheapest industrial stepper driver I've seen to date! Hope its cheerful as well as cheap.

If i leave the drive enable/disable as it is, i.e. do not connect them to anything, will it work fine ? In the manual for the driver it says that if enable is left disconnected it will consider drive as enabled.

Also as shown here,

Can i connect the enable from drivers to the enable/disable pin as shown in the pin layout ?

The best thing is to use pinMode(pin, INPUT_PULLUP); for the pin that the limit switch will be connected to. Then wire the switch so that when it is activated it connects the pin to GND. The Arduino will see a HIGH when the switch is not activated and LOW when it is activated.

And if the manual says you don't need to connect the enable line who am I, or you, to dispute that.

...R

I think the manual is talking about the opto-isolated inputs with the +ve's connected to 5V and
driving the -ve inputs (really old-school TTL style). Anyway they should be describing opto inputs
as on and off, not high and low, since there is either light (on) or no light (off) in the opto isolator,
and not assume how you've connected to it.

These days you'd drive relative to ground so as not to have to export your logic supply rail down
a cable where it could be accidentally shorted to ground and crash your microcontroller.

But old (bad) habits die hard in industrial controller design I guess...