Introduction: How to Control Any R/C Car With an Airplane Transmitter!

Have you ever wondered if you could use your R/C airplane transmitter to control any R/C car as well?
                   How awesome would it be to have 6 or more channels to control your R/C car, and also customize each channel as per your choice?
                   I’ve been longing to make something so that I could make this possible so I started off with a little bit of research soon after my 8th grade exams. During my holidays last month, at the age of 14, I finally completed the project and now have a wonderful piece of circuitry which I can integrate on just any R/C car and use the airplane transmitter to control it after customizing every channel just the way I like.
                   I’ve been very excited about this ever since I completed it and wish to share with everyone how exactly I made it so you guys could enjoy too!! Well this tutorial explains exactly how I made this piece of circuit in detail. If you still happen to have any doubts, please feel free to post your queries and comments, and it’ll be my pleasure to answer!

Enjoy the instructable!! :-)

Step 1: Gathering Your Parts!

Parts Required 
                                                
1. Flysky Transmitter and Receiver
2. L298n Motor Driver Shield (Parts list and tutorial for the shield is below)
3. Arduino Mega 2560
4. An R/C Car
5. 9v battery
6. 7v NiCd Battery

Step 2: The Transmitter

For this tutorial, I will be using the flysky ct6b transmitter. The Operator controls the plane through a radio link which is connected to the receiver via electromagnetic radiation i.e. PPM signals (Pulse Position Modulation). Basically, the R/C equipment consists of a transmitter which is operated by the operator and a receiver that receives the signals that are transmitted by the R/C transmitter.
    PPM
    Pulse-position modulation (PPM) is a form of signal modulation in which M message bits are encoded by transmitting a single pulse in one of   possible time-shifts. This is repeated every T seconds, such that the transmitted bit rate is M/T bits per second. It is primarily useful for optical communications systems, where there tends to be little or no multipath interference.
For more Information on PPM visit - http://en.wikipedia.org/wiki/Pulse-position_modulation
To use an airplane R/C transmitter with any microcontroller (in my case the arduino) we have to first decode the PPM signals. To decode these signals I will be using the arduino programming environment.

Step 3: The Motor Driver Shield

To use any motor controlled appliance with a microcontroller, we need a motor driver that basically allows you to add an external battery to control the appliance. Here I will be using the L298n motor driver which allows you to use up to 24v and 4 amps.
Now I will show you how to make your own L298 motor driver shield for the arduino.
Parts List
1. L298N DUAL H-Bridge  IC
2. IN4004 diodes
3. Burg Strips
4. A standard PCB (Printed Circuit Board)
5. Heat Sink
6. Basic Tools and some wire

The L298n H-Bridge
The basic principle of an H-Bridge was being able to control the direction of the motor i.e. forward or backward. This was achieved by managing the current flow through circuit elements called as transistors. The formation looks like an H and that’s where it gets its name – H-Bridge. The L298 uses this principle to control the motors.

Schematic  
I made my shield on a universal PCB with burg strips spaced to go into the arduino’s headers instead of separate wires, which made it easy to use.

Step 4: The Flysky Receiver

Now we have to wire up the flysky receiver.
Connecting the receiver to the arduino
Connect any two channels of the receiver that you want to use to the arduino pins 9 and 10.

Connecting the battery to the Receiver
Connect the positive and negative terminals of the receiver to the 9v battery. Make sure all the grounds are connected (i.e. the arduino’s ground, the receivers ground and the ground of both the batteries). Usually, many problems occur when all the grounds are not connected.

Step 5: The R/C Car

I used a cool R/C car with suspensions to make it easy to use on many terrains!
So first of all, we have to remove the circuit from the R/C car.
Make sure you do not damage any component unless it’s an old car that’s spoilt :) .
Now Solder two wires to each motor and connect these wires to the
L298n shield as shown on the schematic in the previous step.

Step 6: Programming the Arduino

At last, we get to the code that decodes the PPM signals and converts them so that the L298 can understand them. I used the pulseIn () function to read the transmitter stick values!
Below is the code which is self explanatory!!


/*   This is the code for controlling any R/C car with an airplane transmitter written by Vishnu Chaitanya Karpuram. Enjoy!!   */
int motor1Left = 5;// defines pin 5 as connected to the motor
int motor1Right= 6;// defines pin 6 as connected to the motor
int motor2Left = 7;// defines pin 7 as connected to the motor
int motor2Right = 8;// defines pin 8 as connected to the motor

