Tutorials and Resources to Control Stepper Motor With Arduino Board

| 8 Comments

Advertisement

Used especially in educational projects or by hobbyists, the Arduino single board computer is a pretty awesome open-source embedded system used in a wide range of robotics applications. Controlling stepper motors via Arduino board with or without shields promise to be an easier task, and in the following you can find a series of tutorials aiming to introduce you to the area of controlling any stepper motor.

An electric motor can be powered and controlled directly from the Arduino board, or using the same Arduino board with an additional shield. The first option, using the power source from the Arduino board, is not always the right method and has limits. For example, you can connect directly to the Arduino board only small stepper motors that require a small amount of current in spinning. This power limitation comes from the powered source of the board, which can be a USB port or the DC jack on the board connected to a 5V power adapter.

Using an Arduino motor shield designed to control stepper motors is the right way to build a breathtaking DIY robot that can turn in place, climb stairs, or a robotic arm able to grasp objects from the ground. These motor shields are engineered to control motor direction and the speed using simple commands and the Arduino board. Additionally, using an external power supply of up to 12 V, you’re able to power and control several motors in the same time.

The stepper motors can be splitted into two types: unipolars and bipolars. The type of the motor is important to determine the compatible electronic device. In general, a stepper motor is controlled by a series of electromagnetic coils surrounding the shaft and designed to convert the electrical pulse in mechanical movements.

Small stepper motors fall in the voltages starting with 5V, 9V, 12V and finishing with 24V. The stepper motors with a higher voltage than 24V are hard to find in robotics, and perhaps these are not too popular in the DIY method of building robots.

Arduino Board

Arduino Board


Advantages

A stepper motor has a series of advantages including:

  • accurate positioning;
  • move forward or backward step by step;
  • high torque at low speed;
  • rotate angle is proportional with the input pulse;
  • full torque at standstill;
  • quickly response at start, stop or reversing the sense of rotation;

In the following, I explore tutorials and resources to control stepper motors using the Arduino board and several other electronic components.

Tutorials to Control Stepper Motors Using Shields

An Ardino motor shield has the role to control motor direction and speed, which is a good and simple solution to the challenges of our time in robotics. As you can see in the following tutorials, all of these shields can be easily plugged on top of the Arduino PCB to extend its capabilities.

  • Arduino Motor Shield Tutorial – this is a tutorial from where you can learn about how to interface one or two DC motors with an Arduino board using the Arduino motor shield. In the tutorial you can find also the programming code to control the stepper motors;
  • Arduino and the official motor shield R3 – a good example how to write a program to control a stepper motor with an Arduino board and Arduino compatible motor shield;
  • Motor Shield Tutorial – this is a complete tutorial with operational steps and programming code to control the DC motor using Arduino Duemilanove or Arduino Mega 1280 board;
  • Motor Shield with the Freescale Freedom Board – step by step guide to control stepper motors using an Arduino shield, CodeWarrior for MCU10.3 and Processor Expert;
  • Motor Shield – comprehensive tutorial to learn how to control the speed or the direction of a stepper motor using AF_Motor Arduino library;
  • Arduino Due + Motor Shield: DC motor – comprehensive documentation to drive a DC motor in both directions – forward and backward – using an Arduino Due board and an Arduino Motor Shield;

Shields

Below is a list with Arduino motor shields designed to be used in a wide range of robotic applications.

  • Arduino Motor Shield – motor shield Arduino compatible and designed for robotic applications that requires to drive DC and stepping motors. The board is used to control at the same time the speed and direction for two DC motors. The same motor shield is able to provide you information about the current absorption for each motor separately;
  • 2A Motor Shield For Arduino – this is an Arduino motor shield engineered to drive up to two DC motors with 2A current and control voltage between 7 to 12V. The shield is compatible with Arduino Mega and can be directly plugged into the Arduino board;
  • Ardumoto – Motor Driver Shield – the Ardumoto comes in a new version and with new features including a voltage control for 3.3 or 5v logic, separate VIN connection, and 3 pins available for PWM input. The shield is based on L298 H-bridge and can control up to two DC motors;
  • Pololu Dual VNH5019 Motor Driver Shield for Arduino – compatible with Arduino or Arduino clone boards, this shield was designed in order to control two DC motors with control voltage between 5.5 to 24 V and a continue 12A current for every channel;
  • Motor Shield V1.0 – compatible with the Arduino embedded system, the Motor Shield V1.0 is a powerful electronic component designed to drive two DC motors or only one 4-wire two-phase stepper motor. Used in robotics or mechanical applications, the shield includes an on-board 5V voltage regulator for Arduino board power;
  • Stepper Motor Shield For Arduino – this is a shield designed to drive up to two stepper motors and is full compatible with Arduino UNO R3. Also, the shield offer support for Wi-Fi, Bluetooth and RF modules;
  • Arduino Stepper Motor Shield – based on L6470 dSpin Motion Controller, the motor shield can be used in robotic applications with two 1.5A stepper motors that can be derived independently. Depending on motor voltage, the shield can be used for power supply with values between 12V DC or 24V DC;

Tutorials to Control Stepper Motors Without Shields

A stepper motor can be controlled using only the Arduino board without custom electronic circuit for control or feedback. In the following, I made a selection of tutorials from where you can learn how a stepper motor can be controlled and powered using an Aduino board and sensors such as a potentiometer.

Resources

From libraries to electronic parts and kits, in this section can be found software and hardware resources designed to be used for controlling stepper motors with Arduino boards.

This article was last modified on 26 February 2014.

Advertisement
Related Articles
Dragos George Calin
Dragos George Calin is an IT analyst who graduated Faculty of Electrical and Mechanical Engineering, specialization Industrial Automation and Informatics with a Bachelor of Science Degree in Engineering, Automation and Computer Science. He has a great passion for robots and web development.
8 comments
cemal
cemal

same comment has already been made but I will also ask it anyway, can you upload “Arduino Motor Shield + Wiring Tutorial ” again because the link is broken

Emerson
Emerson

I'm new to arduino and trying to get a Wantai Stepper #57BYGH420 to work with the arduino stepper shield.. having plenty of issues along the way. The first tutorial "Arduino Motor Shield + Wiring Tutorial " is missing now, any chance you have a backup somewhere or equivalent tutorial?

Nathan Hargrove
Nathan Hargrove

Thanks Dragos, Can the potentiometer be replaced with a voltage input in the knob exercise? I am wanting to use a voltage input to control position of the stepper motor.

John
John

Thanks for putting this resource together. Do you have anything for the novice as par as what parts to buy at the store if we want to put one of these examples together by chnace?

Aurelian Lazarut
Aurelian Lazarut

Dragos, Thanks for putting together a summary of Arduino shields and tutorials for steeper motors helping people to pick the right hardware/software solution for a given application. well done, keep up the good working, Aurelian Lazarut, Adaptive Design ltd. Ireland,

Dragos George Calin
Dragos George Calin

The “Arduino Motor Shield + Wiring Tutorial ” tutorial is not available anymore, but I add another one.

Dragos George
Dragos George

Hello Nathan, Yes you can use a voltage source to control a stepper motor, but the source must pass the barrier of a potentiometer for example the range 0 to 5V.

Dragos George
Dragos George

Hello John, At this moment are available only tutorials following to add in the next series of articles links to buy components.