• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Get free circuit help 24/7

Circuits for Beginners | Basic Circuits | LED Driver | Hobby Circuits | Transistor Circuits

New-Projects | Privacy Policy | About us | Contact | Disclaimer | Copyright | Videos

You are here: Home / Arduino Engineering Projects / Joystick Controlled 2.4 GHz RC Car Using Arduino

Joystick Controlled 2.4 GHz RC Car Using Arduino

Last Updated on July 3, 2019 by Swagatam

ask questions through comments

In this post we are going to construct a car robot which can be controlled using a joystick on 2.4 GHz wireless communication link. The proposed project is not only made as a RC car, but you can add your projects such as surveillance camera etc. on the car.

Overview

The project is divided in to two parts; the remote and the receiver.

The car or the base, where we place all our receiver components can be three wheel drive or four wheel drive.

If you want more stability for the base car or if you want to drive the car in uneven surface such as outdoors then, car base with 4 wheels are recommended.

You can also use 3 wheel drive base car which give you greater mobility while turning but, it may provide less stability than 4 wheel drive.

A car with 4 wheels but, 2 motor drive also feasible.

The remote may be powered with 9V battery and receiver may be powered with 12V, 1.3 AH sealed lead acid battery, which has smaller footprint than 12V, 7AH battery and also ideal for such peripatetic applications.

The 2.4 GHz communication between is established using NRF24L01 module which can transmit signals over 30 to 100 meters depending on obstacles in between two NRF24L01 modules.

Illustration of NRF24L01 module:

It works on 3.3V and 5V can kill the module so, care must be taken and it works on SPI communication protocol. The pin configuration is provided in the above image.

The remote:

The remote consists of Arduino (Arduino nano/ pro-mini is recommended), NRF24L01 module, a joystick and a battery power supply. Try to pack them in a small junk box, which will be easier to handle.

Schematic diagram for remote:

 

 

The pin connections for NRF24L01 module and joystick is provided in the diagram, if you feel any muddle, please refer the given pin connection table.

By moving the joystick forward (UP), reverse (Down), right and left, the car moves accordingly.

remote car joystick

Please note that all the wire connections are at left side, this is the reference point and now you can move the joystick to move the car.

By pressing the joystick in Z axis you can control the LED light on the car.

Program for the Remote:

//--------------Program Developed by R.Girish---------------//
#include <nRF24L01.h>
#include <RF24.h>
#include<SPI.h>
int X_axis = A0;
int Y_axis = A1;
int Z_axis = 2;
int x = 0;
int y = 0;
int z = 0;
RF24 radio(9,10);
const byte address[6] = "00001";
const char var1[32] = "up";
const char var2[32] = "down";
const char var3[32] = "left";
const char var4[32] = "right";
const char var5[32] = "ON";
const char var6[32] = "OFF";
boolean light = true;
int thresholdUP = 460;
int thresholdDOWN = 560;
int thresholdLEFT = 460;
int thresholdRIGHT = 560;
void setup()
{
radio.begin();
Serial.begin(9600);
pinMode(X_axis, INPUT);
pinMode(Y_axis, INPUT);
pinMode(Z_axis, INPUT);
digitalWrite(Z_axis, HIGH);
radio.openWritingPipe(address);
radio.setChannel(100);
radio.setDataRate(RF24_250KBPS);
radio.setPALevel(RF24_PA_MAX);
radio.stopListening();
}
void loop()
{
x = analogRead(X_axis);
y = analogRead(Y_axis);
z = digitalRead(Z_axis);
if(y <= thresholdUP)
{
radio.write(&var1, sizeof(var1));
}
if(y >= thresholdDOWN)
{
radio.write(&var2, sizeof(var2));
}
if(x <= thresholdLEFT)
{
radio.write(&var3, sizeof(var3));
}
if(x >= thresholdRIGHT)
{
radio.write(&var4, sizeof(var4));
}
if(z == LOW)
{
if(light == true)
{
radio.write(&var5, sizeof(var5));
light = false;
delay(200);
}
else
{
radio.write(&var6, sizeof(var6));
light = true;
delay(200);
}
}
}
//--------------Program Developed by R.Girish---------------//

That concludes the Remote.

Now let’s take a look at the receiver.

The receiver circuit will be placed on the base car. If you have any idea to add your project on this moving base, plan the geometry properly for placing the receiver and your project so, that you don’t run out of room.

The receiver consists of Arduino, L298N dual H-bridge DC motor driver module, white LED which will be placed at front of the car, NRF24L01 module, and 12V, 1.3AH battery. The motors might come with base car.

Schematic diagram for receiver:

 

Please note that connection between Arduino board and NRF24L01 are NOT shown in the above diagram for avoiding wiring confusion. Please refer the remote’s schematic.

The Arduino board will be powered by L298N module; it has built in 5V regulator.

The white LED may be placed as head light or you can customize this pin to your needs, by pressing the joystick, the pin #7 turns high and pressing the joystick again will turns the pin low.

 

Please pay attention to the left and right side motors specified in the receiver schematic diagram.

Program for the Receiver:

