Skip to main content
Version: FILS English

CarBot-C3 – WiFi Controlled Smart Robot Car

A WiFi-controlled 4WD robot car built with ESP32-C3 in Rust, featuring motor control, obstacle detection, and a web interface

info

Author: Zagornean Iana
GitHub Project Link: https://github.com/UPB-PMRust-Students/fils-project-2026-ianazag

Description

A self-contained WiFi-enabled robotic car built around an ESP32-WROOM development board. The system creates its own wireless network, allowing a phone, laptop, or controller device to connect directly and control the vehicle through a browser-based web interface. The car uses TB6612FNG dual-channel motor driver to control the left and right motor groups independently, enabling forward movement, reverse movement, and turning in place.

The project includes multiple operating modes. In manual mode, the user controls the car from the web page or through a connected gamepad. In autonomous mode, a VL53L0X time-of-flight distance sensor is used to detect obstacles, while a servo motor rotates the sensor to scan left, center, and right before choosing a safer direction. In line-following mode, a 5-channel TCRT5000 infrared sensor module detects a black line on the ground and allows the robot to follow it automatically.

An OLED SSD1306 display is mounted on the robot to show important live information such as current mode, command, distance value, WiFi status, and battery level. An ESP32-CAM module with an OV2640 camera is used as a separate WiFi camera unit. It connects to the robot’s WiFi network and provides a live video stream that is displayed inside the main web control interface.

Motivation

This project was chosen to explore how embedded systems, robotics, and Rust can be combined into a complete, real-world application. It provides hands-on experience with controlling hardware components like motors and sensors while also implementing higher-level features such as WiFi communication and a browser-based interface. Building a fully standalone system that can be controlled remotely helps in understanding how modern IoT devices operate without external dependencies. Additionally, it offers valuable insight into debugging hardware-software interactions and lays the groundwork for extending the project with more advanced capabilities like autonomous navigation and obstacle avoidance. A self-contained WiFi-enabled robotic car powered by the ESP32-C3 microcontroller. The system hosts its own wireless network, letting a phone or laptop connect directly and control the vehicle through a simple web interface. A dual-channel TB6612FNG motor driver manages the left and right motors independently, enabling forward, reverse, and turning movements. A time-of-flight sensor (VL53L0X) monitors distance to obstacles, while a servo motor can rotate the sensor to scan the environment. The device exposes live telemetry (movement status, distance readings, safety flags) in the browser and uses a buzzer to signal warnings such as approaching obstacles. The software is fully implemented in Rust and runs directly on the microcontroller, integrating motor control, networking, and real-time feedback into a compact and autonomous embedded system.

Motivation

This project was chosen to explore how embedded systems, robotics, and Rust can be combined into a complete, real-world application. It provides hands-on experience with controlling hardware components like motors and sensors while also implementing higher-level features such as WiFi communication and a browser-based interface. Building a fully standalone system that can be controlled remotely helps in understanding how modern IoT devices operate without external dependencies. Additionally, it offers valuable insight into debugging hardware-software interactions and lays the groundwork for extending the project with more advanced capabilities like autonomous navigation and obstacle avoidance.

Architecture

Main components

  • Web Interface (HTTP UI) – user control (Forward, Left, Right, Back)
  • Control Layer – translates commands into motor actions
  • Motor Driver Layer – controls TB6612FNG signals
  • Sensor Layer – reads distance (VL53L0X)
  • Line Sensor Layer – reads the 5-channel TCRT5000 module and determines the line position.
  • OLED Display Layer – shows mode, command, distance, WiFi status, and battery level.
  • Battery Monitoring Layer – reads the 2S battery voltage through an ADC voltage divider.
  • Camera Module – ESP32-CAM provides a live video stream over WiFi.
  • Telemetry Module – sends live status information to the web page.
  • Safety Layer – prevents collisions
  • Telemetry Module – reports system state
Phone / Laptop / Gamepad
|
| WiFi + HTTP Requests
v
Web Control Interface
|
v
Control Logic on ESP32-WROOM
|
+--[ GPIO + PWM ]-------> TB6612FNG Motor Driver
| |
| +--> Right Motors
| |
| +--> Left Motors
|
+--[ PWM ]--------------> Servo Motor 1
|
+--[ PWM ]--------------> Servo Motor 2
|
+--[ I2C ]--------------> VL53L0X Distance Sensor
| |
| v
| Distance Data
|
+--[ GPIO Inputs ]-------> TCRT5000 5-Channel Line Sensor
| |
| v
| Line Position Data
|
+--[ I2C ]--------------> OLED SSD1306 Display
|
+--[ ADC ]--------------> Battery Voltage Divider
|
v
Telemetry and Mode Logic
|
v
Web Response with Live Status


Separate Camera Unit:

