ESP32-Controlled Dual Motor Driver with Optical Encoder Feedback
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to control a dual-motor system using the L298N 2A Dual Motor Driver Module with PWM Control, which is interfaced with an ESP32-WROOM-32UE microcontroller. The system also includes two Optical Encoder Sensor Modules for feedback and a 4 x AAA Battery Mount as the power source. The motors are presumably connected to wheels, although the wheels themselves are passive components and do not directly interface with the circuit.
Component List
L298N 2A Dual Motor Driver Module with PWM Control
- Description: A module capable of driving two motors with up to 2A of current each. It supports PWM for speed control.
- Pins: OUT1, OUT2, 12V, GND, 5V, OUT4, OUT3, ENA, IN1, IN2, IN3, ENB, IN4
4 x AAA Battery Mount
- Description: A battery holder for four AAA batteries, providing a power source for the circuit.
- Pins: -, +
Optical Encoder Sensor Module
- Description: A sensor module used to provide feedback on motor rotation, typically used for precise control of motor position or speed.
- Pins: A0, D0, GND, VCC
Motor Amarillo Motorreductor Hobby
- Description: A yellow hobby gear motor that is driven by the motor driver module.
- Pins: vcc, GND
ESP32-WROOM-32UE
- Description: A powerful microcontroller with Wi-Fi and Bluetooth capabilities, used for controlling the logic of the circuit.
- Pins: 3v3, EN, VP, VN, 34, 35, 32, 33, 25, 26, 27, 14, 12, GND, 13, D2, D3, 5V, 23, 22, TX, RX, 21, 19, 18, 5, 17, 16, 4, 0, 2, 15, D1, D0, CKL
Wheel
- Description: A passive component that is attached to the motor shaft.
- Pins: None
Comment
- Description: A placeholder for additional comments or notes within the circuit design.
- Pins: None
Wiring Details
L298N 2A Dual Motor Driver Module with PWM Control
- 12V connected to 4 x AAA Battery Mount (+)
- GND connected to ESP32-WROOM-32UE (GND) and 4 x AAA Battery Mount (-)
- 5V connected to ESP32-WROOM-32UE (5V)
- ENA connected to ESP32-WROOM-32UE (GND)
- ENB connected to ESP32-WROOM-32UE (21)
- IN1 connected to ESP32-WROOM-32UE (15)
- IN2 connected to ESP32-WROOM-32UE (2)
- IN3 connected to ESP32-WROOM-32UE (0)
- IN4 connected to ESP32-WROOM-32UE (4)
- OUT1 connected to Motor Amarillo Motorreductor Hobby (GND)
- OUT2 connected to Motor Amarillo Motorreductor Hobby (vcc)
- OUT3 connected to Motor Amarillo Motorreductor Hobby (GND)
- OUT4 connected to Motor Amarillo Motorreductor Hobby (vcc)
4 x AAA Battery Mount
- (+) connected to L298N 2A Dual Motor Driver Module with PWM Control (12V)
- (-) connected to L298N 2A Dual Motor Driver Module with PWM Control (GND)
Optical Encoder Sensor Module
- VCC connected to ESP32-WROOM-32UE (5V)
- GND connected to ESP32-WROOM-32UE (GND)
- D0 connected to ESP32-WROOM-32UE (17) and ESP32-WROOM-32UE (16)
Motor Amarillo Motorreductor Hobby
- vcc connected to L298N 2A Dual Motor Driver Module with PWM Control (OUT2) and (OUT4)
- GND connected to L298N 2A Dual Motor Driver Module with PWM Control (OUT1) and (OUT3)
ESP32-WROOM-32UE
- 5V connected to L298N 2A Dual Motor Driver Module with PWM Control (5V) and Optical Encoder Sensor Module (VCC)
- GND connected to L298N 2A Dual Motor Driver Module with PWM Control (GND), Optical Encoder Sensor Module (GND), and 4 x AAA Battery Mount (-)
- 21 connected to L298N 2A Dual Motor Driver Module with PWM Control (ENB)
- 17 connected to Optical Encoder Sensor Module (D0)
- 16 connected to Optical Encoder Sensor Module (D0)
- 4 connected to L298N 2A Dual Motor Driver Module with PWM Control (IN4)
- 0 connected to L298N 2A Dual Motor Driver Module with PWM Control (IN3)
- 2 connected to L298N 2A Dual Motor Driver Module with PWM Control (IN2)
- 15 connected to L298N 2A Dual Motor Driver Module with PWM Control (IN1)
Documented Code
No code was provided for the ESP32-WROOM-32UE microcontroller. The documentation of the code would typically include setup routines, control logic for the motors, and handling of the encoder feedback. However, since no code is available, this section cannot be completed.