WiFi-Controlled Car with ESP32
An Internet of Things (IoT) hardware project creating a wirelessly controlled 4-wheel robotic vehicle powered by an ESP32 microcontroller, an L298N dual H-bridge motor driver, a 4-wheel chassis, and a rechargeable Li-ion power cell. The car is operated in real time through a custom responsive web interface using low-latency WebSockets.
🛠️ Components & Hardware
- Microcontroller: ESP32 NodeMCU (Dual-core Tensilica Xtensa 32-bit LX6 with integrated WiFi & Bluetooth)
- Motor Driver: L298N Dual H-Bridge Motor Controller
- Chassis & Drive: 4-Wheel Drive robotic chassis with DC gear motors
- Power Source: Rechargeable Li-ion 18650 battery pack with voltage regulation
- Wiring & Connectivity: Jumper wires, breadboard, micro-USB programming cable
- Firmware & Toolchain: Arduino IDE, C++,
WebSocketsServerlibrary
🔌 Hardware Assembly & Pinout
- Chassis Assembly: Mount the 4 DC motors onto the chassis plate and fit the rubber traction wheels.
- Motor Driver Wiring:
- Connect Motor Left to
OUT1andOUT2terminals. - Connect Motor Right to
OUT3andOUT4terminals.
- Connect Motor Left to
- ESP32 to L298N Control Pins:
IN1➔ GPIO2IN2➔ GPIO4IN3➔ GPIO16IN4➔ GPIO17
- Power Bus:
- Connect ESP32
VINto the5Vregulated output of the L298N. - Tie all circuit grounds (
GND) to a common ground rail.
- Connect ESP32
🧠 Software Architecture & WebSockets
- WebSocket Communication: Uses a bi-directional WebSocket connection rather than traditional HTTP polling, enabling sub-10ms latency for driving commands (Forward, Reverse, Left, Right, Stop).
- Embedded Web Server: ESP32 serves a responsive HTML5/CSS3 control dashboard directly to connected client devices.
- Pulse Width Modulation (PWM): Smooth motor acceleration and steering adjustments via hardware PWM timers.
📸 Project Photo Gallery
Chassis & Motor Assembly






Electronics & Motor Driver Setup






Completed Robotic Vehicle





🎥 Video Demonstration
Tags: ESP32 IoT Embedded Systems WebSockets Robotics Arduino Hardware
