Motor Driver bl-tb6560-v2.0

I got this driver for 2.4A Stepper Motor. I wanted to use this with nodemcu. I had a circuit that I wired before with an arduino nano (which I tested briefly back then and it worked), but revisiting the project I was searching for what voltage levels it uses to make sure I don't fry my boards, but I see all online pages wire it to an UNO

I found online specs in the link below, but I am not clear whether I can control it with the nodemcu or not

I need some direction. Thanks

I believe that you can try if 3V output is enough for the opto input on motor driver, you won't break anything that way. It's all outputs from nodemcu. You probably need level converter to get it higher voltage, but you know when you try.

Let's wait for more opinions.

Cheers,
Kari

I am going to go off track a little bit.
I tried the board with arduino Uno and it worked fine, then I decided to try the easy driver which also worked well. I tried using the easy driver with arduino nano and it also worked with no problem. At this point I thought I am ready for the nodemcu (because in my mind it is a 3.3V board similar to the arduino nano). After wiring and powering up, i noticed the chip on the easy driver got burning hot, so I went back to the nano and everything works fine again. Why would that be? Aren't they both 3.3V? I also noticed the LED on the nodemcu is constantly ON.

An Easydriver is completely unsuitable for a 2.4 amp motor. Its max current is about 0.75 amp IIRC.

...R

Oops. I forgot to mention. I am doing this on a 0.3A motor. It left it running for a while and nothing gets hot. I am regretting not having a separate post for this :slight_smile:

sed003:
Oops. I forgot to mention. I am doing this on a 0.3A motor. It left it running for a while and nothing gets hot. I am regretting not having a separate post for this :slight_smile:

There is no problem with a single Thread if you make things clear.

However I am now unclear what the problem is.

Is there a general problem about the code to control any stepper motor
OR
Is it the case that the code works with an Easydriver and a low current motor but won't work with the TB6560 driver and the high current motor?

AFAIK the Easydriver defaults to microsteps so it can probably accept a higher step rate than if you are trying to drive the big motor with full steps. Always try a very low step rate to start with - maybe only 5 per second.

...R

Robin2:
There is no problem with a single Thread if you make things clear.

However I am now unclear what the problem is.

Thanks for the clarification :slight_smile:
Let's focus on the easy driver for now. Everything works with arduino uno and nano. The motor works fine in both directions. I had issues with nodemcu. The nodemcu LED stayed ON and the chip on the easydriver was hot. My question before I try again is, should it work? or do you see any reason why I shouldn't be trying this in the first place? for example may be the easy driver needs more voltage or current than what the nodemcu can handle.

As far as I can see from the Allegro A3967 datasheet the Easydriver should work fine with 3.3v input signals. The signal inputs on the chip draw only a tiny current.

As I don't have a nodemcu I have no idea what the LED is for.

It would be normal for the chip on the Easydriver to be so hot as to be uncomfortable to touch.

You have not told us what power supply you are using for the stepper motor (volts and amps).

Does your nano work at 5v (and 16MHz) or 3.3v (and 8MHz)?

...R

You know what, I just realized that the nano I am using is 16M 5V. I went back to my ebay purchases and the specs say 5V. I assumed it had both because there is a 3.3V pin on it. When I am using arduinos, there is no heat at all even after running the motor for a while, so it looks like I have to use a voltage level converter then. Right? Because the ESP12E (nodemcu) is only 3.3V

sed003:
so it looks like I have to use a voltage level converter then. Right? Because the ESP12E (nodemcu) is only 3.3V

It looks as if you did not read the first sentence of Reply #7.

Of course Sparkfun may have some other components on the Easydriver board that only work with 5v.

Post the program that works using the nano and causes a problem with the nodemcu

...R

It's the sparkfun code as is
https://learn.sparkfun.com/tutorials/easy-driver-hook-up-guide/all

/****************************************************************************** 
SparkFun Easy Driver Basic Demo
Toni Klopfenstein @ SparkFun Electronics
March 2015
https://github.com/sparkfun/Easy_Driver

Simple demo sketch to demonstrate how 5 digital pins can drive a bipolar stepper motor,
using the Easy Driver (https://www.sparkfun.com/products/12779). Also shows the ability to change
microstep size, and direction of motor movement.

Development environment specifics:
Written in Arduino 1.6.0

This code is beerware; if you see me (or any other SparkFun employee) at the local, and you've found our code helpful, please buy us a round!
Distributed as-is; no warranty is given.

Example based off of demos by Brian Schmalz (designer of the Easy Driver).
http://www.schmalzhaus.com/EasyDriver/Examples/EasyDriverExamples.html
******************************************************************************/
//Declare pin functions on Redboard
#define stp 2
#define dir 3
#define MS1 4
#define MS2 5
#define EN  6

//Declare variables for functions
char user_input;
int x;
int y;
int state;

void setup() {
 pinMode(stp, OUTPUT);
 pinMode(dir, OUTPUT);
 pinMode(MS1, OUTPUT);
 pinMode(MS2, OUTPUT);
 pinMode(EN, OUTPUT);
 resetEDPins(); //Set step, direction, microstep and enable pins to default states
 Serial.begin(115200); //Open Serial connection for debugging
 Serial.println("Begin motor control");
 Serial.println();
 //Print function list for user selection
 Serial.println("Enter number for control option:");
 Serial.println("1. Turn at default microstep mode.");
 Serial.println("2. Reverse direction at default microstep mode.");
 Serial.println("3. Turn at 1/8th microstep mode.");
 Serial.println("4. Step forward and reverse directions.");
 Serial.println();
}

