Things used in this project

Hardware components:
Pmod step  52106.1456867383.500.659
Digilent Pmod STEP
×1
Anduino Arduino Uno
×1
Digilent Stepper motor
×1
Software apps and online services:
Ide web
Arduino IDE

Schematics

Pmod STEP and Arduino Uno Fritzing file
Fritzing file displaying the connection of the Pmod STEP to the Arduino Uno.
pmodsteparduinouno_blxp9ojPU8.fzz
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 CodeArduino
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

01aa44817a11ceb1a3050ebac4b68bbc
Martha Migliacio
1 project • 0 followers
Contact
Thanks to Lextronics.

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Add projectSign up / Login