First project ever - controlling a Stepper Motor (Arduino Uno + Motor Shield) help !

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 :wink:

It looks to me like you don't need the motor shield. The little red board is a stepper driver. I think it is an Easydriver.

Try this simple stepper code and have look at stepper motor basics

...R

Hi Robin, thanks for your help and these threads that you wrote, I'll definitely check them out. They seem perfect for a beginner.

I'll still be monitoring this thread, so if anyone has direct answers to my questions I'd be pleased to read them.

Refrigerator:
Hi Robin, thanks for your help and these threads that you wrote, I'll definitely check them out. They seem perfect for a beginner.

I'll still be monitoring this thread, so if anyone has direct answers to my questions I'd be pleased to read them.

Assuming you have an Easydriver board I have given you direct answers to all of your questions. If there is something in what I have written that you don't understand please let me know.

Perhaps the solution is not what you were expecting.

...R

Robin2:
Perhaps the solution is not what you were expecting.

You are probably right,
Also I checked and the stepper driver you showed me is exactly what I have. I'm currently reading your articles, hope I'll understand most of it (I'm not english)
Thanks

Refrigerator:
I'm currently reading your articles, hope I'll understand most of it (I'm not english)

If you have specific questions I will try to help.

...R

Hi Robin, thanks for your help.
So I read your thread which is well explained. I'm now currently reading this tutorial http://bildr.org/2011/06/easydriver/ as it is directly linked to my stepper driver.
The tutorial says you need 12V DC power supply, I checked in my garage and only have 5V DC power adapters (not enough voltage for the EasyDriver) and I also found an AC 12V power adapter... But it's AC. Can my motor work with AC ?

Otherwise I found this :

Sorry it is written in french (I live there)
Input: AC110-240V Output: 12V 3A

So is it a good idea to buy this off amazon and then I just have to mess up with the wires so they can fit in my easy driver ?
Or do some power supplies exist with little pins that I can just instantaniously plug in my driver? That would be more practical ! If so how are these power supplies/adapters called ? Where would you advise me to buy one ?

Thank you !

That power supply should be suitable - and it seems cheap.

If you have a choice of a higher voltage I would take it. The higher the better within the limits of the Easydriver board. A 1 amp supply would be sufficient, but extra amps don't cause a problem.

I don't think you will get any power supply with convenient connections. What you can do is buy a socket that fits the plug on your power supply and wire the socket to the Easydriver. That way you don't have to cut the wires on the power supply and you have a convenient way of disconnecting it.

Look at the Sparkfun or Pololu websites to get ideas for the bits and pieces you need. Then find a French electronic component supplier. In the UK there are RapidOnline, Hobbytronics, Proto-Pic and at the more commercial end Farnell and RS Components (and lots more)

...R