RC cybertruck

An arduino RC cybertruck controller by a PS4 controller
Jul 13, 2025
embedded image

I recently built an RC car that's controlled entirely by a PlayStation 4 controller. Here's a quick overview of the project.

The Setup

The build centers around three main components:

  • ESP32 microcontroller - Handles Bluetooth connectivity and controls everything
  • PS4 DualShock controller - Wireless control with analog sticks and buttons
  • L298N motor driver - Powers four DC motors for movement

The ESP32 is perfect for this project because it has built-in Bluetooth and plenty of processing power. Using the Bluepad32 library, connecting a PS4 controller is surprisingly straightforward - it handles all the complex Bluetooth pairing automatically.

Source code:

csharp
#include <Bluepad32.h>
#include <FastLED.h>

ControllerPtr myControllers[BP32_MAX_GAMEPADS];

int motor1Pin1 = 26;
int motor1Pin2 = 25;
int enable1Pin = 13;

int motor2Pin1 = 33;
int motor2Pin2 = 32;
int enable2Pin = 27;

#define HEADLIGHT_PIN     19
#define TAILLIGHT_PIN     21
#define NUM_LEDS          9
#define BRIGHTNESS        255
#define LED_TYPE          WS2812
#define COLOR_ORDER       GRB