ESP32-Powered 4x4 RC Rover Fully 3D Printed and Wi-Fi Controlled
by gokux in Circuits > Wireless
4241 Views, 73 Favorites, 0 Comments
ESP32-Powered 4x4 RC Rover Fully 3D Printed and Wi-Fi Controlled


Have you ever wanted to build your own rugged, remote-controlled off-road rover from scratch? In this project, we will guide you through the process of creating a 3D-printed 4x4 RC rover powered by the compact and powerful Seeed Studio XIAO ESP32C3. With custom-designed electronics and wireless control via a web app, this rover merges mechanical engineering, electronics, and IoT into an exciting DIY adventure!
Instead of using a bulky RC transmitter, this rover is controlled entirely over Wi-Fi through an intuitive web-based joystick interface. This means you can drive it from your phone, tablet, or computer—no additional apps needed!
At the build's core is a custom motor driver PCB, specifically designed to control two dual DC motors for true 4x4 drive. Everything is mounted on a fully 3D-printed chassis,
Whether you are interested in robotics, RC vehicles, 3D printing, or ESP32 projects, this build offers something for everyone.
Supplies

- Seeed Studio XIAO ESP32C3
- XIAO DC Motor Addon PCB
- MT3608 voltage booster
- 2.4ghz antenna
- 18650 Battery
- 4*N20 5v 300rpm motor
- 2*M4 6mm Knurled Threaded Insert
- 2*M4 10mm Bolt
- 12*M2.5 screws
- JST connectors, male and female
- 3D printed parts
Enclosure Design and 3D Printing

I utilised Fusion 360 to plan and design my project, which required careful space optimisation. I needed to fit all the parts into the smallest form factor possible while ensuring practicality, including sufficient space for wiring and easy assembly. First, I imported all 3d models of the parts and tried different configurations by placing the parts in various positions. Once I found the optimal configurations, I built the enclosure around them. All design files are provided below
I printed the main body in green PLA, and the wheels are printed using Black PLA
XIAO Motor Driver PCB


Here I used a Dual H-bridge motor driver for the PCB I designed for Seeedstudio XIAO ESP32C3, it based on the DRV8833 motor driver IC. i also used screw terminals for connecting motor wired and power. You can power the driver between 2.7V to 10.8V, so the higher voltage means more speed. I designed this PCB in Flux. ai and ordered the PCB with SeeedStudio Fusion PCB Service . You can find PCB-related files here link
Code
For this project, we are using a web page to control the motors
You can change the device name and password here
full code
#include <WiFi.h>
#include <WebServer.h>
// Motor driver pins
const int motorA1 = D5; // D6
const int motorA2 = D6; // D5
const int motorB1 = D7; // D7
const int motorB2 = D8; // D8
// WiFi Access Point credentials
const char* ssid = "RC-Tank";
const char* password = "12345678";
IPAddress local_ip(192, 168, 50, 1);
IPAddress gateway(192, 168, 50, 1);
IPAddress subnet(255, 255, 255, 0);
WebServer server(80);
// HTML page with directional buttons
const char index_html[] PROGMEM = R"rawliteral(
<!DOCTYPE html>
<html>
<head>
<title>RC Tank Control</title>
<style>
body { background-color: #111; color: white; text-align: center; font-family: sans-serif; }
h2 { margin-top: 20px; }
button {
width: 100px; height: 60px; font-size: 20px;
margin: 10px; border-radius: 10px; border: none;
background: #444; color: white;
}
button:hover { background: #666; }
</style>
</head>
<body>
<h2>RC Tank Control</h2>
<div>
<button onclick="send('F')">Forward</button><br>
<button onclick="send('L')">Left</button>
<button onclick="send('S')">Stop</button>
<button onclick="send('R')">Right</button><br>
<button onclick="send('B')">Backward</button>
</div>
<script>
function send(cmd) {
fetch(`/move?dir=${cmd}`);
}
</script>
</body>
</html>
)rawliteral";
void setup() {
Serial.begin(115200);
pinMode(motorA1, OUTPUT);
pinMode(motorA2, OUTPUT);
pinMode(motorB1, OUTPUT);
pinMode(motorB2, OUTPUT);
stopMotors();
// Start Wi-Fi AP
WiFi.softAPConfig(local_ip, gateway, subnet);
WiFi.softAP(ssid, password);
Serial.println("Wi-Fi AP Started");
Serial.println(WiFi.softAPIP());
// Serve main web page
server.on("/", HTTP_GET, []() {
server.send_P(200, "text/html", index_html);
});
// Movement handler
server.on("/move", HTTP_GET, []() {
String dir = server.arg("dir");
handleDirection(dir);
server.send(200, "text/plain", "OK");
});
server.begin();
}
void loop() {
server.handleClient();
}
// Movement logic
void handleDirection(String dir) {
dir.toUpperCase();
if (dir == "F") {
moveForward();
} else if (dir == "B") {
moveBackward();
} else if (dir == "L") {
turnLeft();
} else if (dir == "R") {
turnRight();
} else {
stopMotors();
}
}
void moveForward() {
digitalWrite(motorA1, HIGH);
digitalWrite(motorA2, LOW);
digitalWrite(motorB1, HIGH);
digitalWrite(motorB2, LOW);
}
void moveBackward() {
digitalWrite(motorA1, LOW);
digitalWrite(motorA2, HIGH);
digitalWrite(motorB1, LOW);
digitalWrite(motorB2, HIGH);
}
void turnLeft() {
digitalWrite(motorA1, LOW);
digitalWrite(motorA2, HIGH);
digitalWrite(motorB1, HIGH);
digitalWrite(motorB2, LOW);
}
void turnRight() {
digitalWrite(motorA1, HIGH);
digitalWrite(motorA2, LOW);
digitalWrite(motorB1, LOW);
digitalWrite(motorB2, HIGH);
}
void stopMotors() {
digitalWrite(motorA1, LOW);
digitalWrite(motorA2, LOW);
digitalWrite(motorB1, LOW);
digitalWrite(motorB2, LOW);
}
Assembly & Wiring

So let's start the assembly with installing the motor, put the all four motor in the 3d printed slot, and secure it with motor holder and screws. Also, don't forget to solder about 8 cm wires to the motor
Connect all 4 motor wires to the motor controller PCB and screw in the PCB using four M2.5 Screws
Solder a 2-pin JST connector and an additional two wires to the input pad of MT3608. Also, solder some wires to the output. The reason I am using MT3608 is that it functions as a voltage booster, allowing us to increase the 3.7V from the battery up to 10.8V for the motor driver. We will be powering the Xiao directly from the battery output. Please make sure not to connect the boosted voltage to the Xiao’s power input, as this could damage it.
Now, put the MT3608 into the 3D printed slot . Use glue if you need
Connect the motor power and Xiao power from the MT3608 input and output pads
Install the antenna port to the side of the wall and connect the other end to the antenna port of the XIAO
Install all 2 of the M4 thread inserts onto the 3d print using a soldering iron
Solder the JST connector to the battery and place it in the 3d printed slot
Put cap and close it of with 2 M4 screw
We can fish out the assembly by installing the antenna
Operation

The operation is so simple. After powering up, the rover will open a wifi hotspot. Connect to this wifi and go to 192.168.50.1 using your browser. Now the control page will be displayed. Use the button to manoeuvre your rover