int channel1 = 9; // defines the channels that are connected
int channel2 = 10;// to pins 9 and 10 of arduino respectively

int Channel1 ; // Used later to 
int Channel2 ; // store values

void  setup ()
{
   pinMode (motor1Left, OUTPUT);// initialises the motor pins
   pinMode (motor1Right, OUTPUT);
   pinMode (motor2Left, OUTPUT);
   pinMode (motor2Right, OUTPUT);// as outputs
   pinMode (channel1, INPUT);// initialises the channels
   pinMode (channel2, INPUT);// as inputs
   Serial.begin (9600); // Sets the baud rate to 9600 bps
}

void  loop ()
{
  Channel1 = (pulseIn (channel1, HIGH)); // Checks the value of channel1
  Serial.println (Channel1); //Prints the channels value on the serial monitor
 
  if (Channel1 > 1300 && Channel1 < 1500 ) /*If these conditions are true, do the following. These are the values that I got from my transmitter, which you may customize according to your transmitter values */
  {
    digitalWrite (motor1Left, LOW); // Sets both the
    digitalWrite (motor1Right, LOW);// motors to low
  }
 
  if (Channel1 < 1300) // Checks if Channel1 is lesser than 1300
  {
    digitalWrite (motor1Left, HIGH);// Turns the left
    digitalWrite (motor1Right, LOW); // motor forward
  }
  if (Channel1 > 1500) // Checks if Channel1 is greater than 1500
  {
    digitalWrite (motor1Left, LOW);// Turns the right
    digitalWrite (motor1Right, HIGH);// motor forward
  }
  Channel2 = (pulseIn (channel2, HIGH)); // Checks the value of channel1
  Serial.println (Channel2); //Prints the channels value value on the serial monitor
 
  if (Channel2 > 1300 && Channel1 < 1500 ) // If these conditions are true, do the following
  {
    digitalWrite (motor2Left, LOW);// Sets both the
    digitalWrite (motor2Right, LOW);// motors to low
  }
 
  if (Channel2 < 1300) // Checks if Channel2 is lesser than 1300
  {
    digitalWrite (motor2Left, LOW);// Turns the left
    digitalWrite (motor2Right, HIGH);// motor backward
  }
  if (Channel2 > 1500) // Checks if Channel2 is greater than 1500
  {
    digitalWrite (motor2Left, HIGH);// Turns the right
    digitalWrite (motor2Right, LOW);// motor backward
  }

/* NOTE - Check the values of the channels that you get in the serial monitor
           and adjust the values in the if statements accordingly. In my case when the stick
           was centered, my readings were 1400 to 1470. When the stick was raised, the readings were
           above 1470 and when it was lowered, the readings were below 1300.
*/

Step 7: Testing Time!!!

Finally, let’s test our cool creation and check how it works. See the video below to see it in action!!

Comments

author
sanman32 (author)2015-03-15

i'm kind of new to all this stuff but i wanna ask if i have an rc transmitter that i got with an rc car and a rc receiver circuit from a different rc car is thier a way to connect them so that the receiver takes information from the transmitter

unnamed.jpgunnamed (1).jpg
author
TejasK10 (author)sanman322017-08-05

r u dumb? the encoder and decoder circuit has to be the same. and that pic is quite useless

author
saintofinternet (author)2016-07-09

hey...

can you tell me if your code will work on the monster motor shield.... link --> ( https://www.sparkfun.com/products/10182 )

if not can you guide me for a setup of the same.

author
yakhtar (author)2016-02-21

Only the right stick can be used for moving forward, backward, left and right! How to use the left throttle stick for moving forward and backward?

author
itsPauV (author)2015-12-31

Hi, where do I have to use which Batterys? Btw nice project ;D

author
NuttaponT (author)2015-10-08

Thank you so much

author
expertman (author)2015-09-18

Hi
my rc heli 40mhz remote just stopped working so is there a way i can use any rc remote to my rc heli

author
sudeep2896 (author)2015-08-28

hai...i am also working on this..could you just help me out..l298n is only compatible with 4 amp of current ...but i need to make a circuit for allowing 7.5 amp of current for controlling a battle bot

please help me ow to make use of four channels also for four diff motors

author
E-Learn Solutions (author)2015-04-12

Hai My Friend. This is A.venu and i have done your projects its working and now i need some help in that project for modifing it, so please give me your mobile number plz.......

author
RajatT1 (author)2015-04-04

Where to connect the motors + and - i am a beginner so can u plzz tell

author
RajatT1 (author)2015-04-04

And can u plz tell where i have to connect the Out 1,2,3,4

author
RajatT1 (author)2015-03-25

can i use arduino uno r3 plzz tell fast!! if yes what changes i have to make

author
robobot3112 (author)RajatT12015-03-31

yes if any pin exceeds 13 then use a different pin. ex- const int 52 (mega)

const int 5 (uno)

author
RajatT1 (author)robobot31122015-04-01

can u plz tll the connections of l298n controller shield

author
robobot3112 (author)RajatT12015-04-01

all the connections are similar no change none of the pins exceed 13. use the same code.

author
ljubomir.milojevic (author)2015-03-11

Would this work with a bit of tweaking for this controller and reciever ?

http://www.ebay.co.uk/itm/Flysky-FS-GT2-2-4GHZ-Tra...

Excelent guide !

author
tpbaraiya (author)2015-03-06

Thanx dude, it helped me a lot for my project. You are a genius!

author
mahroofali (author)2015-02-27

buddy am using an arduino uno r3....so what are the changes that i have to do

author
rsatheesan (author)2015-02-20

hey can you modify this program to make use of the whole 6 channels

author
gabriele.barbaraci (author)2015-02-10

Hi

Can you please write the code to control a quadcopter please because I have some problem due to my inexperience in Arduino 2

author
Alhajami (author)2014-11-26

What was your FlySky reciever voltage output on the signal lines? I'm just curious why the diodes?
My flysky reciever is giving me 0.2 - 0.38 V on the signal line and I'm try to get 1.2v

author
shashank318 (author)2014-11-16

not working for me i m using ARDUINO UNO and L298N to drive my relays

author
filip.cristian made it! (author)2014-08-17

Added progressive acceleration to the traction motor:

/* This is the code for controlling any R/C car with an airplane transmitter written by Vishnu Chaitanya Karpuram.

Moddified by Cristi to use with pwm and Ardumoto */

int pwma = 3;// defines pin 3 as connected to the motor A pwm

int dira= 12;// defines pin 12 as connected to the motor A dir

int dirb = 13;// defines pin 13 as connected to the motor B dir

int pwmb = 11;// defines pin 8 as connected to the motor B pwm

int channel1 = 6; // defines the channels that are connected

int channel2 = 5;// to pins 5 and 6 of arduino respectively

int Channel1 = analogRead(6); // Forward/Back speed

int Channel2; // Turn

void setup ()

{

pinMode (pwma, OUTPUT);// initialises the motor pins

pinMode (dira, OUTPUT);

pinMode (dirb, OUTPUT);

pinMode (pwmb, OUTPUT);// as outputs

pinMode (channel1, INPUT);// initialises the channels

pinMode (channel2, INPUT);// as inputs

// Serial.begin (9600); // Sets the baud rate to 9600 bps

}

void loop ()

{

Channel1 = pulseIn (channel1, HIGH, 25000); // Checks the value of channel1

//Serial.println (Channel1); //Prints the channels value on the serial monitor

if(Channel1 == 0){digitalWrite(dira, 0);digitalWrite(pwma, 0);}; //keeps motors off when no signal from the transmiter recieved

if(Channel1 >1400 && Channel1<1500){digitalWrite(dira, 0);digitalWrite(pwma, 0);}; //transmiter on and no move for motors when transmiter on standby

if(Channel1 <1400 && Channel1>1){digitalWrite(dira, 0);analogWrite(pwma, map(Channel1, 1000, 1400, 0 , -255));}; //sends progressive power to motor A to move forward

if(Channel1 >1500){digitalWrite(dira, 1);analogWrite(pwma, map(Channel1, 1500, 2000, 0 , 255));}; //sends progressive power to motor A to move backwards

Channel2 = pulseIn (channel2, HIGH, 25000); // Checks the value of channel1

//Serial.println (Channel2); //Prints the channels value value on the serial monitor

if(Channel2 == 0){digitalWrite(dirb, 0);digitalWrite(pwmb, 0);}; //keeps motors off when no signal from the transmiter recieved

if(Channel2 >1400 && Channel2<1500){digitalWrite(dirb, 0);digitalWrite(pwmb, 0);}; //transmiter on and no move for motors when transmiter on standby

if(Channel2 <1400 && Channel2>1){digitalWrite(dirb, 0);digitalWrite(pwmb, 1);}; //sends full power to motor B tu turn left

if(Channel2 >1500){digitalWrite(dirb, 1);digitalWrite(pwmb, 1);}; ////sends full power to motor B tu turn right

}

/* NOTE - Check the values of the channels that you get in the serial monitor

and adjust the values in the if statements accordingly. In my case when the stick

was centered, my readings were 1400 to 1470. When the stick was raised, the readings were

above 1470 and when it was lowered, the readings were below 1300.

*/

IMG_1692.jpg
author
filip.cristian (author)2014-08-17

Good to understand how it works but tweeked it a little because when the reciever was off, the motors were going to reverse as the values were under 1300 (0). Now i am trying to add pwm control.

Tweeked code:

/* This is the code for controlling any R/C car with an airplane transmitter written by Vishnu Chaitanya Karpuram. Enjoy!! */

int motor1Left = 3;// defines pin 3 as connected to the motor A pwm

int motor1Right= 12;// defines pin 12 as connected to the motor A dir

int motor2Left = 13;// defines pin 13 as connected to the motor B dir

int motor2Right = 11;// defines pin 8 as connected to the motor B pwm

int channel1 = 6; // defines the channels that are connected

int channel2 = 5;// to pins 5 and 6 of arduino respectively

int Channel1 ; // Used later to

int Channel2 ; // store values

void setup ()

{

pinMode (motor1Left, OUTPUT);// initialises the motor pins

pinMode (motor1Right, OUTPUT);

pinMode (motor2Left, OUTPUT);

pinMode (motor2Right, OUTPUT);// as outputs

pinMode (channel1, INPUT);// initialises the channels

pinMode (channel2, INPUT);// as inputs

// Serial.begin (9600); // Sets the baud rate to 9600 bps

}

void loop ()

{

Channel1 = pulseIn (channel1, HIGH, 25000); // Checks the value of channel1

//Serial.println (Channel1); //Prints the channels value on the serial monitor

if (Channel1 == 0) /*If these conditions are true, do the following. These are the values that I got from my transmitter, which you may customize according to your transmitter values */

{

digitalWrite (motor1Left, LOW); // Sets both the

digitalWrite (motor1Right, LOW);// motors to low

}

if (Channel1 > 1300 && Channel1 < 1500) /*If these conditions are true, do the following. These are the values that I got from my transmitter, which you may customize according to your transmitter values */

{

digitalWrite (motor1Left, LOW); // Sets both the

digitalWrite (motor1Right, LOW);// motors to low

}

if (Channel1 < 1300 && Channel1 > 1) // Checks if Channel1 is lesser than 1300

{

digitalWrite (motor1Left, HIGH);// Turns the left

digitalWrite (motor1Right, LOW); // motor forward

}

if (Channel1 > 1500) // Checks if Channel1 is greater than 1500

{

digitalWrite (motor1Left, HIGH);// Turns the right

digitalWrite (motor1Right, HIGH);// motor forward

}

Channel2 = pulseIn (channel2, HIGH, 25000); // Checks the value of channel1

//Serial.println (Channel2); //Prints the channels value value on the serial monitor

if (Channel2 == 0) // If these conditions are true, do the following

{

digitalWrite (motor2Left, LOW);// Sets both the

digitalWrite (motor2Right, LOW);// motors to low

}

if (Channel2 > 1300 && Channel2 < 1500) // If these conditions are true, do the following

{

digitalWrite (motor2Left, LOW);// Sets both the

digitalWrite (motor2Right, LOW);// motors to low

}

if (Channel2 < 1300 && Channel2 > 1) // Checks if Channel2 is lesser than 1300

{

digitalWrite (motor2Left, LOW);// Turns the left

digitalWrite (motor2Right, HIGH);// motor backward

}

if (Channel2 > 1500) // Checks if Channel2 is greater than 1500

{

digitalWrite (motor2Left, HIGH);// Turns the right

digitalWrite (motor2Right, HIGH);// motor backward

}

}

/* NOTE - Check the values of the channels that you get in the serial monitor

and adjust the values in the if statements accordingly. In my case when the stick

was centered, my readings were 1400 to 1470. When the stick was raised, the readings were

above 1470 and when it was lowered, the readings were below 1300.

*/

author
eagleyapa1414 (author)2014-06-26

thank you

author
PrepareToSurvive (author)2014-06-02

What range do you get?

author
PrepareToSurvive (author)2014-06-02

What range do you get?

author
earthwindnpyro (author)2014-05-18

That is pretty cool. Thank you.

I just used your instructable to hack an R/C Hovercraft that I found at a garage sale. I was able to increase the range considerably. I also added a servo and two rudders to compliment the stock two fan steering.

Any thoughts on how to use PWM to control the speed of the motors?

author
Dowaine (author)earthwindnpyro2014-06-01

buy a esc

author
earthwindnpyro (author)Dowaine2014-06-01

Thank you for your comment. I already have a motor controller / driver. I would need two esc's because there are two motors and I have very limited space on the model and the Arduino comes with the capability of controlling motor speed with PWM. In fact I am using an Arduino Pro Mini as the space is very compact.

author
vigneshviki94 (author)2014-05-16

hi bro,

im new to electronics.

actully i was trying out your concept in my project ....can i use l298n motor driver ckt which is readly avalable in the market *-*

author
kaviraj H N (author)2013-12-17

Hi,
1) my robot vehicle motor is running randomly after transmitter switch off. so please tell me what is the problem in arduino uno program.
2) I connected servo motor to ch-3 directly without program and it is not controlling sometimes according to transmitter .

