ESP32-Based Wi-Fi Controlled Robotic Car with Ultrasonic and IR Sensors
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes various components such as DC motors, an L298N DC motor driver, an MPU-6050 sensor, an HC-SR04 ultrasonic sensor, an ESP32 microcontroller, IR sensors, an LM2596 voltage regulator, and a 2x 18650 battery pack. The circuit is designed to control multiple DC motors, read sensor data, and communicate with other devices using the ESP32 microcontroller.
Component List
DC Motor
- Pins: pin 1, pin 2
- Description: A standard DC motor used for various mechanical movements.
L298N DC Motor Driver
- 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
- Description: A dual H-bridge motor driver that allows control of the speed and direction of two DC motors.
MPU-6050
- Pins: VCC, GND, SCL, SDA, XDA, XCL, AD0, INT
- Description: A 6-axis motion tracking device that combines a 3-axis gyroscope and a 3-axis accelerometer.
HC-SR04 Ultrasonic Sensor
- Pins: VCC, TRIG, ECHO, GND
- Description: An ultrasonic sensor used for distance measurement.
ESP32 (30 pin)
- 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
- Description: A powerful microcontroller with built-in Wi-Fi and Bluetooth capabilities.
2x 18650 Battery Pack
- Pins: vcc, gnd
- Description: A battery pack consisting of two 18650 lithium-ion cells.
IR Sensor
- Pins: out, gnd, vcc
- Description: An infrared sensor used for object detection.
LM2596
- Pins: IN, OUT
- Description: A step-down voltage regulator used to convert higher voltage to a lower, stable voltage.
Wiring Details
DC Motor
Motor 1
- pin 1: Connected to L298N DC motor driver OUT2
- pin 2: Connected to L298N DC motor driver OUT1
Motor 2
- pin 1: Connected to L298N DC motor driver OUT2
- pin 2: Connected to L298N DC motor driver OUT1
Motor 3
- pin 1: Connected to L298N DC motor driver OUT4
- pin 2: Connected to L298N DC motor driver OUT3
Motor 4
- pin 1: Connected to L298N DC motor driver OUT4
- pin 2: Connected to L298N DC motor driver OUT3
L298N DC Motor Driver
- OUT1: Connected to DC Motor pin 2
- OUT2: Connected to DC Motor pin 1
- OUT3: Connected to DC Motor pin 2
- OUT4: Connected to DC Motor pin 1
- 12V: Connected to 2x 18650 battery pack vcc
- GND: Connected to 2x 18650 battery pack gnd, ESP32 GND, LM2596 IN, LM2596 OUT
- 5V: Connected to ESP32 Vin, LM2596 OUT
- ENA: Connected to ESP32 D12
- ENB: Connected to ESP32 D14
- IN1: Connected to ESP32 D27
- IN2: Connected to ESP32 D26
- IN3: Connected to ESP32 D25
- IN4: Connected to ESP32 D33
MPU-6050
- VCC: Connected to ESP32 3V3
- GND: Connected to ESP32 GND
- SCL: Connected to ESP32 D22
- SDA: Connected to ESP32 D21
HC-SR04 Ultrasonic Sensor
- VCC: Connected to ESP32 3V3
- GND: Connected to ESP32 GND
- TRIG: Connected to ESP32 D2
- ECHO: Connected to ESP32 D4
ESP32 (30 pin)
- D35: Connected to IR sensor out
- D32: Connected to IR sensor out
- D33: Connected to L298N DC motor driver IN4
- D25: Connected to L298N DC motor driver IN3
- D26: Connected to L298N DC motor driver IN2
- D27: Connected to L298N DC motor driver IN1
- D14: Connected to L298N DC motor driver ENB
- D12: Connected to L298N DC motor driver ENA
- GND: Connected to 2x 18650 battery pack gnd, IR sensor gnd, MPU-6050 GND, HC-SR04 GND
- Vin: Connected to LM2596 OUT
- D22: Connected to MPU-6050 SCL
- D21: Connected to MPU-6050 SDA
- D4: Connected to HC-SR04 ECHO
- D2: Connected to HC-SR04 TRIG
- 3V3: Connected to IR sensor vcc, MPU-6050 VCC, HC-SR04 VCC
2x 18650 Battery Pack
- vcc: Connected to LM2596 IN, L298N DC motor driver 12V
- gnd: Connected to ESP32 GND, LM2596 IN, LM2596 OUT, L298N DC motor driver GND
IR Sensor
Sensor 1
- out: Connected to ESP32 D35
- gnd: Connected to ESP32 GND
- vcc: Connected to ESP32 3V3
Sensor 2
- out: Connected to ESP32 D32
- gnd: Connected to ESP32 GND
- vcc: Connected to ESP32 3V3
LM2596
- IN: Connected to 2x 18650 battery pack vcc, 2x 18650 battery pack gnd
- OUT: Connected to ESP32 Vin, L298N DC motor driver 5V, ESP32 GND, L298N DC motor driver GND
Code
No code provided for this circuit.
This document provides a comprehensive overview of the circuit, including a summary, component list, wiring details, and code documentation. Each component is described, and the wiring details are provided to ensure proper connections between components.