I am testing my BTS7960 Module with my UNO for bi-directional rotation of DC Motor. I am using a small DC motor as a test (like the one here) and I am powering the UNO via USB cable. The problem is whenever I try to shift it to take power from my MB102 supply instead of USB connector, the DC motor starts shuddering and stalling. But it runs completely fine when connected via USB cable. I think there is something wrong with my connections but I can't figure out where.
The code is fairly straightforward and is attached below
void setup() { // put your setup code here, to run once:
Serial.begin(9600);
pinMode(2,OUTPUT); //R_EN
pinMode(3,OUTPUT); //L_EN
pinMode(8,OUTPUT); //L_PWM
pinMode(12,OUTPUT); // R_PWM
digitalWrite(3,HIGH);
digitalWrite(2,HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(12,HIGH);
delay(5000);
digitalWrite(12,LOW);
delay(1000);
digitalWrite(8,HIGH);
delay(5000);
digitalWrite(8,LOW);
delay(1000);
}
I am trying to find a good circuit simulator for the schematics for better visualization, if anyone has any leads it would be really appreciated
The connections are as follows:
DC 12V is provided to BTS7960. The R_EN and L_EN are connected to pins 2 and 3 of the Arduino. the R_PWM and L_PWM are connected to digital pins 8 and 12 of the Arduino. VCC and Ground are connected to +5 and GND pins respectively while another GND pin is connected to the DC12V negative.
When connecting MB102, DC12 is supplied via the Jack while the +5V and GND Headers are used to supply power to Arduino via Vin and GND Pin of Arduino respectively.