Stepper motor moving automatically

Hello,
I have https://www.pololu.com/catalog/product/1208 with drivers https://www.pololu.com/catalog/product/1202. I have connected the connections properly but as soon as i supplied a power to motor automatically starts rotating without giving any input. Could you please help me out for this? How can i overcome this? whats my probable mistake?
Thanks for your time.

Hello.

It sounds like you are doing something wrong in your microcontroller code. Does it move smoothly or erratically? What do you have the motor driver connected to? Do you have an oscilloscope that you can use to verify the signal on the step pin is staying constant?

- Ryan

Hi Ryan,
Thanks. I did not connect any input to step pin, i have just connect the basic circuitry of driver IC and kept open the STEP pin even though motor is moving. Initially when i have done same thing motor was working fine but today i suddenly notice it was moving without step pulse. It was something strange. What are the possible mistakes?

Hello.

Your problem is that you have left your step pin floating, so it is probably randomly fluctuating due to noise and causing the motor to step. You should not leave the step and dir pins disconnected, and if you connect them to a microcontroller I/O lines, make sure those I/O lines are not set up as floating inputs.

- Ben

HI Ben,
Thanks. I will check that, but when i am reseting the micro-controller, during that reset period too the stepper motor rotates in random direction. I think this should not happen.

When you reset the microcontroller, the pins probably become floating inputs, which is the same as having the step pin disconnected. There are a few ways to avoid having the stepper motor step randomly in this situation. One is to connect your microcontroller’s reset line to the reset line on the stepper motor driver (or you could invert the signal and connect it to the enable line). Another is to include an external pull-down to ground (or pull-up to VCC) on the step pin so that it is pulled to a fixed voltage when the pin disconnected or the microcontroller input is floating.

- Ben

Thanks Ben, It is working now.