ESP32-Controlled Traffic Light and Multi-Motor Driver System
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to control a traffic light and multiple DC motors using an ESP32 microcontroller. The ESP32 is interfaced with an L298N DC motor driver to control the motors and directly drives the LEDs of a traffic light. The circuit also includes multiple MT3608 step-up voltage regulators to boost the voltage from a 4 x AAA battery mount to the required levels for the motor drivers. An MG996R servo motor is also controlled by the ESP32.
Component List
ESP32 (30 pin)
- Microcontroller with WiFi and Bluetooth capabilities.
- 30 GPIO pins including analog inputs, UART, I2C, SPI, VP, VN, and power pins.
MT3608 (x4)
- A step-up voltage regulator that boosts the input voltage to a higher output voltage.
- Each module has input and output voltage pins and ground connections.
L298N DC Motor Driver (x2)
- A dual H-bridge motor driver capable of driving two DC motors or one stepper motor.
- It has pins for motor outputs, power supply, logic inputs, and enable pins for speed control.
MG996R
- A high-torque digital servo motor.
- It has a signal line, Vcc, and ground connections.
4 x AAA Battery Mount
- A battery holder for four AAA batteries, providing a power source for the circuit.
- It has positive and negative terminals.
DC Motor (x3)
- Standard DC motors with two connection pins.
Traffic Light
- A simple traffic light module with LEDs for green, yellow, and red, and a ground connection.
Wiring Details
ESP32 (30 pin)
D32connected to L298N DC motor driver (5V)D25connected to Traffic Light (Green)D26connected to Traffic Light (Yellow)D27connected to Traffic Light (Red)D14connected to L298N DC motor driver (IN1)D23connected to L298N DC motor driver (ENA)D22connected to L298N DC motor driver (IN2)D21connected to L298N DC motor driver (ENB)D19connected to L298N DC motor driver (IN4)D18connected to MG996R (Signal Line)D5connected to L298N DC motor driver (IN3)D4connected to L298N DC motor driver (ENB)D2connected to L298N DC motor driver (IN4)D15connected to L298N DC motor driver (IN3)GNDconnected to Traffic Light (GND), MT3608 (VOUT-), and L298N DC motor driver (GND)
MT3608 (x4)
VOUT+connected to L298N DC motor driver (12V)VIN+connected to 4 x AAA Battery Mount (+)VOUT-connected to ESP32 (GND), L298N DC motor driver (GND)VIN-connected to 4 x AAA Battery Mount (-)
L298N DC Motor Driver (x2)
OUT1,OUT2,OUT3,OUT4connected to DC Motors12Vconnected to MT3608 (VOUT+)GNDconnected to ESP32 (GND), MT3608 (VOUT-)5Vconnected to ESP32 (D32), MG996R (Vcc)ENA,ENBconnected to ESP32 (D23, D21)IN1,IN2,IN3,IN4connected to ESP32 (D14, D22, D5, D2, D15, D19)
MG996R
Signal Lineconnected to ESP32 (D18)Vccconnected to L298N DC motor driver (5V)GNDconnected to ESP32 (GND)
4 x AAA Battery Mount
+connected to MT3608 (VIN+)-connected to MT3608 (VIN-)
DC Motor (x3)
pin 1,pin 2connected to L298N DC motor driver (OUT1, OUT2, OUT3, OUT4)
Traffic Light
Greenconnected to ESP32 (D25)Yellowconnected to ESP32 (D26)Redconnected to ESP32 (D27)GNDconnected to ESP32 (GND)
Documented Code
No code was provided for the microcontroller. The documentation of the code would typically include a description of the functionality, setup, and loop sections, as well as any functions or libraries used. Since no code is available, this section cannot be completed. If code becomes available, it should be documented here with explanations of how it interacts with the hardware components listed above.