//------------------Program Developed by R.Girish---------------//
#include <nRF24L01.h>
#include <RF24.h>
#include<SPI.h>
RF24 radio(9,10);
const byte address[6] = "00001";
const char var1[32] = "up";
const char var2[32] = "down";
const char var3[32] = "left";
const char var4[32] = "right";
const char var5[32] = "ON";
const char var6[32] = "OFF";
char input[32] = "";
const int output1 = 2;
const int output2 = 3;
const int output3 = 4;
const int output4 = 5;
const int light = 7;
void setup()
{
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, address);
radio.setChannel(100);
radio.setDataRate(RF24_250KBPS);
radio.setPALevel(RF24_PA_MAX);
radio.startListening();
pinMode(output1, OUTPUT);
pinMode(output2, OUTPUT);
pinMode(output3, OUTPUT);
pinMode(output4, OUTPUT);
pinMode(light, OUTPUT);
digitalWrite(output1, LOW);
digitalWrite(output2, LOW);
digitalWrite(output3, LOW);
digitalWrite(output4, LOW);
digitalWrite(light, LOW);
}
void loop()
{
while(!radio.available())
{
digitalWrite(output1, LOW);
digitalWrite(output2, LOW);
digitalWrite(output3, LOW);
digitalWrite(output4, LOW);
}
radio.read(&input, sizeof(input));
if((strcmp(input,var1) == 0))
{
digitalWrite(output1, HIGH);
digitalWrite(output2, LOW);
digitalWrite(output3, HIGH);
digitalWrite(output4, LOW);
delay(10);
}
else if((strcmp(input,var2) == 0))
{
digitalWrite(output1, LOW);
digitalWrite(output2, HIGH);
digitalWrite(output3, LOW);
digitalWrite(output4, HIGH);
delay(10);
}
else if((strcmp(input,var3) == 0))
{
digitalWrite(output3, HIGH);
digitalWrite(output4, LOW);
delay(10);
}
else if((strcmp(input,var4) == 0))
{
digitalWrite(output1, HIGH);
digitalWrite(output2, LOW);
delay(10);
}
else if((strcmp(input,var5) == 0))
{
digitalWrite(light, HIGH);
}
else if((strcmp(input,var6) == 0))
{
digitalWrite(light, LOW);
}
}
//------------------Program Developed by R.Girish---------------//

 

That concludes the receiver.

After completing the project, if the car moves in the wrong direction just reverse the polarity motor.

If your base car is 4 motors wheel drive, connect the left motors in parallel with same polarity, do the same for right side motors and connect to the L298N driver.

If you have any question regarding this joystick controlled 2.4 GHz RC car using Arduino, feel free to express in the comment section, you may receive a quick reply.

get free help for circuit diagrams

You'll also like:

  • 1.  How to Control Servo Motor Using Joystick
  • 2.  Digital Capacitance Meter Circuit Using Arduino
  • 3.  Arduino Tachometer Circuit for Precise Readings
  • 4.  High Current Motor Control Circuit using Arduino
  • 5.  Make this 7 Segment Digital Clock with Beep Alert Circuit
  • 6.  Fading an LED ON/OFF – Arduino Basics

About Swagatam

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials.
If you have any circuit related query, you may interact through comments, I'll be most happy to help!

Subscribe for the Latest Posts


 

Reader Interactions

Comments

  1. joydip kar says

    January 31, 2018 at 7:49 am

    sir,how can we make a robot vehicle which will be able to track RF signal sources?..would you mind helping us in this situation..

    • Swag says

      January 31, 2018 at 4:54 pm

      Joydip, do you mean to say a RF remote controlled robot? sorry i did not understand what you meant by “track RF signal source”…explain elaborately

Primary Sidebar



Categories

  • 3-Phase Power (15)
  • 324 IC Circuits (19)
  • 4017 IC Circuits (52)
  • 4060 IC Circuits (25)
  • 555 IC Circuits (98)
  • 741 IC Circuits (19)
  • Amplifiers (59)
  • Arduino Engineering Projects (83)
  • Audio Projects (94)
  • Battery Chargers (83)
  • Car and Motorcycle (94)
  • Datasheets (46)
  • Decorative Lighting (Diwali, Christmas) (32)
  • DIY LED Projects (89)
  • Electronic Components (97)
  • Electronic Devices and Circuit Theory (35)
  • Electronics Tutorial (109)
  • Fish Aquarium (5)
  • Free Energy (34)
  • Fun Projects (12)
  • GSM Projects (9)
  • Health Related (19)
  • Heater Controllers (28)
  • Home Electrical Circuits (100)
  • How to Articles (20)
  • Incubator Related (6)
  • Industrial Electronics (28)
  • Infrared (IR) (40)
  • Inverter Circuits (98)
  • Laser Projects (12)
  • LM317/LM338 (21)
  • LM3915 IC (25)
  • Meters and Testers (64)
  • Mini Projects (156)
  • Motor Controller (66)
  • MPPT (7)
  • Oscillator Circuits (24)
  • PIR (Passive Infrared) (8)
  • Power Electronics (33)
  • Power Supply Circuits (74)
  • Radio Circuits (9)
  • Remote Control (47)
  • Security and Alarm (61)
  • Sensors and Detectors (118)
  • SG3525 IC (5)
  • Simple Circuits (74)
  • SMPS (29)
  • Solar Controllers (60)
  • Timer and Delay Relay (53)
  • TL494 IC (5)
  • Transformerless Power Supply (8)
  • Transmitter Circuits (40)
  • Ultrasonic Projects (14)
  • Water Level Controller (45)


Circuit Calculators

  • AWG to Millimeter Converter
  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Small Signal Transistor(BJT) and Diode Quick Datasheet
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator


You can also Chat with me here:

Facebook
Twitter
YouTube
Instagram
My Facebook-Page
Quora



© 2022 · Swagatam Innovations

We use cookies on our website to give you the best experience.
Cookie settingsAccept All
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Please visit the Privacy Policy Page for more info.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT