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

ESP32-Controlled DC Motor with L298N Driver

Image of ESP32-Controlled DC Motor with L298N Driver

Circuit Documentation

Summary of the Circuit

This circuit is designed to control a DC Mini Metal Gear Motor using an ESP32 microcontroller and an L298N DC motor driver. The ESP32 is responsible for sending control signals to the L298N driver, which in turn drives the motor. The power for the motor driver is supplied by a 3xAA battery pack. The ESP32 is also powered by the 5V output from the L298N motor driver. Ground connections are shared among all components to complete the circuit.

Component List

ESP32 (30 pin)

  • Description: A microcontroller with WiFi and Bluetooth capabilities, featuring a wide range of GPIO pins.
  • Purpose: Acts as the central processing unit of the circuit, generating control signals for the motor driver.

L298N DC Motor Driver

  • Description: A dual H-bridge motor driver capable of driving two DC motors.
  • Purpose: Receives control signals from the ESP32 to drive the DC motor.

DC Mini Metal Gear Motor

  • Description: A small DC motor with a gearbox for increased torque.
  • Purpose: The actuator of the circuit, performing mechanical work as instructed by the motor driver.

3xAA Battery

  • Description: A battery pack holding three AA batteries to provide a power source.
  • Purpose: Supplies power to the motor driver, which in turn powers the ESP32 and the DC motor.

Wiring Details

ESP32 (30 pin)

  • D14: Connected to L298N DC motor driver IN2
  • D12: Connected to L298N DC motor driver ENA
  • D13: Connected to L298N DC motor driver IN1
  • GND: Shared ground with L298N DC motor driver and 3xAA Battery
  • Vin: Connected to L298N DC motor driver 5V output

L298N DC Motor Driver

  • IN2: Connected to ESP32 D14
  • ENA: Connected to ESP32 D12
  • IN1: Connected to ESP32 D13
  • GND: Shared ground with ESP32 and 3xAA Battery
  • 5V: Provides power to ESP32 Vin
  • OUT1: Connected to DC Mini Metal Gear Motor IN2
  • OUT2: Connected to DC Mini Metal Gear Motor IN1
  • 12V: Connected to 3xAA Battery VCC

DC Mini Metal Gear Motor

  • IN1: Connected to L298N DC motor driver OUT2
  • IN2: Connected to L298N DC motor driver OUT1

3xAA Battery

  • VCC: Connected to L298N DC motor driver 12V
  • GND: Shared ground with ESP32 and L298N DC motor driver

Documented Code

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