Arduino RC Car "The CAR-rete" V1.0

by KRT in Circuits > Remote Control

115 Views, 1 Favorites, 0 Comments

Arduino RC Car "The CAR-rete" V1.0

IMG20251102141752.jpg
coche_ejemplo.png
coche_rc_pro.jpg

This RC car project was initially based on a very basic idea of creating an Arduino-based “drift RC car” from scratch, with great power and speed, on a low budget, and all designed and built by me, someone who is still new to the world of programming and electronics.

After a few weeks of researching and gathering inspiration, I created the first plans, which were a bit archaic and messy, but at least I had something to start with. If you are interested in seeing the first plans and ideas, there is a website about it, in the San Francisco school web. *LINK*

Mainly through YouTube, Instructables, and forums, I refined the code and the components and chassis until I came up with a final idea.

What is shown in this Instructables is simply a prototype of what will be V.2.0, which I will publish shortly. There are also plans for a version 3.0, but that will take more time.

Supplies

nrf24.jpg
motor.jpg
l298n.jpg

As for the materials to use, it depends a little on how you decide to make parts of the project such as the steering, the chassis, etc., because this prototype is extremely handmade and simple.

The electronic components used in this project are:

• 2x Arduino board

• 2x 9V battery

• 3x DC adapter for 9V battery

• 1x L298N motor driver

• 2x NRF24 L01+PA+LNA transceiver

• 4x LED diodes (you can use more if you want)

• 4x 220Ω resistors (one for each LED used)

• 1x servo (in this case, a 9g servo will work)

• 2x joysticks

• 1x push button (no resistor is used because it is replaced by the one on the Arduino board)

• Cables to connect all the components (have plenty on hand)

And what has been used for the body of the car is:

• More or less rigid cardboard

• Wooden sticks about 3mm thick

• Metal rod about 2.5mm thick (taken from an old coat hanger(for the steering and drive shaft))

• Plastic straws or other type of tube that fits the metal rod loosely and into which the wooden sticks fit (for the steering and drive shaft)

• 4x wheels

• 2x bearings (in my case, I used two taken from a spinner toy)

• Metal wire approximately 0.7mm thick (paper clip (for conecting the servo arm to the steering sistem))

