Used especially in educational projects or by hobbyists, the Arduino board is a pretty awesome open-source electronic platform used in a wide range of robotics applications. Controlling stepper motors are an easy job using an Arduino board that can work with advanced circuits or simple electronic components like sensors.
An electric motor has to be powered by an electric source and there are two possibilities to supply the motor with power. These two possibilities described in this article use Arduino board or a shield. Using only an Arduino board, a stepper motor can be powered from the DC jack of the board. The second possibility is to use the terminal block of the shield.
Using the simplest method to supply the motor with energy directly from the Arduino board is not always the right method. This method can be applied in general for small stepper motors that require small current values to spin.
Using shields can be controlled at the same time one or more stepper motors including here the control of speed and the motor rotation direction.
Stepper motors can be split into two types: unipolars and bipolars. The type of the motor is important to determine the compatible electronic devices. 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. Stepper motors with a higher voltage of 24V is less common for small steppers.
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 make an overview of tutorials and resources to control stepper motors using Arduino boards and electronic components.
Tutorials to Control Stepper Motors Using Shields
When a medium or complex robotic project is ongoing and requires the control of one or more stepper motor, a new electronic component enters in the control system and is called – shield. A shield is a module used to drive the electric motor, is an electronic component designed to control the speed and direction of an electric motor. Used along with an Arduino board, a powerful control system is created and allows users to control one or more electric motors in different ways.
- Arduino Motor Shield Tutorial – complete tutorial about how to interface two DC motors or one stepper motor to an Arduino board using an Arduino compatible shield. In the tutorial is available programming code to control the stepper motors.
- Arduino and the official motor shield R3 – programming code to control one stepper motor with an Arduino board and shield-compatible Arduino board.
- Motor Shield Tutorial – 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 – steps to control stepper motors using an Arduino shield and CodeWarrior for MCU10.3 and Processor Expert.
- Motor Shield – comprehensive tutorial 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.
Below is a list with Arduino compatible shields that can be used in medium to complex robotic applications.
- Arduino Motor Shield – motor shield Arduino compatible and designed to be used in robotic applications that requires to drive DC and stepping motors. The board is used to control at a time the speed and direction for two DC motors and it can be used to report the current absorption for each motor separately.
- 2A Motor Shield For Arduino – used to drive maximum two DC motors with 2A current and control voltage between 7 to 12V. The shield is Arduino Mega compatible and can be directly mounted onto board.
- Ardumoto – Motor Driver Shield – a new version was released 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 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 board, Motor Shield V1.0 is a powerful electronic component designed to drive two DC motors or 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 – a shield designed to drive 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 shield can be used in robotics application with two 1.5A stepper motors that can be derived independently. Depending on motor voltage, the shield can be used with power supply with values between 12V DC or 24V DC.
Tutorials to Control Stepper Motors Without Shields
A stepper motor can be controlled using an Arduino board and a shield or without custom electronic circuit for control or feedback. Below I made a selection of tutorials that describe how a stepper motor can be controlled using an Aduino board and sensors like a potentiometer.
- Stepper Motor Knob – complete tutorial with schematic circuits to control unipolar stepper and bipolar stepper motors using an Arduino board and a potentiometer.
- Arduino Stepper Motor Control – simple project to control a stepper motor with diagram circuit and programming code.
- Arduino Lesson – Stepper Motors – steps to learn how a DC motor can be controlled using an Arduino board and an L293D motor control chip.
- Stepper Motors – with a good explanation for differences between bipolar and unipolar stepper motors, this tutorial contain all steps to control a stepper motor using Arduino board.
- Controlling a Stepper Motor with an Arduino – a short demonstration how can be used a set of 3904 transistors to power and control stepper motors using an Arduino board.
- Sample code and projects to get your stepper running – examples how can be used the EasyDrivers or BigEasyDrivers stepper motor driver boards to control stepper motors. Programming code is available for all examples in the tutorial.
- Driving a Bipolar Stepper Motor with Arduino and ULN2803AG – tutorial where is explained how a bipolar stepper motor can be controlled using eight identical Darlington inverting amplifier circuits and an Arduino board.
- Stepper motor controller circuit and code – tutorial to control a stepper motor based on schema available on the Arduino website.
- Stepper Motor 5V 4-Phase 5-Wire & ULN2003 Driver Board for Arduino – tutorial with the schema and programming code to control a stepper motor using an Arduino board.
- Arduino/Motor Control/steppermotors – comprehensive documentation to control a stepper motor how to program their operation into Arduino.
- Stepper Motor drive from Arduino – simple circuit and programming code to control a stepper motor using an Arduino board. The stepper motor is a 4-wire bipolar Sparkfun type with a step angle of 1.8 degrees.
- Small Stepper Motor and Driver Board – tutorial with the wired diagram and schema to control a stepper motor with gear reduction.
- Use The EasyDriver Stepper Motor Driver + Arduino – tutorial with programming code to control a stepper motor using an EasyDrive driver. Programming code to control the rotations and the speed of a stepper motor.
- Unipolar Stepper Motor – simple and complex programming code to control a unipolar stepper motor using an Arduino board, ULN2003A Darlington Array with 7 drivers and a potentiometer.
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.
- Stepper Library;
- CustomStepper library;
- AccelStepper library for Arduino;
- Arduino Code for Controlling a Stepper Motor;
- EasyDriver Stepper Motor Driver;
- MAKE MotorShield Kit designed by Adafruit Industries in partnership with MAKE;