BTS7960 43 A motor driver (IBT-2) with ESP32
Supply 5 V
Bus GPIO
Pins and ESP32 wiring
| Pin | Role | ESP32 pin | Notes |
|---|---|---|---|
| RPWM | Input (the ESP32 drives it) | D25 | Forward PWM |
| LPWM | Input (the ESP32 drives it) | D26 | Reverse PWM |
| R_EN | Input (the ESP32 drives it) | D27 | HIGH to enable. Often tied to L_EN |
| L_EN | Input (the ESP32 drives it) | D32 | HIGH to enable |
| R_IS | Analog output | D34 | Current sense. Can exceed 3.3 V on a fault: add a divider before an ADC pin |
| L_IS | Analog output | D35 | Current sense. Can exceed 3.3 V on a fault: add a divider before an ADC pin |
| VCC | Power | VIN | 5 V logic supply: use VIN. Inputs via a 74HC244 buffer: 3.3 V is below spec, often works |
| GND | Ground | GND | |
| B+ | Not wired to the ESP32 | — | Motor supply + 6 to 27 V (screw terminal) |
| B- | Not wired to the ESP32 | — | Motor supply - (screw terminal) |
| M+ | Not wired to the ESP32 | — | Motor |
| M- | Not wired to the ESP32 | — | Motor |
Suggested wiring for the 30-pin ESP32 DevKit, avoiding flash, input-only and strapping pins. BoardPilot checks it for you as you wire.
This module is sold for 5 V. Its outputs may be 5 V: use a level shifter or a voltage divider on ESP32 inputs.
Starter code (Arduino)
void setup() { Serial.begin(115200); }
void loop() {
int mv = analogReadMilliVolts(34); // R_IS on GPIO 34
Serial.println(mv);
delay(200);
}
Sources
- Infineon BTS7960 datasheet, Supply 5.5 to 27.5 V; IS current sense output
Try it in 3D in BoardPilot
Related parts
18650 Li-ion cell in holder28BYJ-48 stepper + ULN2003 driver433 MHz transmitter (FS1000A)74HC595 shift registerA4988 stepper driverActive buzzer
Part data: CC BY 4.0, free to reuse with credit to BoardPilot.