//Main loop
void loop() {  
 while(Serial.available()){
     user_input = Serial.read(); //Read user input and trigger appropriate function
     digitalWrite(EN, LOW); //Pull enable pin low to allow motor control
     if (user_input =='1')
     {
        StepForwardDefault();
     }
     else if(user_input =='2')
     {
       ReverseStepDefault();
     }
     else if(user_input =='3')
     {
       SmallStepMode();
     }
     else if(user_input =='4')
     {
       ForwardBackwardStep();
     }
     else
     {
       Serial.println("Invalid option entered.");
     }
     resetEDPins();
 }
}

//Reset Easy Driver pins to default states
void resetEDPins()
{
 digitalWrite(stp, LOW);
 digitalWrite(dir, LOW);
 digitalWrite(MS1, LOW);
 digitalWrite(MS2, LOW);
 digitalWrite(EN, HIGH);
}

//Default microstep mode function
void StepForwardDefault()
{
 Serial.println("Moving forward at default step mode.");
 digitalWrite(dir, LOW); //Pull direction pin low to move "forward"
 for(x= 1; x<1000; x++)  //Loop the forward stepping enough times for motion to be visible
 {
   digitalWrite(stp,HIGH); //Trigger one step forward
   delay(1);
   digitalWrite(stp,LOW); //Pull step pin low so it can be triggered again
   delay(1);
 }
 Serial.println("Enter new option");
 Serial.println();
}

//Reverse default microstep mode function
void ReverseStepDefault()
{
 Serial.println("Moving in reverse at default step mode.");
 digitalWrite(dir, HIGH); //Pull direction pin high to move in "reverse"
 for(x= 1; x<1000; x++)  //Loop the stepping enough times for motion to be visible
 {
   digitalWrite(stp,HIGH); //Trigger one step
   delay(1);
   digitalWrite(stp,LOW); //Pull step pin low so it can be triggered again
   delay(1);
 }
 Serial.println("Enter new option");
 Serial.println();
}

// 1/8th microstep foward mode function
void SmallStepMode()
{
 Serial.println("Stepping at 1/8th microstep mode.");
 digitalWrite(dir, LOW); //Pull direction pin low to move "forward"
 digitalWrite(MS1, HIGH); //Pull MS1, and MS2 high to set logic to 1/8th microstep resolution
 digitalWrite(MS2, HIGH);
 for(x= 1; x<1000; x++)  //Loop the forward stepping enough times for motion to be visible
 {
   digitalWrite(stp,HIGH); //Trigger one step forward
   delay(1);
   digitalWrite(stp,LOW); //Pull step pin low so it can be triggered again
   delay(1);
 }
 Serial.println("Enter new option");
 Serial.println();
}

//Forward/reverse stepping function
void ForwardBackwardStep()
{
 Serial.println("Alternate between stepping forward and reverse.");
 for(x= 1; x<5; x++)  //Loop the forward stepping enough times for motion to be visible
 {
   //Read direction pin state and change it
   state=digitalRead(dir);
   if(state == HIGH)
   {
     digitalWrite(dir, LOW);
   }
   else if(state ==LOW)
   {
     digitalWrite(dir,HIGH);
   }
   
   for(y=1; y<1000; y++)
   {
     digitalWrite(stp,HIGH); //Trigger one step
     delay(1);
     digitalWrite(stp,LOW); //Pull step pin low so it can be triggered again
     delay(1);
   }
 }
 Serial.println("Enter new option:");
 Serial.println();
}

sed003:
It's the sparkfun code as is

As I am not familiar with the nodemcu I wonder if these pin definitions are appropriate for it

#define stp 2
#define dir 3
#define MS1 4
#define MS2 5
#define EN  6

To make it easy for people to help you please modify your post and use the code button </>
codeButton.png

so your code looks like this and is easy to copy to a text editor. See How to use the Forum

...R

Thanks. I didn't see that because I was using quick reply. I fixed it.
Going back to my issue. I verified the wiring again just in case I was wrong the first time and I used a voltage level converter, but the motor doesn't move. I plugged the grounds together, pins from the nodemcu(esp12e) connected to the LV side and the easydriver control pins to the HV side. The LED on the esp12e goes ON steady (usually it is off unless there is activity). This time there is no heat (although slightly warm which I think is no big deal). The reason I use the nodemcu is because it has builtin wifi so it is more practical than the nano. I've experimented with different wifi boards for the nano but either had memory problems (deek-robot) or reliability issues (esp1).

I have run out of ideas.

I plugged the grounds together, pins from the nodemcu(esp12e) connected to the LV side and the easydriver control pins to the HV side.

Make a simple pencil drawing showing the connections and post a photo of the drawing. Verbal descriptions of wiring are too easy to misunderstand.

The LED on the esp12e goes ON steady (usually it is off unless there is activity).

The LED will respond in some very specific way - you need to to read up to discover exactly what it shows. I would be very surprised if it has anything to do with the use of a stepper motor.

...R

sed003:
Oops. I forgot to mention. I am doing this on a 0.3A motor. It left it running for a while and nothing gets hot. I am regretting not having a separate post for this :slight_smile:

A stepper motor should get quite hot, that's normal.