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
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
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
Explanation of the code from scratch
How they communicate
The two NRF24L01 modules function as transceivers (they transmit and receive).
In this case:
- The controller → sends data from the joystick and button.
- 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
- SPI.h: serial communication protocol between Arduino and the NRF24L01 module.
- nRF24L01.h: radio chip configuration.
- RF24.h: high-level library that facilitates sending/receiving data.
Create radio object
- radio(9,10) indicates the connected pins of the NRF module (CE → D9, CSN → D10).
- address is like a communication channel or “name” shared between the two modules.
Both must have exactly the same address.
Data structure
A structure is created that stores three values:
- speed → joystick Y reading
- direction → joystick X reading
- lights → button status
Thus, all values are sent in a single packet.
Pin configuration
- A0 and A1 are analog pins that read the movement of the joysticks (0–1023).
- The button is connected to digital pin 7.
Initialization
- 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).
- radio.begin() initializes the NRF24 module.
- openWritingPipe() configures the output channel (for sending).
- stopListening() puts it in transmitter mode.
Main loop
Reads the joystick values (between 0 and 1023).
Button logic
- The button changes the state of the lights (on/off) each time it is pressed.
- Delay(200) is used as an anti-bounce measure.
- lightsState alternates between true and false.
Send data
- Sends the complete structure via the NRF24L01.
- The delay(50) gives a sending frequency of about 20 packets per second.
CAR CODE (Receiver)
Libraries
- Same as before, but also includes Servo.h to control the steering servo.
NRF24 configuration
- Same channel “car01”.
- Same CE and CSN pins (D9, D10).
Car pins
- IN1, IN2, ENA: control the motor via the L298N driver.
- LED: controls the lights.
- SERVO: PWM output for the steering servo.
Data structure
Same as in the controller:
Must be identical for communication to work.
Initialization
- The pins are configured.
- servoDirection.attach(SERVO) initializes the servo.
- openReadingPipe(0, direction) opens the listening channel.
- startListening() puts it in receiver mode.
Data reception
When data arrives from the controller, it is stored in the data variable.
Servo control (direction)
- map() converts the joystick range (0–1023) into an angle range (45–135).
- This causes the servo to turn proportionally to one side or the other.
Motor control (speed and direction)
- If the joystick is in the center (512) → the car stops.
- If the value is higher → it moves forward.
- If it is lower → it moves backward.
- Multiplying by 0.5 adjusts the sensitivity.
Then:
This defines the direction of rotation of the motor according to the joystick.
- IN1 and IN2 determine the direction.
- ENA regulates the speed with PWM.
Light control
Turns the lights on or off according to the status of the button on the controller.
GENERAL CONCLUSION
Element················>Controller············>Car
- NRF24L01·············> Transmits···········> Receives
- Joystick Y·············> Speed··················> Motor (L298N)
- Joystick X·············> Steering··············> Servo
- Button···················> On/Off lights·····> LED
- Data structure·····> Send values·······> Receives and act
- Communication···> radio.write()······> radio.read()
Assembly
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
Preview of the upcoming V.2.0