author
ard007 (author)2013-07-29

very impressive - however can to advice on my own project. trying to control a mobile platform using arduino and a 2-channel flysky transmitter/receiver pair. My platform using a adafruit motor shield to control all 4 independent wheels. I can get the forward and backward movement but not the steering!

author
Aj Creations (author)2013-03-20

Excellent. I'm still held back with the MCU type DC motor control to run toy cars with my RC equipment.
Also, does this setup allow for variable speed control? and I'm sure I can make this one work with the modest Arduino UNO.

author
angpal59 (author)2013-02-22

I am definetely following you, you are a genius, I would give my left arm to be as smart as you, thanks for your help and I hope not to bother you with an abundance of questions. Thanks again vKarpuram

author
angpal59 (author)2013-02-21

Can I use a L293DNE ias a substitute?

author
vkarpuram (author)angpal592013-02-22

Yes!

author
angpal59 (author)angpal592013-02-21

You know what bums me out is your 16 and I'm 53 and you know more in your pinky finger than I know about this completely (lol), I need your help, I will pay you if I have to to show me a few things, I cant get my motors to run, thats all I want to do, I have the 6 channel flysky model FS-CT6B and all I want to do is make channels 5 and 6 to run my motors and also as a bonus if you can show me how to make my servos go the 180degrees unless you cant on this paerticular transmitter. I know you are probably a busy guy, but man oh man I would love some help, Thanks angpal59

