20160122_122057

Arduino + Stepper Motor + 2Amp Motor Driver Shield

INTRODUCTION:

A stepper motor is an electric motor that rotates in discrete step increments. The movement of each step is precise and repeatable; therefore, the motor’s position can be controlled precisely without any feedback mechanism, as long as the motor is carefully sized to the application. This type of control eliminates the need for expensive sensing and feedback devices such as optical encoders. The position is known simply by keeping track of the input step pulses. It is one of the most versatile forms of positioning systems. They are typically digitally controlled as part of an open loop system and are simpler and more rugged than closed loop servo systems.

 

HARDWARE REQUIRED:

  1. Arduino Uno
  2. USB Mini Cable (2.0)
  3. Adapter 12V 2A
  4. 2 Amp Motor Driver Shield
  5. Bipolar Stepper Motor or Unipolar Stepper Motor

 

SOFTWARE REQUIRED:

Please refer to “Getting Started with Arduino” tutorial.

 

SUGGESTED READING

  1. How Does Stepper Motor Works – Part 1
  2. How Does Stepper Motor Works – Part 2

 

HARDWARE SETUP:

 

10244

1)Firstly, check the Motor Driver Shield by pressing the tester button on top of it.If all the 

      motor LEDs blink, you can proceed.

20160122_145346

2)Then, connect the 2Amp Motor Driver Shield to the Arduino Uno.

2016-01-22 13.42.26

3)After that, connect the Stepper Motor to the 2Amp Motor Driver Shield using jumper wires by referring to the datasheet. You can refer to Fritzing schematic diagram shown below. (in Schematic diagram section)

20160122_122057

4)Then, plug in the USB B type cable to Arduino Uno.

20160122_122234

5)Plug in the power supply to the Arduino UNO as well.

20160120_135742

6)Then you will notice the green LED will light up.

2016-01-22 13.41.02

7)Go to the Arduino IDE and create your coding.

8)Then upload your coding.

9)Finally, the Stepper Motor will rotate.

20160120_135748

 

Circuit diagram:

The connection stepper motor to Shield 2A motor is shown in fritzing schematic diagram below:

Untitled Sketch_bb

CODE OVERVIEW:

[code]

#include “Shield2AMotor.h”

// Connect 4 pin on SHIELD-2AMOTOR to “Signed Magnitude” mode
Shield2AMotor motor(SIGNED_MAGNITUDE);

signed int leftSpeed, rightSpeed;

int i;

void setup()
{

}

void loop()
{
// Rotate 360 degree CW
for(i = 0; i < 50; i++)
{
motor.control(100, 0);
motor.control(0, 100);
delay(10);
motor.control(0, 100);
motor.control(-100, 0);
delay(10);
motor.control(-100, 0);
motor.control(0, -100);
delay(10);
motor.control(0, -100);
motor.control(100, 0);
delay(10);
}
delay(1000);

// Rotate 360 degree CCW
for(i = 0; i < 50; i++)
{
motor.control(0, -100);
motor.control(-100, 0);
delay(10);
motor.control(-100, 0);
motor.control(0, 100);
delay(10);
motor.control(0, 100);
motor.control(100, 0);
delay(10);
motor.control(100, 0);
motor.control(0, -100);
delay(10);
}
delay(1000);
}[/code]

 

REFERENCE:

ATTACHMENT:

Buy

2 thoughts on “Arduino + Stepper Motor + 2Amp Motor Driver Shield

  1. Hi! I’ve not enough knowledge in the use of the motor shield(shield2amotor) with the arduino program. Can you tell me how to include Shield2AMotor.h library in the arduino program?

  2. Hi YYMT, you can just click sketch in arduino IDE and then click include library and just add the library by add .ZIP library. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *