Hi. First of all I am en extreme newbie at this so sorry if I lack some of the basics.
I have a project for my school where (among many other things) I have to control a stepper motor with an Arduino Uno and a card called "Arduino Motor Shield". Here's a high def picture of it (it is installed or "plugged" on the Arduino Uno right beneath it)
Next, here is the stepper motor. I couldn't find it's references on the internet, it looks pretty cheap and isn't very big. So I don't know what amount of power (what voltage ?) I should send to it... Is this even an issue ?
As you could see, the stepper motor is directly linked to a little card that has 3 electric wires (green, black, yellow). These 3 wires are connected to 3 different functions on the red card thingy : "GND", "STEP", and "DIR". Here's another image so that I'm sure I'm being clear :
The 3 functions are written on the bottom left of the board, hope you can see them.
Correct me if I'm wrong,
GND is to control the amount of power of the motor (its speed)
DIR controls which way the motor rotates
STEP : what is that for ?
My main problem is understanding where to connect these 3 cables to the Arduino Motor Shield. I've watched a few tutorials and in each tutorial they plug the pins in different places on the Motor Shield. (some will put the pins in the blue thing at the top of the board by unscrewing the little screws, others will put the pins in some of the black slots...) Also, in many tutorials, there are only 2 cables coming out of the motor, and not 3 (my case).
So what is the most optimal place to put these three wires ?
Additionnel question : Am I supposed to buy some kind of power supply to make the motor work or is the electric power coming from the USB cable sufficient ? (that would be much more convenient)
Here's an example of code that I'm using just to mess around with the motor (The code runs fine but never successfully worked, nothing ever happens with the motor, obviously)
#include <AFMotor.h>
AF_DCMotor moteur1(WHAT AM I SUPPOSED TO ENTER HERE ??);
void setup(){
motor1.run(RELEASE);
}
void loop(){
motor1.run(FORWARD);
motor1.setSpeed(255);
delay(1000);
motor1.run(RELEASE);
delay(1000);
motor1.run(FORWARD);
motor1.setSpeed(200);
delay(10000);
}
I tried to run the code by trying to plug the motor to different ports on the Arduino Shield and writing the name of the port in the parenthesizes with CAPS TEXT in them (see above). Nothing ever happens.
I'm really sorry if this thread is boring and cringy to read, but it would be so helpful if somebody could guide me through my first hours using Arduino. Thank you