BTS7960 and nano

Hi,

I want to use a BTS7960 to control a linear actuator with an Arduino nano.
Previously I used an L298N but the actuator draws too much current. So I turned to the BTS7960.
Before integrating it with the actuator, I tried the code below:

METHOD 1 :

#define RPWM 9 // pin D9 pin RPWM BTS7960
#define LPWM 10 // pin D10 pin LPWM BTS7960
#define PWM 11 //  pin D11 pin R_EN and L_EN BTS7960

void motor_CW() {
  digitalWrite (LPWM, LOW);
  digitalWrite (RPWM, HIGH);
  analogWrite (PWM,255);
  Serial.println ("CW");
}

void motor_CCW() {
  digitalWrite (LPWM, HIGH);
  digitalWrite (RPWM, LOW);
  analogWrite (PWM,255); 
  Serial.println ("CCW");
}

void motor_stop() {
  digitalWrite (LPWM, LOW);
  digitalWrite (RPWM, LOW);
  analogWrite (PWM,0);
  Serial.println ("STOP");
}

void setup() {
  Serial.begin (9600); 
  Serial.println ("START");
  pinMode (RPWM, OUTPUT);
  pinMode (PWM, OUTPUT);
  pinMode (LPWM, OUTPUT);
}

//Main program
void loop() { 
  motor_CW(); 
  delay (5000); 
  motor_stop();
  delay (5000);
  motor_CCW();
  delay (5000);
  motor_stop(); 
  delay (5000);
}

OR

METHOD 2 :

#define RPWM 9 // pin D9 pin RPWM BTS7960
#define LPWM 10 // pin D10 pin LPWM BTS7960
//#define PWM 11 //  pin D11 pin R_EN and L_EN BTS7960
//pin R_EN and L_EN BTS7960 to +5v Arduino

void motor_CW(int pwmSpeed) {
	analogWrite (LPWM, 0);
	analogWrite (RPWM, pwmSpeed);
	Serial.println ("CW");
}

void motor_CCW(int pwmSpeed) {
	analogWrite (LPWM, pwmSpeed);
	analogWrite (RPWM, 0);
	Serial.println ("CCW");
}

void motor_stop() {
	digitalWrite (LPWM, LOW);
	digitalWrite (RPWM, LOW);
	Serial.println ("STOP");
}

void setup() {
	Serial.begin (9600);
	Serial.println ("START");
	pinMode (RPWM, OUTPUT);
	pinMode (LPWM, OUTPUT);
}

//Main program
void loop() {
	motor_CW(255);
	delay (5000);
	motor_stop();
	delay (5000);
	motor_CCW(255);
	delay (5000);
	motor_stop();
	delay (5000);
	//Loop terus
}

The code works fine with LEDs but as soon as I put the module on it, the voltage from the GPIOs crashes to 2.7V.
My nano is powered by the USB port of the PC. +5v and gnd of the arduino are connected to VCC and GND of the module.
Do you have an idea ?
Thanks

You are doing good, I would have expected it to have completely fail. Look at the specification sheet for the BTS7960, it has a minimum voltage specification. It actually uses two power supplies, one for the motors which needs to be at least 6V (not sure of actual value but it is on the data sheet) and another 5V for the logic. Note the power and the logic ground are connected together on the module. Posting an annotated schematic, not a useless frizzy picture would help us a lot to help you. They do work fine with the Nano, I have connected upto 6 on one nano. Be sure the grounds are connected, losing them can blow the module. Power is also critical be sure you have enough.

Hi,
Thanks for your return.
I've connected the 2 power supplies (power and logic). Power at 12v and Logic at 5v from the arduino (which is powered via the USB port). I checked with a multimeter and the power and logical GNDs are connected to the same potential by the shield. I'm sorry but I don't have anything to do the diagrams.
Concerning the power, I've tested directly without Arduino by applying (R-EN, L-EN, RPWM= +5V and LPWM = GND) but same issue. Nothing on the output :frowning:

What diagrams are you talking about, I am looking for a schematic of your circuit which you have to generate. There are 12 pins/terminals of the on the BTS7960, which you have connected to something. You need to have that in your schematic and all the other parts you are using. We are not asking for schematics of the modules, just links to "Technical Information" on them that may give that information plus a lot of other stuff. If you do not want to do the schematic, no problem just expect a long time until you get the answer, but you will get a lot of guesses. I will check back later to see if the schematic is there, if not I will go help somebody else as I am doing now.

Thanks to take time.
Sorry if i'm not clear. In fact it's a simple Shield :grin:

it's the IBT2.

You have a computer that you installed the Arduino IDE in, you can also install KiCad or one of the many other CAD programs available for free or as a demo. KiCad if free, they ask for a donation but do not require it. That will take you from basic schematic capture through a multilayer very complicated PCB. KiCad will take a bit of time to learn as you apparently have no experience with CAD. It even has some Arduino devices in the library.

That has lots of nice pictures etc and as you say is simply but apparently it did not solve your problem. By the time you get the schematic drawn you will probably know what your problem is.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.