EasyDriver Stepper

This node lets you control a stepper motor, like the Nema 17 Bipolar Stepper Motor, with the EasyDriver - Stepper Motor Driver.

Hardware Setup



The below diagram has labels on all of the pins you need to connect.



This board uses a 4 wire stepper motor. The wires come in pairs, look up which wires are connected on your motor's data sheet. Connect these 4 wires to the A and B motor pins.

In the top right of the diagram are connections for an external power source. A stepper motor will probably use a lot more power than can be supplied by an Arduino so it's a good idea to use an external power supply. Connect the ground and voltage to these two pins.

The Ground pin in the bottom right should be connected to the Ground of your Arduino.

The next 5 pins are used to control the board:

Connect the Step pin into digital pin 2 on your Arduino.
Connect the Direction (labeled DIR) to digital pin 3.
Connect MS1 and MS2 to pins 4 and 5.
Finally connect the Enable pin to pin 6.

You can of course use any digital pin on the Arduino, the above suggestions match the default pin selection on the node, if you use other pins just make sure the node inputs are set correctly.

Using the Node



If you made your connections according to the above suggestions you can leave the first 5 configuration inputs alone.

The Direction input controls which direction the motor turns, if this value is below 0.5 the motor will turn one way, if it is above 0.5 it will turn the other way.

The step trigger makes the motor turn one step in the chosen direction.

The Enabled input defaults to 1 so that the motor can be controlled. Set this input to anything below 0.5 to turn off the motor control.

Finally the resolution has 4 positions. The first position has the largest steps, the last position has the shortest steps.

Notice that every time the Step input trigger is fired the motor turns one step. To get a smooth rotation you should set the refresh rate of the agent that this node is on to a very high number, as high as 512 updates per second.

View discussion page on forum

To use this node in your Embrio project, either add it from the Library toolbar or copy the XML in the below box and paste it into a node screen.