• 2x gears (the ones used here were taken from an old toy (for the motor's connection))

Possible tools you may need to use:

• Glue gun

• Cutter and scissors

• Pen

• Needle-nose pliers or small pliers

• Phillips screwdriver

Code

receptor.jpg
transmisor.jpg

Explanation of the code from scratch


How they communicate

The two NRF24L01 modules function as transceivers (they transmit and receive).

In this case:

  1. The controller → sends data from the joystick and button.
  2. The car → receives data and acts on the motors, servo, and LEDs.

Communication uses the RF24 library, which sends data structures in binary (fast and reliable).


CONTROLLER CODE (Transmitter)

Libraries

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
  1. SPI.h: serial communication protocol between Arduino and the NRF24L01 module.
  2. nRF24L01.h: radio chip configuration.
  3. RF24.h: high-level library that facilitates sending/receiving data.

Create radio object

RF24 radio(9, 10); // CE, CSN
const byte address[6] = “car01”;
  1. radio(9,10) indicates the connected pins of the NRF module (CE → D9, CSN → D10).
  2. address is like a communication channel or “name” shared between the two modules.

Both must have exactly the same address.

Data structure

struct Data {
int speed;
int direction;
bool lights;
};
Data data;

A structure is created that stores three values:

  1. speed → joystick Y reading
  2. direction → joystick X reading
  3. lights → button status

Thus, all values are sent in a single packet.

Pin configuration

const int speedAxis = A0;
const int directionAxis = A1;
const int lightsButton = 7;
  1. A0 and A1 are analog pins that read the movement of the joysticks (0–1023).
  2. The button is connected to digital pin 7.

Initialization

void setup() {
pinMode(lightButton, INPUT_PULLUP);
radio.begin();
radio.openWritingPipe(direction);
radio.stopListening();
}
  1. INPUT_PULLUP activates the internal resistor, so you don't need an external one. (When the button is pressed, the reading changes from HIGH to LOW).
  2. radio.begin() initializes the NRF24 module.
  3. openWritingPipe() configures the output channel (for sending).
  4. stopListening() puts it in transmitter mode.

Main loop

void loop() {
data.speed = analogRead(speedAxis);
data.direction = analogRead(directionAxis);

Reads the joystick values (between 0 and 1023).


Button logic

bool currentState = digitalRead(lightButton);
if (currentState == LOW && lastButtonState == HIGH) {
lightState = !lightState;
delay(200);
}
lastButtonState = currentState;
data.lights = lightsState;
  1. The button changes the state of the lights (on/off) each time it is pressed.
  2. Delay(200) is used as an anti-bounce measure.
  3. lightsState alternates between true and false.

Send data

radio.write(&data, sizeof(data));
delay(50);
  1. Sends the complete structure via the NRF24L01.
  2. The delay(50) gives a sending frequency of about 20 packets per second.


CAR CODE (Receiver)

Libraries

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <Servo.h>
  1. Same as before, but also includes Servo.h to control the steering servo.

NRF24 configuration

RF24 radio(9, 10);
const byte address[6] = “car01”;
  1. Same channel “car01”.
  2. Same CE and CSN pins (D9, D10).

Car pins

#define IN1 6
#define IN2 7
#define ENA 3
#define LED 4
#define SERVO 5
  1. IN1, IN2, ENA: control the motor via the L298N driver.
  2. LED: controls the lights.
  3. SERVO: PWM output for the steering servo.

Data structure

Same as in the controller:

struct Data {
int speed;
int direction;
bool lights;
};
Data data;

Must be identical for communication to work.

Initialization

void setup() {
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(ENA, OUTPUT);
pinMode(LED, OUTPUT);
servoDirection.attach(SERVO);

radio.begin();
radio.openReadingPipe(0, direction);
radio.startListening();
}
  1. The pins are configured.
  2. servoDirection.attach(SERVO) initializes the servo.
  3. openReadingPipe(0, direction) opens the listening channel.
  4. startListening() puts it in receiver mode.

Data reception

if (radio.available()) {
radio.read(&data, sizeof(data));
}

When data arrives from the controller, it is stored in the data variable.

Servo control (direction)

int angle = map(data.direction, 0, 1023, 135, 45);
servoDirection.write(angle);
  1. map() converts the joystick range (0–1023) into an angle range (45–135).
  2. This causes the servo to turn proportionally to one side or the other.

Motor control (speed and direction)

int offset = data.speed - 512;
int speed = abs(offset) * 0.5;
  1. If the joystick is in the center (512) → the car stops.
  2. If the value is higher → it moves forward.
  3. If it is lower → it moves backward.
  4. Multiplying by 0.5 adjusts the sensitivity.

Then:

if (offset > 50) {
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
analogWrite(ENA, speed);
}
else if (offset < -50) {
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
analogWrite(ENA, speed);
}
else {
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
analogWrite(ENA, 0);
}

This defines the direction of rotation of the motor according to the joystick.

  1. IN1 and IN2 determine the direction.
  2. ENA regulates the speed with PWM.

Light control

digitalWrite(LED, data.lights ? HIGH : LOW);

Turns the lights on or off according to the status of the button on the controller.


GENERAL CONCLUSION

Element················>Controller············>Car

  1. NRF24L01·············> Transmits···········> Receives
  2. Joystick Y·············> Speed··················> Motor (L298N)
  3. Joystick X·············> Steering··············> Servo
  4. Button···················> On/Off lights·····> LED
  5. Data structure·····> Send values·······> Receives and act
  6. Communication···> radio.write()······> radio.read()






Assembly

base_rectangulo_negro.jpg
esquema_sistema_de_direccion.png
IMG20251102141804.jpg
IMG20251102141808.jpg
IMG20251102141813.jpg

The build is completely DIY and mainly improvised with common house items like plastic straws and hot glue.


Basically you have to make a base for the car, in my case it was a rectangle shaped cardboard sheet. The steering and motor parts are the only things you may have some issues; you can use mine as inspiration or a direct "copy-paste".

The first to images refer to the base shape and the steering sistem, have a deep look at the other images in order to notice some details that may make the difference for you.

Enjoy

Captura de pantalla 2026-02-06 144042.png

Preview of the upcoming V.2.0