Circuit Documentation
Summary
This circuit is designed to control a hobby gearmotor using an ESP32 Wroom microcontroller and an L298N DC motor driver. The motor driver is powered by a 3xAA battery pack, and it interfaces with the ESP32 Wroom to receive control signals for motor operation. The ESP32 Wroom is responsible for generating the control signals to drive the motor via the L298N. The ground connections are shared among all components to complete the circuit.
Component List
L298N DC Motor Driver
- Description: A motor driver module capable of driving 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.
3xAA Battery
- Description: A battery pack consisting of three AA batteries providing power to the circuit.
- Pins: VCC, GND.
Hobby Gearmotor with 48:1 Gearbox
- Description: A DC gearmotor used for applications requiring torque and speed reduction.
- Pins: pin 1, pin 2.
ESP32 Wroom
- Description: A microcontroller with Wi-Fi and Bluetooth capabilities, used for controlling the motor driver.
- Pins: Multiple GPIOs, 3V3, Reset, GND, 5V, and communication pins.
Wiring Details
L298N DC Motor Driver
- OUT1 connected to Gearmotor pin 2.
- OUT2 connected to Gearmotor pin 1.
- 12V connected to 3xAA Battery VCC.
- GND connected to ESP32 Wroom GND and 3xAA Battery GND.
- 5V connected to ESP32 Wroom 5V.
- ENA connected to ESP32 Wroom GPIO12.
- IN1 connected to ESP32 Wroom GPIO14.
- IN2 connected to ESP32 Wroom GPIO27.
3xAA Battery
- VCC connected to L298N DC Motor Driver 12V.
- GND connected to L298N DC Motor Driver GND and ESP32 Wroom GND.
Hobby Gearmotor with 48:1 Gearbox
- Pin 1 connected to L298N DC Motor Driver OUT2.
- Pin 2 connected to L298N DC Motor Driver OUT1.
ESP32 Wroom
- GPIO27 (IN2) connected to L298N DC Motor Driver IN2.
- GPIO14 (IN1) connected to L298N DC Motor Driver IN1.
- GPIO12 (ENA) connected to L298N DC Motor Driver ENA.
- GND connected to L298N DC Motor Driver GND and 3xAA Battery GND.
- 5V connected to L298N DC Motor Driver 5V.
Code Documentation
No code has been provided for the ESP32 Wroom microcontroller. To control the motor, code should be written to set up the GPIO pins connected to the L298N motor driver and to generate the appropriate control signals for motor operation. This would typically involve configuring the GPIO pins as outputs and then toggling them to control the direction and speed of the motor.