L298N dual motor driver with ESP32
Supply 5 V
Bus GPIO
Pins and ESP32 wiring
| Pin | Role | ESP32 pin | Notes |
|---|---|---|---|
| ENA | Input (the ESP32 drives it) | D25 | Motor A speed (PWM). Remove the jumper to use it |
| IN1 | Input (the ESP32 drives it) | D26 | Motor A direction |
| IN2 | Input (the ESP32 drives it) | D27 | Motor A direction |
| IN3 | Input (the ESP32 drives it) | D32 | Motor B direction |
| IN4 | Input (the ESP32 drives it) | D33 | Motor B direction |
| ENB | Input (the ESP32 drives it) | D23 | Motor B speed (PWM). Remove the jumper to use it |
| 12V | Not wired to the ESP32 | — | Motor supply 5 to 35 V from a separate supply |
| GND | Ground | GND | Share it with the motor supply and the ESP32 GND |
| 5V | Not wired to the ESP32 | — | 5 V output of the on-board regulator (jumper on, supply up to 12 V) |
| OUT1 | Not wired to the ESP32 | — | Motor A |
| OUT2 | Not wired to the ESP32 | — | Motor A |
| OUT3 | Not wired to the ESP32 | — | Motor B |
| OUT4 | Not wired to the ESP32 | — | Motor B |
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.
Sources
- ST L298 datasheet, Logic inputs: HIGH level from 2.3 V; about 2 V drop across the bridge
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.