How To Program BTS 7960 Shield Motor Driver with Arduino

January 15, 2019. Indonesia.

Hello guys, this is our first tutorial, how to program BTS 7960 Motor Driver using Arduino (Nano/Uno).

Hasil gambar untuk bts 7960
BTS 7960 Motor Driver

We will try to give you simple source code.

1 Shield only can drive 1 Motor, but you can connecting 2 motors parallel, optional.

This BTS consist of 6 pin connected to Arduino.

VCC -> Connected to 5 Volt ,
GND -> Ground , L EN – > digital Pin, R EN -> digital Pin, L PWM -> pwm pin Arduino, R PWM -> pwm pin arduino.

Hasil gambar untuk bts 7960 PIN
BTS 7960 pin (https://electronics.stackexchange.com/questions/398556/how-to-control-a-motor-driver-bts7960-without-pwm)

=================SAMPLE CODE===================================

int R_EN1 = A0;
int L_EN1 = A1;
int RPWM1 = 10;
int LPWM1 = 11;

void setup() {
// put your setup code here, to run once:
pinMode(R_EN1,OUTPUT);
pinMode(L_EN1,OUTPUT);
pinMode(RPWM1,OUTPUT);
pinMode(LPWM1,OUTPUT);
digitalWrite(R_EN1,HIGH); //Give R Enable pin to HIGH
digitalWrite(L_EN1,HIGH); //Give L Enable pin to HIGH }

void loop(){ analogWrite(RPWM1,0); analogWrite(LPWM1,200); //if you want to rotate Clockwise with speed 200. }

================================================================

If you want to rotating Counter Clockwise, Set RPWM1 speed into (0-255), then give zero (0) to LPWM1.

Happy Trying!

News and Feed

Leave a Reply

Your email address will not be published. Required fields are marked *