ESP32-CAM + OV2640
|
| Connects to ESP32-CAR WiFi
v
Camera Stream URL
|
v
Displayed inside Web Interface
=======
WiFi Client (Phone / Laptop)
|
| HTTP Requests
v
Web Control Interface
|
v
Control Logic (ESP32-C3)
|
+--[ GPIO ]-----------> Buzzer (Alert / Warning)
|
+--[ PWM ]------------> Servo Motor (Scan Direction)
|
+--[ GPIO + PWM ]-----> Motor Driver (TB6612FNG)
| |
| +--> DC Motor Left
| |
| +--> DC Motor Right
|
+--[ I2C ]---------------> Distance Sensor (VL53L0X)
| |
| v
| Distance Data
|
v
Telemetry & Safety Layer
|
v
Web Response (Real-time Status)

Log

Week 1 - 4

Defined the project idea: a WiFi-controlled robotic car using ESP32-C3. Researched motor drivers (TB6612FNG), sensors (VL53L0X), and Rust support for embedded systems. Planned overall architecture (control via web interface + real-time telemetry).

Week 5 - 6

Ordered components and started assembling the hardware. Mounted motors on the chassis and prepared wiring for power distribution. Studied ESP32 pinout and how to interface with the TB6612FNG driver.

Week 7 - 8

Connected ESP32-C3 to the motor driver and powered the system. Tested GPIO signals and verified connections using a multimeter. Started debugging motor behavior (direction issues, inactive channels).

Week 9 - 10

Connected the VL53L0X distance sensor through I2C and added distance readings to the web interface. Added servo control so the sensor could scan different directions. Implemented an autonomous obstacle-avoidance mode where the robot checks the front distance, stops near obstacles, scans left and right, and chooses a safer direction.

Week 11 - 12

Added the 5-channel TCRT5000 line sensor module. Implemented line sensor reading, pattern detection, and a line-following mode. Added calibration and debugging for the sensor values. Updated the web interface to show the detected line pattern and the estimated line position.

Week 13 - 14

Added an OLED SSD1306 display over I2C. The display shows the current operating mode, active command, distance reading, WiFi status, and battery percentage. Added battery voltage monitoring using a voltage divider connected to an ADC pin. Improved code organization by splitting the project into multiple Rust files such as configuration, motors, servos, sensors, OLED, web page, web server, and application state.

Hardware

The hardware is built around an ESP32-WROOM development board, which acts as the main controller, creates the WiFi network, runs the web server, and controls the robot. A TB6612FNG motor driver controls the left and right DC motors using GPIO and PWM signals. The robot uses a VL53L0X distance sensor for obstacle detection, a 5-channel TCRT5000 sensor module for line following, two servo motors for positioning, and an SSD1306 OLED display for showing live status such as mode, command, distance, WiFi state, and battery level. The battery level is measured through a voltage divider connected to an ADC pin, while an ESP32-CAM with an OV2640 camera connects through WiFi and provides the live video stream. The system is powered by a 2S battery pack with voltage regulation, and all modules share a common ground.

Schematics

Schematics

Hardware

The hardware setup is built around the ESP32-C3 microcontroller, which acts as the main control unit and provides WiFi connectivity. A TB6612FNG motor driver is used to control two DC motors for movement (left and right). A VL53L0X time-of-flight distance sensor is connected via I2C for obstacle detection, while a servo motor is used to rotate the sensor for environmental scanning. An active buzzer provides audio feedback for alerts. The system is powered by a battery pack with a voltage regulator, and all components are connected using jumper wires on a prototyping setup.

Schematics

Schematics

Bill of Materials

DeviceUsagePrice
ESP32-C3 Dev BoardMain microcontroller with WiFi35 RON
TB6612FNG Motor DriverControls DC motors (left/right)20 RON
TCRT5000 5-Channel Line SensorDetects black line for line-following mode15 RON
ESP32-CAM with OV2640Provides live video stream over WiFi60 RON
SSD1306 OLED Display 0.96 inch 128x64Displays mode, command, distance, WiFi status and battery level20 RON
Wheels with DC Gear Motors (x4)Movement (wheels)Already owned
VL53L0X ToF SensorDistance measurement25 RON
SG90 Servo MotorRotates sensor (scan)Already owned
Active BuzzerSound alertsAlready owned
18650 Li-ion Battery(x2)Power source44 RON
Step-down Voltage RegulatorRegulates voltage to 5V/3.3V32 RON
Jumper Wires + BreadboardConnections and prototyping7 RON

Software

LibraryDescriptionUsage
esp-idf-halHardware abstraction layer for ESP-IDFUsed for GPIO, PWM, and peripheral control
esp-idf-svcHigh-level services for ESP-IDFUsed for WiFi, HTTP server, and system services
embedded-svcCommon embedded service traitsUsed as abstraction for networking and IO
anyhowError handling libraryUsed for simplified error management
logLogging facadeUsed for runtime logs and debugging
esp-idf-sysRaw bindings to ESP-IDFLow-level integration with ESP-IDF framework
  1. ESP32-C3 Documentation
  2. esp-idf-hal (Rust HAL for ESP32)
  3. esp-idf-svc (WiFi & HTTP services)
  4. TB6612FNG Motor Driver Datasheet
  5. VL53L0X Distance Sensor Guide
  6. ESP32 Web Server Tutorial