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.
- 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
L298N DC Motor Driver
- Description: A dual H-bridge motor driver 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
DC Mini Metal Gear Motor
- Description: A small DC motor with a metal gearbox for increased torque.
- Pins: IN1, IN2
3xAA Battery
- Description: A battery pack holding three AA batteries to provide power to the circuit.
- Pins: VCC, GND
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 connected to L298N DC motor driver GND and 3xAA Battery GND
- Vin connected to L298N DC motor driver 5V
L298N DC Motor Driver
- IN2 connected to ESP32 D14
- ENA connected to ESP32 D12
- IN1 connected to ESP32 D13
- GND connected to ESP32 GND and 3xAA Battery GND
- 5V connected 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 connected to L298N DC motor driver GND and ESP32 GND
Documented Code
No code has been provided for the microcontroller. The ESP32 requires embedded code to control the L298N motor driver and, consequently, the DC Mini Metal Gear Motor. The code would typically initialize the GPIO pins connected to the motor driver, set up PWM for speed control, and handle the logic for motor direction and speed adjustments. Since no code is available, this section cannot be documented further.