Problem with uploading code to arduino with NEMA17

Hi,

I have a problem with my arduino UNO. I am trying to use a stepper motor called nema17. I can’t upload the code to the arduino.

The circuit schematic i use is on this site (same for the code):

I get this error message:
Arduino: 1.6.13 (Windows 10), Board:“Arduino/Genuino Uno”

De schets gebruikt 1.048 bytes (3%) programma-opslagruimte. Maximum is 32.256 bytes.
Globale variabelen gebruiken 9 bytes (0%) van het dynamisch geheugen. Resteren 2.039 bytes voor lokale variabelen. Maximum is 2.048 bytes.
avrdude: ser_open(): can’t open device “\.\COM3”: Het systeem kan het opgegeven bestand niet vinden.

Probleem bij het uploaden naar het board. Zie http://www.arduino.cc/en/Guide/Troubleshooting#upload voor suggesties.

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

The code i use:

/*     Simple Stepper Motor Control Exaple Code
 *      
 *  by Dejan Nedelkovski, www.HowToMechatronics.com
 *  
 */
// defines pins numbers
const int stepPin = 3; 
const int dirPin = 4; 
 
void setup() {
  // Sets the two pins as Outputs
  pinMode(stepPin,OUTPUT); 
  pinMode(dirPin,OUTPUT);
}
void loop() {
  digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction
  // Makes 200 pulses for making one full cycle rotation
  for(int x = 0; x < 200; x++) {
    digitalWrite(stepPin,HIGH); 
    delayMicroseconds(500); 
    digitalWrite(stepPin,LOW); 
    delayMicroseconds(500); 
  }
  delay(1000); // One second delay
  
  digitalWrite(dirPin,LOW); //Changes the rotations direction
  // Makes 400 pulses for making two full cycle rotation
  for(int x = 0; x < 400; x++) {
    digitalWrite(stepPin,HIGH);
    delayMicroseconds(500);
    digitalWrite(stepPin,LOW);
    delayMicroseconds(500);
  }
  delay(1000);
}

SanderKolkman:
avrdude: ser_open(): can't open device "\.\COM3": Het systeem kan het opgegeven bestand niet vinden.

That does not seem to be a problem with your program. It seems that the Arduino IDE cannot find open COM3. Are you sure that is what your Arduino is connected to?

...R
Stepper Motor Basics
Simple Stepper Code

Hi,
I had put the gnd cable to the VDD and the 5v cable to the gnd. It needs to be 5v to VDD and gnd to gnd if i am right. Now does the lights work on my arduino and i can upload things to the arduino. Here starts my next problem. The stepper motor doesn't step. Can someone help?

SanderKolkman:
The stepper motor doesn't step. Can someone help?

Did you read the links I gave you?

You need to ...

  • Post a link to the datasheet for your motor
  • Tell us what stepper driver you are using
  • Tell us what motor power supply you are using (volts and amps)
  • Provide a diagram showing how you have everything connnected - a photo of a pencil drawing is great

...R