ESP32-Based Battery-Powered Robotic Car with Ultrasonic Sensors and Motor Control
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit designed using an ESP32 microcontroller, multiple DC gearmotors, ultrasonic sensors, a micro servo, a 12V battery, and an L298N motor driver. The circuit is intended for a robotic application, where the ESP32 controls the motors and sensors to navigate and interact with its environment.
Component List
ESP32 (30 pin)
- Description: A powerful microcontroller with Wi-Fi and Bluetooth capabilities.
- 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
Gearmotor DC Wheels Right
- Description: A DC motor with wheels for robotic movement.
- Pins: PIN1, PIN2
Gearmotor DC Wheels Left
- Description: A DC motor with wheels for robotic movement.
- Pins: PIN1, PIN2
HC-SR04 Ultrasonic Sensor
- Description: A sensor used for distance measurement.
- Pins: VCC, TRIG, ECHO, GND
Micro Servo 9G
- Description: A small servo motor for precise control.
- Pins: GND, +5V, PWM
Battery 12V
- Description: A 12V power source for the circuit.
- Pins: +, -
L298N DC Motor Driver
- Description: A motor driver used to control the 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
Wiring Details
ESP32 (30 pin)
GND connected to:
- HC-SR04 Ultrasonic Sensor (GND)
- Battery 12V (-)
- L298N DC Motor Driver (GND)
- Micro Servo 9G (GND)
Vin connected to:
- HC-SR04 Ultrasonic Sensor (VCC)
- L298N DC Motor Driver (5V)
- Micro Servo 9G (+5V)
D23 connected to:
- L298N DC Motor Driver (ENA)
D27 connected to:
- L298N DC Motor Driver (IN1)
D26 connected to:
- L298N DC Motor Driver (IN2)
D18 connected to:
- L298N DC Motor Driver (IN3)
D19 connected to:
- L298N DC Motor Driver (IN4)
D22 connected to:
- L298N DC Motor Driver (ENB)
D32 connected to:
- HC-SR04 Ultrasonic Sensor (TRIG)
D33 connected to:
- HC-SR04 Ultrasonic Sensor (ECHO)
D25 connected to:
- Micro Servo 9G (PWM)
Gearmotor DC Wheels Right
PIN1 connected to:
- L298N DC Motor Driver (OUT1)
- Gearmotor DC Wheels Left (PIN2)
PIN2 connected to:
- L298N DC Motor Driver (OUT2)
- Gearmotor DC Wheels Left (PIN1)
Gearmotor DC Wheels Left
PIN1 connected to:
- L298N DC Motor Driver (OUT2)
- Gearmotor DC Wheels Right (PIN2)
PIN2 connected to:
- L298N DC Motor Driver (OUT1)
- Gearmotor DC Wheels Right (PIN1)
HC-SR04 Ultrasonic Sensor
GND connected to:
- ESP32 (GND)
VCC connected to:
- ESP32 (Vin)
TRIG connected to:
- ESP32 (D32)
ECHO connected to:
- ESP32 (D33)
Micro Servo 9G
GND connected to:
- ESP32 (GND)
+5V connected to:
- ESP32 (Vin)
PWM connected to:
- ESP32 (D25)
Battery 12V
+ connected to:
- L298N DC Motor Driver (12V)
- connected to:
- ESP32 (GND)
L298N DC Motor Driver
OUT1 connected to:
- Gearmotor DC Wheels Right (PIN1)
- Gearmotor DC Wheels Left (PIN2)
OUT2 connected to:
- Gearmotor DC Wheels Right (PIN2)
- Gearmotor DC Wheels Left (PIN1)
12V connected to:
- Battery 12V (+)
GND connected to:
- ESP32 (GND)
5V connected to:
- ESP32 (Vin)
OUT3 connected to:
- Gearmotor DC Wheels Right (PIN2)
- Gearmotor DC Wheels Left (PIN1)
OUT4 connected to:
- Gearmotor DC Wheels Right (PIN1)
- Gearmotor DC Wheels Left (PIN2)
ENA connected to:
- ESP32 (D23)
IN1 connected to:
- ESP32 (D27)
IN2 connected to:
- ESP32 (D26)
IN3 connected to:
- ESP32 (D18)
IN4 connected to:
- ESP32 (D19)
ENB connected to:
- ESP32 (D22)
Code
No code provided.