Home Chapter 12 Maxuino/Arduino ULN2003 Stepper motor
Maxuino/Arduino ULN2003 Stepper motor

Another motor that is quite nice to use for accurate positioning is a stepper motor. Steppers have many discrete coils that allow them to step through the motor coils and you can use a counter subroutine to move the steppers in step.

This could allow you to count the number of steps to turn the motor one time for example. With a motor that steps 1.8%, you would need to have 200 steps to go one full revolution.

Since the motors are accurate you can also tell them to go 50 steps for example and that would be 1/4 of a 360-degree turn. The challenge with steppers is they have not feedback and if you are holding the motor and it does not turn, while advancing the code telling it to turn, the motor or the program may not know it has not turned.

Notice the part number below is for a ULN2003 versus a ULN2803 and either part will work though pay attention to the extra pins on the ULN2803 and account for them in your design if that is what you are using.

Also, note that the supply voltage is 12 volts and the GND rail is also tied to that power supply. It is important to tie that GND back to the GND rail of the Arduino you use to create the stepping code for this stepper motor.


Code to drive the stepper motor using Maxuino.

Copyright Ken Rinaldo

You can purchase stepper motors from Sparkfun or Pololu motors or small ones that run at 5-volts. The Stepper Motor 28BYJ-48 are inexpensive and relatively easy to control with the Arduino IDE directly. Here is a nice tutorial on Instructables on how to use these motors and they can be purchased online from Amazon for amazingly low prices.


MAX MSP lessons continue in Chapter 13