Controlling a Stepper Motor with an Arduino

arduino316As one one of my first projects with my new Arduino I thought I would try to hook up a stepper motor. I had a few laying around from old computer hardware I had taken apart and now I finally have the resources to hook them up.

I have a couple of bipolar motors, but I started with this unipolar since it requires fewer components to hook up. since I didn’t have a driver chip I used some 3904 transistors to provide more current to the coils.

Arduino Controlling a Stepper Motor

Arduino Controlling a Stepper Motor

Each line has an LED to show the sequence of which coils are being activated. There is also a diod on each one to drop the feedback from each coil when it is turned off.

And here’s the video:

I have it running a program that picks a random number of steps and either forward or backwards then moves in that direction. There is a library included with the Arduino software that makes using stepper motors pretty easy once you get them wired up. You can check out more here: http://arduino.cc/en/Reference/Stepper

Update: Here is a better illustration of what’s going on. This is missing the LEDs I added as a visual aid, but it has everything you need to make it work. I’m using 2n3904 NPN transistors and I added some diodes (1n4000 series) to prevent kickback from the motor.

Arduino Stepper bb

Here is a simple sketch to see if your stepper motor is working: random_stepper2.pde

Related posts:

  1. Controlling a Stepper Motor with an Arduino Part 2
  2. Arduino Servo Motor (Part 1)
  3. 555 Time Lapse Intervalometer
  4. Fix an LCD Monitor
  5. How to Read a Resistor Color Code

6 comments to Controlling a Stepper Motor with an Arduino

  • [...] a Stepper Motor with an Arduino Part 2 This is an update to my first post about connecting a stepper motor to an Arduino or other [...]

  • Great tutorial thanks!

    I’ve managed to successfully control a stepper motor with the circuit in part one.

    The stepper motor I’m currently using is smallish like yours. I have several larger stepper motors and was wondering if it was possible to add a separate power supply and larger transistors to this circuit for the larger stepper motors.

    I’ve tried a few things, but I don’t know a whole lot about electronics, so maybe you could point me in the right direction. Just a single word that I can type into a search engine could make all the difference.

    Many Thanks!
    Gabriel

  • [...] Posted by Preecha thank,but i control with Arduino AVR .Can i applied that Controlling a Stepper Motor with an Arduino | Azega Reply With Quote   + Reply to Thread « Previous Thread | – [...]

  • nik

    a bit off topic, but how did you make the schematic picture? is there some free software to draw out your projects? That would be of great help for me :-)

  • the schematic picture looks like generated with fritzing. fritzing is open-source –> http://fritzing.org

  • Carlos

    I am a complete ignorant trying to find his way. I loved your tutorial but I have a big doubt.
    I have two stepper motors but they only have 4 wires. Since yours has 5 I don’t know wht to do…

    Would someone help me please?

    Thanks,

    Carlos

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>