@@passiontechklm Thanks! also can you tell me what these lines are doing?? digitalWrite(stepPin,HIGH); delayMicroseconds(500); digitalWrite(stepPin,LOW); delayMicroseconds(500);
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); }
I give all connections but not working and coding also upload but not rotating. I check motor also still no rotation. Give solution bro. I try so many times still nothing will happen. Reply
Thank you dude, it worked. Used a 12V adapter.
Can I use a 24V supply?
@@matheusm.a.1893 No for this project. Because it only compatitable for 12V
If I don't want any delays (no stops), should I just remove the delay(1000); line?? I want it to switch directions without stopping.
@@SyedRizvi-i4v Yes... remove the delay. you can edit the code to play around and see what the different
@@passiontechklm Thanks! also can you tell me what these lines are doing??
digitalWrite(stepPin,HIGH);
delayMicroseconds(500);
digitalWrite(stepPin,LOW);
delayMicroseconds(500);
Can you send link to power supply you used please?
You can use any AC to DC power supply 12V 3A and above.
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);
}
If I don't want any delays (no stops), should I just remove the delay(1000); line?? I want it to switch directions without stopping.
Step pin and the direction pin. Right?
do u have any arduino code for rotation base on degree?
Just burned the wires when putting 12 v in my bench power supply, what did I do wrong?
@@VishnuSomisetty-dw2xp I think may be you short positive wire and negative wire?
@@passiontechklm I am a beginner at this stuff but what does that mean?
@@VishnuSomisetty-dw2xp Means positive wire and negative wire are conneted / touch each others will cause to burn out wire
@@passiontechklm thanks I got it to work!
@@VishnuSomisetty-dw2xp Alright.... happy for you🤗
Can I not use 12VDC?
Yes, you can use 12vdc
I give all connections but not working and coding also upload but not rotating. I check motor also still no rotation. Give solution bro. I try so many times still nothing will happen. Reply
@@uwninja is it your power supply voltage and current not enough power to run?
My motor is not rotating fully
And rotating only in one direction
Plz hepl....
Please tell the name of motor
Nema17 12v stepper motor