Total Pageviews

Sunday, 28 October 2018

Interfacing NEMA 23 | NEMA 17 | NEMA 34 with TB6600 stepper motor driver



 Like, Share and Subscribe for more projects and tutorials

Code:

const int stepPin = 9;
const int dirPin = 8;
const int enPin = 13;
void setup() {
  pinMode(stepPin,OUTPUT);
  pinMode(dirPin,OUTPUT);

  pinMode(enPin,OUTPUT);
  digitalWrite(enPin,LOW);
 
}
void loop() {
 
  digitalWrite(dirPin,HIGH);     //  anticlockwise direction
  for(int x = 0; x < 800; x++) {
    digitalWrite(stepPin,HIGH);
    delayMicroseconds(500);
    digitalWrite(stepPin,LOW);
    delayMicroseconds(500);
  }
 delay(1000); // One second delay

  digitalWrite(dirPin,LOW);    // clockwise driection
  for(int x = 0; x < 800; x++) {
    digitalWrite(stepPin,HIGH);
    delayMicroseconds(500);
    digitalWrite(stepPin,LOW);
    delayMicroseconds(500);
  }
  delay(1000);
 
}





4 comments:

  1. I am so interested in your project and i have watched video for many times.Also i will start my robot project, i just buy 2 nema
    nema 17 stepper motor from oyostepper.com.

    ReplyDelete
  2. nema 23 stepper motor is a stepper motor with a 2.3 x 2.3 inch faceplate. It is suitable for 3d printer, robot arm, cnc machine,etc. In low-speed applications, the stepper motor can be driven at the desired speed without missing a single step.
    see more at oyostepper.com.

    ReplyDelete
  3. Hi pavandeep,
    i got the same exact things as you suggested in video and connected as per your recommendation. Code is also working fantasic when the arduino is connected to laptop. But when i disconnect the laptop, the motor does not run! what could be the problem, i have double verified and all connections are done very properly, so what could be the issue? Thanks for your reply in advance,
    harikrishna.

    ReplyDelete
  4. Hi iam doing a project I need help I want to controlle speed of a motor with potentiometer. P1 for one direction and P2 for another direction please help me to write code.


    Mail me to raj2018n@gmail.com

    ReplyDelete