Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

ESP32-Controlled Dual DC Motor Driver for Robotic Vehicle

Image of ESP32-Controlled Dual DC Motor Driver for Robotic Vehicle

Circuit Documentation

Summary

The circuit in question is designed to control a pair of DC gearmotors using an L298N DC motor driver, which is interfaced with an ESP32 microcontroller. The system is powered by a 12V battery, which supplies power to both the motor driver and the ESP32. The ESP32 sends control signals to the L298N driver to manage the direction and speed of the motors. This setup could be used for a small robotic vehicle or any application requiring controlled motion with DC motors.

Component List

L298N DC Motor Driver

  • Description: A motor driver module capable of driving two DC motors or one stepper motor.
  • Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB

ESP32 (30 pin)

  • Description: A microcontroller with Wi-Fi and Bluetooth capabilities, featuring a wide range of GPIO pins.
  • Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, Vin, D23, D22, TX0, RX0, D21, D19, D18, D5, TX2, RX2, D4, D2, D15, 3V3

12V Battery

  • Description: A power source for the circuit.
  • Pins: -, +

Gearmotor DC Wheels (Left and Right)

  • Description: DC motors with gear reduction, used for driving wheels.
  • Pins: PIN1, PIN2

Wiring Details

L298N DC Motor Driver

  • 12V: Connected to the + terminal of the 12V Battery.
  • GND: Connected to the - terminal of the 12V Battery and GND of ESP32.
  • 5V: Connected to the Vin of ESP32.
  • OUT1: Connected to PIN2 of the left Gearmotor and PIN1 of the right Gearmotor.
  • OUT2: Connected to PIN1 of the left Gearmotor and PIN2 of the right Gearmotor.
  • OUT3: Connected to PIN2 of the second right Gearmotor and PIN1 of the second left Gearmotor.
  • OUT4: Connected to PIN1 of the second right Gearmotor and PIN2 of the second left Gearmotor.
  • ENA: Connected to D32 of ESP32.
  • IN1: Connected to D14 of ESP32.
  • IN2: Connected to D27 of ESP32.
  • IN3: Connected to D26 of ESP32.
  • IN4: Connected to D25 of ESP32.
  • ENB: Connected to D33 of ESP32.

ESP32 (30 pin)

  • GND: Connected to the - terminal of the 12V Battery and GND of L298N DC Motor Driver.
  • Vin: Connected to the 5V of L298N DC Motor Driver.
  • D32: Connected to ENA of L298N DC Motor Driver.
  • D14: Connected to IN1 of L298N DC Motor Driver.
  • D27: Connected to IN2 of L298N DC Motor Driver.
  • D26: Connected to IN3 of L298N DC Motor Driver.
  • D25: Connected to IN4 of L298N DC Motor Driver.
  • D33: Connected to ENB of L298N DC Motor Driver.

12V Battery

  • +: Connected to the 12V of L298N DC Motor Driver.
  • -: Connected to the GND of L298N DC Motor Driver and GND of ESP32.

Gearmotor DC Wheels (Left and Right)

  • Left Gearmotor PIN1: Connected to OUT2 of L298N DC Motor Driver.
  • Left Gearmotor PIN2: Connected to OUT1 of L298N DC Motor Driver.
  • Right Gearmotor PIN1: Connected to OUT1 of L298N DC Motor Driver.
  • Right Gearmotor PIN2: Connected to OUT2 of L298N DC Motor Driver.
  • Second Left Gearmotor PIN1: Connected to OUT3 of L298N DC Motor Driver.
  • Second Left Gearmotor PIN2: Connected to OUT4 of L298N DC Motor Driver.
  • Second Right Gearmotor PIN1: Connected to OUT4 of L298N DC Motor Driver.
  • Second Right Gearmotor PIN2: Connected to OUT3 of L298N DC Motor Driver.

Documented Code

Since no code was provided for the ESP32 microcontroller, this section is left blank. Normally, this section would include the source code for the microcontroller, along with comments explaining the functionality of the code and how it interacts with the hardware components.