🔌Circuit Connections
🎯 Lesson Objective
In this lesson, students will understand:
• How to connect the ESP32 to the L298N motor driver
• How to connect DC motors to the motor driver
• How Bluetooth communication works internally in the ESP32
• The importance of proper wiring in robotics systems
This lesson explains the hardware connections required to build the Voice Control Robot.
1️⃣ Understanding the Circuit
Before writing the program, all hardware components must be connected properly.
In this project, the main components connected to the ESP32 are:
🧠 ESP32 microcontroller
⚙ L298N motor driver
🚗 DC motors
🔋 Battery pack
The ESP32 will receive voice commands through Bluetooth and send control signals to the motor driver.
2️⃣ Motor Driver Connections
The L298N motor driver controls the two DC motors of the robot.
Motor Driver Input Pins
| L298N Pin | ESP32 Connection |
|---|---|
| IN1 | GPIO 26 |
| IN2 | GPIO 27 |
| IN3 | GPIO 14 |
| IN4 | GPIO 12 |
These pins control the direction of the motors.
The ESP32 sends HIGH or LOW signals to control the robot movement.
3️⃣ Motor Connections
The DC motors are connected to the output terminals of the motor driver.
Motor Driver Output Connections
| Motor Driver Output | Motor |
|---|---|
| OUT1 | Left Motor Terminal 1 |
| OUT2 | Left Motor Terminal 2 |
| OUT3 | Right Motor Terminal 1 |
| OUT4 | Right Motor Terminal 2 |
These outputs supply power to the motors and control their rotation direction.
4️⃣ Motor Driver Power Connections
The motor driver requires an external power source.
Power Wiring
| Motor Driver Pin | Connection |
|---|---|
| 12V | Battery Positive |
| GND | Battery Ground |
| 5V | Optional logic power |
The battery powers the motors, while the ESP32 only sends control signals.
5️⃣ ESP32 Power Supply
The ESP32 can be powered using:
• USB cable connected to a computer
• External battery connected to the VIN pin
The ESP32 operates with 3.3V logic, but VIN allows higher voltage input.
6️⃣ Importance of Common Ground
All devices must share a common ground connection.
This means connecting together:
• ESP32 ground
• Motor driver ground
• Battery ground
A common ground ensures proper communication between components.
7️⃣ Checking the Circuit Before Powering
Before turning on the robot, verify the following:
✔ Motor driver pins connected correctly
✔ Motors connected to correct output terminals
✔ Battery polarity correct
✔ All ground connections shared
✔ No loose wires
Incorrect wiring may prevent the robot from working properly.
8️⃣ Circuit Working Overview
The circuit operates as follows:
1️⃣ The user gives a voice command using a smartphone.
2️⃣ The smartphone converts the voice command into text.
3️⃣ The command is sent to the ESP32 through Bluetooth.
4️⃣ The ESP32 processes the command.
5️⃣ The ESP32 sends control signals to the motor driver.
6️⃣ The motor driver powers the motors and moves the robot.
This allows the robot to be controlled using voice commands.
🚀 What Happens Next
Now that the hardware connections are complete, the next step is to write the program that allows the robot to receive voice commands.