Building a Wi-Fi Controlled RC Car with RoboLink
Introduction
Building a remote-controlled car is one of the most rewarding entry points into robotics. With RoboLink and an ESP32, you can create a wireless RC car that you control from your phone with a customizable joystick interface.
In this guide, we'll walk through the entire process from hardware assembly to your first drive.
What You'll Need
- ESP32 development board
- L298N motor driver module
- 4 DC motors with wheels
- Robot car chassis kit
- 7.4V LiPo battery
- Jumper wires
- Micro-USB cable
Wiring the Motor Driver
Connect the L298N motor driver to your ESP32 as follows:
| L298N Pin | ESP32 Pin |
|---|---|
| IN1 | GPIO 25 |
| IN2 | GPIO 26 |
| IN3 | GPIO 27 |
| IN4 | GPIO 14 |
| ENA | GPIO 32 |
| ENB | GPIO 33 |
Make sure to connect the motor driver's ground to the ESP32's ground. A common ground is essential for proper communication.
Uploading the Arduino Code
First, install the RoboLink WiFi library from the Downloads page. Then upload this sketch:
#include <RoboLinkWiFi.h>
RoboLinkWiFi robolink;
void setup() {
Serial.begin(115200);
robolink.begin("RoboLink_Car", 4210);
// Motor pins
pinMode(25, OUTPUT);
pinMode(26, OUTPUT);
pinMode(27, OUTPUT);
pinMode(14, OUTPUT);
}
void loop() {
robolink.update();
int steerX = robolink.getValue("steerX");
int steerY = robolink.getValue("steerY");
int speed = robolink.getValue("speed");
// Apply motor logic based on joystick values
driveMotors(steerX, steerY, speed);
}
Connecting with RoboLink
- Power on your ESP32
- Open RoboLink on your phone
- Tap the connection icon and select Wi-Fi / UDP
- Enter port
4210and tap Connect - Load the RC Car preset layout
If you can't connect, make sure your phone is on the same Wi-Fi network as the ESP32, or connect directly to the ESP32's access point.
Customizing Your Controller
The default RC Car layout includes a joystick, speed slider, and buttons for horn, lights, brake, and reverse. You can customize any of these:
- Long-press any widget to edit its properties
- Tap Edit to enter layout editor mode
- Add new widgets from the Add Control panel
Conclusion
You now have a fully functional Wi-Fi controlled RC car! From here, you can add features like camera streaming for FPV driving, LED lights, or even autonomous driving capabilities.
Check out our other tutorials for more advanced projects, and share your builds with the community.