L298N dual motor driver with ESP32

Supply 5 V Bus GPIO
ENAIN1IN2IN3IN4ENB12VGND5VOUT1OUT2OUT3OUT4

Pins and ESP32 wiring

PinRoleESP32 pinNotes
ENAInput (the ESP32 drives it)D25Motor A speed (PWM). Remove the jumper to use it
IN1Input (the ESP32 drives it)D26Motor A direction
IN2Input (the ESP32 drives it)D27Motor A direction
IN3Input (the ESP32 drives it)D32Motor B direction
IN4Input (the ESP32 drives it)D33Motor B direction
ENBInput (the ESP32 drives it)D23Motor B speed (PWM). Remove the jumper to use it
12VNot wired to the ESP32—Motor supply 5 to 35 V from a separate supply
GNDGroundGNDShare it with the motor supply and the ESP32 GND
5VNot wired to the ESP32—5 V output of the on-board regulator (jumper on, supply up to 12 V)
OUT1Not wired to the ESP32—Motor A
OUT2Not wired to the ESP32—Motor A
OUT3Not wired to the ESP32—Motor B
OUT4Not 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

Try it in 3D in BoardPilot

BoardPilot Part data (JSON)

Related parts

Part data: CC BY 4.0, free to reuse with credit to BoardPilot.