Skip to content

WiFi-Controlled Car with ESP32 ​

Video Demonstration: YouTube • LinkedIn Post: View Post

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++, WebSocketsServer library

🔌 Hardware Assembly & Pinout ​

  1. Chassis Assembly: Mount the 4 DC motors onto the chassis plate and fit the rubber traction wheels.
  2. Motor Driver Wiring:
    • Connect Motor Left to OUT1 and OUT2 terminals.
    • Connect Motor Right to OUT3 and OUT4 terminals.
  3. ESP32 to L298N Control Pins:
    • IN1 ➔ GPIO 2
    • IN2 ➔ GPIO 4
    • IN3 ➔ GPIO 16
    • IN4 ➔ GPIO 17
  4. Power Bus:
    • Connect ESP32 VIN to the 5V regulated output of the L298N.
    • Tie all circuit grounds (GND) to a common ground rail.

🧠 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.

Chassis & Motor Assembly ​

Electronics & Motor Driver Setup ​

Completed Robotic Vehicle ​


🎥 Video Demonstration ​


Tags: ESP32 IoT Embedded Systems WebSockets Robotics Arduino Hardware