Instructables

How to Control any R/C car with an airplane transmitter!

Picture of 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!

Picture of Gathering Your Parts!
l298.PNG
l298n.PNG
arduino.PNG
Capture.PNG
Capture2.PNG
NiCD-Battery-Pack-7-2V-AAA400mah-.jpg
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
 
Remove these adsRemove these ads by Signing Up
filip.cristian made it!2 months ago

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

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.

*/

eagleyapa14143 months ago

thank you

What range do you get?

What range do you get?

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?

buy a esc

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.

vigneshviki945 months ago

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 *-*

kaviraj H N10 months ago
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 .
ard0071 year ago
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!
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.
angpal591 year ago
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
angpal591 year ago
Can I use a L293DNE ias a substitute?
vkarpuram (author)  angpal591 year ago
Yes!
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
vkarpuram (author)  angpal591 year ago
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.
or if I already have a motor shield, can I use that?
harry881 year ago
So there is no delay beetween when you press the button and the motor "goes"?
harry881 year ago
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.
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.
vkarpuram (author)  eXtremeSomething2 years ago
Yeah, the 2.4GHz is a universal frequency and dosen't cause interference, so it should be fine.
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.
rishal2 years ago
nice tutorial, could i use the l293D as a sustitute instead of the L298n?
vkarpuram (author)  rishal2 years ago
yes, you can use any other motor driver, as per your requirements.
mkarpuram2 years ago
Cool and Innovative :)
awesome
Love it.
vkarpuram (author)  Jason Bedard2 years ago
Thanks guys :)
Bongmaster2 years ago
neatage :) i have that radio set too :)