Martha MigliacioAlex Wong
Published © GPL3+

Using the Pmod STEP with Arduino Uno

Application notes for Pmod STEP and Arduino Uno. In this app, the motor makes a complete turn in one direction and then returns to origin.

EasyProtip1 hour161
Using the Pmod STEP with Arduino Uno

Things used in this project

Hardware components

Pmod STEP
Digilent Pmod STEP
×1
Digilent Stepper Motor
×1
Anduino Arduino Uno
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Pmod STEP and Arduino Uno Fritzing file

Fritzing file displaying the connection of the Pmod STEP to the Arduino Uno.

Pmod STEP and Arduino Uno Fritzing Image

Fritzing image displaying the connection between the Pmod STEP and Arduino Uno.
Pmodsteparduinouno bb xxl2knpaa0

Code

Pmod STEP and Arduino Uno Code

Arduino
Using this code will control a motor to complete a turn in one direction before returning to its position of origin.
/************************************************************************
*
* Test of Pmod STEP
*
*************************************************************************
* Description: Pmod_STEP
* The motor makes a complete turn in one direction and then returns to its position
* Of origin
*
* Material
* 1. Arduino Uno
* 2. Pmod STEP (set jumper JP1 in position 2-3)
*
************************************************************************/
#include <Stepper.h> // call library

#define enroulement_1 2 // Affectation of pins
#define enroulement_2 3
#define enroulement_3 4
#define enroulement_4 5

const int nombre_pas=2048; // Number of motor steps

Stepper moteur(nombre_pas, enroulement_1, enroulement_2, enroulement_3, enroulement_4); // Creation of
the object moteur

void setup()
{
Serial.begin(9600);
moteur.setSpeed(10); //Initializing the rotation speed of the motor in revolutions per minute
pinMode(enroulement_1, OUTPUT); // Pin configuration en sortie
pinMode(enroulement_2, OUTPUT);
pinMode(enroulement_3, OUTPUT);
pinMode(enroulement_4, OUTPUT);
}

void loop()
{
Serial.println("Sens 1");
for (int i=1; i<=nombre_pas; i++) // Motor advance loop as a function of the number of steps
{
 moteur.step(1); // A step in the positive direction
 /* Useful time delay to see the sequence of sequences on the led of the module.
 Decrease timing to increase engine speed.*/
 delay(100);
}
Serial.println("Sens 2");
for (int i=1; i<=nombre_pas; i++) // Return loop of the motor according to the number of steps
{
 moteur.step(-1); // One step in the negative direction
 /* Useful time delay to see the sequence of sequences on the led of the module.
 Decrease timing to increase engine speed.*/
 delay(100);
}
}

Credits

Martha Migliacio

Martha Migliacio

5 projects • 2 followers
Contact
Alex Wong

Alex Wong

5 projects • 6 followers
I work in Digilent and like creating projects
Contact
Thanks to Lextronics.

Comments

Add projectSign up / Login