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

ESP32-Controlled Dual Motor Driver for Robotic Vehicle

Image of ESP32-Controlled Dual Motor Driver for Robotic Vehicle

Circuit Documentation

Summary

The circuit described in the provided inputs is designed to control a set of four gearmotors using an L298N DC motor driver, which is interfaced with an ESP32 microcontroller. The L298N motor driver receives power from a 12V battery and is capable of driving two pairs of DC motors, which are presumably used for a four-wheeled vehicle. The ESP32 microcontroller is responsible for providing control signals to the L298N to regulate the speed and direction of the motors. The battery also provides power to the ESP32 through a voltage regulator on the L298N, which steps down the voltage to 5V suitable for the microcontroller.

Component List

L298N DC Motor Driver

  • Description: A motor driver module capable of driving up to two DC motors.
  • 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 Right

  • Description: A DC gearmotor used for the right side wheels of a vehicle.
  • Pins: PIN1, PIN2.

Gearmotor DC Wheels Left

  • Description: A DC gearmotor used for the left side wheels of a vehicle.
  • Pins: PIN1, PIN2.

Wiring Details

L298N DC Motor Driver

  • OUT1 connected to Gearmotor DC Wheels Right (PIN1)
  • OUT2 connected to Gearmotor DC Wheels Left (PIN2)
  • 12V connected to 12V Battery (+)
  • GND connected to 12V Battery (-) and ESP32 (GND)
  • 5V connected to ESP32 (Vin)
  • OUT3 connected to Gearmotor DC Wheels Left (PIN1)
  • OUT4 connected to Gearmotor DC Wheels Right (PIN2)
  • ENA connected to ESP32 (D32)
  • IN1 connected to ESP32 (D14)
  • IN2 connected to ESP32 (D27)
  • IN3 connected to ESP32 (D26)
  • IN4 connected to ESP32 (D25)
  • ENB connected to ESP32 (D33)

ESP32 (30 pin)

  • GND connected to 12V Battery (-)
  • Vin connected to L298N DC Motor Driver (5V)
  • D32 connected to L298N DC Motor Driver (ENA)
  • D14 connected to L298N DC Motor Driver (IN1)
  • D27 connected to L298N DC Motor Driver (IN2)
  • D26 connected to L298N DC Motor Driver (IN3)
  • D25 connected to L298N DC Motor Driver (IN4)
  • D33 connected to L298N DC Motor Driver (ENB)

12V Battery

  • (+) connected to L298N DC Motor Driver (12V)
  • (-) connected to L298N DC Motor Driver (GND) and ESP32 (GND)

Gearmotor DC Wheels Right

  • PIN1 connected to L298N DC Motor Driver (OUT1)
  • PIN2 connected to L298N DC Motor Driver (OUT2)

Gearmotor DC Wheels Left

  • PIN1 connected to L298N DC Motor Driver (OUT2)
  • PIN2 connected to L298N DC Motor Driver (OUT1)

Documented Code

No code was provided for the microcontrollers in the circuit. The ESP32 microcontroller would typically be programmed to control the L298N motor driver by setting the appropriate GPIO pins to high or low to control the direction of the motors and using PWM signals to control the speed of the motors. The code would also include setup and initialization routines, as well as the main control loop where the logic for motor control is implemented. Since no code is available, this section cannot be completed.