author
vkarpuram (author)angpal592013-02-22

Hello angpal59. would be possible for you to use channel 5 but not channel 6 as the last channel is pcm not ppm! You can use a motor shield for this too. For the servo part, you just have to connect it to the respective channel on the receiver.

author
angpal59 (author)angpal592013-02-21

or if I already have a motor shield, can I use that?

author
harry88 (author)2013-02-17

So there is no delay beetween when you press the button and the motor "goes"?

author
harry88 (author)2013-02-16

Hi I think its awesome that you can do all this at the age of. 14 I would like to get in touch with you I am only 13 and none of my friends can make sense of what I'm saying most of the time. I have a moderate understanding of aurduino programming and I have a traxxas tmax and a hobbyzone supercub I would love to meet you and maybe do a colarberation on some of my project ideas. Sorry about spelling errors I am no good at typing on my touch screen kindle fire.

author
eXtremeSomething (author)2012-06-24

A great way of getting extra channels for servos and other actuators into a car.
:D

As a side note i think there might be laws that require you to only use certain frequencies on the ground or at set locations, and aircraft usualy use a different frequency.

author

Yeah, the 2.4GHz is a universal frequency and dosen't cause interference, so it should be fine.

author
Beergnome (author)vkarpuram2012-06-30

this is correct. The old school AM and FM transmitters operate in frequency bands set aside JUST for either surface or air radios.

its is illegal to use a air radio for a surface device and vica versa. But, since this is a 2.4ghz radio and the RX is "bound" to the TX, this is no longer a problem and you can use a 2.5 for either surface or air.

if the 'ible was using a traditional air radio for a surface model I would have to call schinangins.

author
rishal (author)2012-06-28

nice tutorial, could i use the l293D as a sustitute instead of the L298n?

author
vkarpuram (author)rishal2012-06-28

yes, you can use any other motor driver, as per your requirements.

author
mkarpuram (author)2012-06-27

Cool and Innovative :)

author
gupta karpuram (author)2012-06-26

awesome

author
Jason Bedard (author)2012-06-24

Love it.