Motor Drive (BTS7960 43A) | A Beginner’s Guide

Need to know if your BTS7960 43A motor driver is working before you build the full project? This quick test sketch makes the motor run forward → stop → reverse → stop on repeat. If the direction changes cleanly and the driver stays cool, you gain confidence that the module isn’t defective. It’s the fastest way to validate wiring and outputs with minimal code.

This tutorial focuses on a basic functional test using two PWM pins: RPWM and LPWM. The sketch drives one side at a time to command direction and speed, then pauses between transitions. That simple pattern also helps you spot common issues like swapped motor leads, missing ground, or weak power supply.

You’ll test safely and step-by-step. We’ll cover the wiring checks, the expected behavior, and what symptoms usually mean “defective” versus “wiring/power problem.” After this, you can move on to adding enable pins, braking modes, and Arduino control logic with confidence.

Why Build?

First, it saves time and protects parts. A quick forward/reverse test catches wiring mistakes before you connect batteries, gearboxes, or expensive motors. It also reduces the risk of overheating a driver because you watch behavior in short cycles.

Second, it gives you a clear baseline. When you later add sensors, code logic, or remote control, you already know the motor driver works at the hardware level. That makes debugging much easier because you can separate “driver problem” from “software problem.”

Third, it teaches high-current motor basics. You learn that the driver needs a proper motor supply, thick wires, and a shared ground with the Arduino. You also learn to respect inrush current and why stable power matters more than fancy code.

What You’ll Learn

  • What the BTS7960 does: High-current H-bridge control for DC motors with forward/reverse direction.
  • PWM direction control: Use RPWM for forward and LPWM for reverse, never driving both at once in this test.
  • Speed setting: analogWrite() values (0–255) map to duty cycle, which controls motor speed.
  • Safe switching: Add short stops between direction changes to reduce stress and current spikes.
  • Power and grounding: Motor supply goes to the driver, and Arduino GND must share ground with the driver.
  • Defect vs wiring symptoms: How to interpret no motion, one direction only, heating, or buzzing.

Sample Code

const int RPWM = 5;
const int LPWM = 6;

void setup() {
  pinMode(RPWM, OUTPUT);
  pinMode(LPWM, OUTPUT);

  analogWrite(RPWM, 0);
  analogWrite(LPWM, 0);
  delay(500);
}

void loop() {
  // Forward (speed ~70%)
  analogWrite(RPWM, 180);
  analogWrite(LPWM, 0);
  delay(2000);

  // Stop
  analogWrite(RPWM, 0);
  analogWrite(LPWM, 0);
  delay(1000);

  // Reverse
  analogWrite(RPWM, 0);
  analogWrite(LPWM, 180);
  delay(2000);

  // Stop
  analogWrite(RPWM, 0);
  analogWrite(LPWM, 0);
  delay(1000);
}

How It Works

The sketch sets RPWM (pin 5) and LPWM (pin 6) as outputs and starts with both at zero. That ensures the driver is in a neutral state before the motor moves. A short delay after initialization helps the system settle before the first command.

In the main loop, the code drives forward by sending a PWM value (180 ≈ 70%) to RPWM while keeping LPWM at 0. After two seconds, it stops by setting both outputs to zero. Then it reverses by switching: LPWM gets the same PWM value while RPWM stays at 0, followed by another stop.

This pattern creates a simple, repeatable test cycle. If the wiring is correct and the module is healthy, the motor will spin one direction, stop cleanly, then spin the other direction. If the motor only spins one way, stutters, or the driver overheats quickly, you can narrow the issue to wiring, power, PWM pins, or a faulty board.

Applications & Extensions

Use this as your incoming inspection test for every BTS7960 module. You can confirm it works before installing it into robots, scooters, linear actuators, or heavy-load gear motors. It’s also a great “known-good” test when a motor system suddenly stops working.

Next, extend it to real controls. Add R_EN/L_EN pins if your board exposes them, and implement braking, coast, and smooth ramp-up/ramp-down. You can also read current/temperature externally to validate safe operation under load.

Finally, build full projects on top of it. Control speed with a potentiometer, add direction buttons, or integrate RC/joystick input. Once you trust the driver, you can safely scale into higher voltage motors and heavier loads—while keeping the same forward/stop/reverse logic as your debugging tool.

Author: jomar