Introduction: Connect Stepper Motor to Arduino

Hi to all. In this tutorial i will help you to connect an unipolar stepper motor to your arduino.

To do this you'll need

1x Arduino board -> on ebay aprox 10$

1x driver for stepper ->they are cheap on ebay (just type in ebay :ULN2003 Stepper Motor Driver Board around 1$)

1x unipolar stepper motor -> the price depends on size etc..or you can find then in old printing machines

So,this is all we need,and let's get started !

Step 1: Connect Your Stepper to the Driver

In this step you need to connect the wires from stepper to the driver.Most steppers have 6 wires,three for one coil,and three for second coil,if you are not sure witch wire it's in the middle of the coil find it with Ohm meter.

When you find both wires connect them together and that will be the positive terminal.The other 4 wires solder in a female connector and put it in the WHITE male connector on the driver.

Warning! Because stepper consumes quite a lot of current,you need to connect this driver to the external power supply and NOT on the arduino!!

Step 2: Now Connect the Driver With Arduino

You're doing great! Now you just need 4 wires and with them connect driver shield to arudino,on arudino i selected ports 8,9,10,11,but you can use other ports too!

Step 3: Almost Finish! Just a Bit of Programing...

Now the hardware is finished and we can start programing. Open the arduino software and copy this program

Some tips : You need to know

steps = Number of steps in One Revolution * Gear ratio .

Maybe you'll need to figure out witch port it's first,second,third and forth because it's not 100% that they are connected properly and the motor will not spin

#include <Stepper.h>

const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution // for your motor

// initialize the stepper library on pins 8 through 11:

Stepper myStepper(stepsPerRevolution, 8,9,10,11);

void setup() {

// set the speed at 60 rpm:

myStepper.setSpeed(60);

// initialize the serial port:

Serial.begin(9600); }

void loop() {

// step one revolution in one direction:

Serial.println("clockwise");

myStepper.step(stepsPerRevolution);

delay(500);

// step one revolution in the other direction:

Serial.println("counterclockwise");

myStepper.step(-stepsPerRevolution);

delay(500);

}

If you need help ask in the comments or send me email : drimer525@gmail.com

**SOON ON KICKSTARTER HOPE YOU'LL HELP ME**

Comments

author
ajithmalai (author)2017-08-21

my stepper motor contains 2 wires .how to connect a driver and adrino

author
GOVINDM18 (author)2017-07-26

my stepper motor is 103H7124-1041 how i connect

author
mohamadb12 (author)2016-12-21

hi
my stepper motor gives whistle voice during rotation.
Who knows what the problem is?
my stepper motor is 42BYGH40388

author
nageshsp (author)2015-09-26

Can you share me whiring diagram?

author
vegard7 (author)2014-11-13

My stepper only have 4 wires...

author
seamster (author)2014-10-29

Nice work, thanks for sharing this project!

author
drimer525 (author)seamster2014-10-30

Thanks,there will be more projects,like how to connect OLED i2C display,nrf modul etc..so if you want to be updated-FOLLOW ! :)

author
Arman5592 (author)2014-10-29

I think the step code is for step/dir connections (bipolar) ?

author
pfred2 (author)2014-10-29

Sure a pin driver (That is that the ULN2003 was designed to do, drive solenoid pins -- it is an array of diode protected Darlington transistors) will run a stepper motor. It just will not run it very well. You need to control current with feedback running a stepper motor. Get a real stepper driver, then just output step, and direction signals with your microcontroller.

About This Instructable

28,104views

62favorites

License:

Bio: Studying electro...
More by drimer525:Connect stepper motor to arduino
Add instructable to: