RC Plane Transmitter Receiver Arduino Part 2 of 2

In the previous part I explained all the components used in RC Plane Transmitter Receiver Arduino and some basic configurations and testing of the components. In this post, I will show you how I assembled all the components mentioned above and explain the working of RC Plane Transmitter, Receiver and their circuits. I highly recommend you to go through the first part if you are new to it and get a better understanding of the whole project.

What we are Looking At

You like this video, click the subscribe below to subscribe my youtube channel for future updates.

The Transmitter

Before proceeding, I highly recommend you to use a breadboard before making a PCB. As mentioned in the previous post, it will be easy to build and troubleshoot the circuit.

Our transmitting unit consist of an Arduino Nano connected to a HC12 Wireless communication module and the Joystick. We can supply a voltage of 5 V to both Joystick and HC12. You can do that whichever way you want. I powered up arduino nano using a power bank for mobile phone through its mini USB port and used its +5V out to power the Joysticks and the Transmitter.

Share

Share on Pinterest Share on FacebookShare on Twitter

Shown above is the block diagram of the transmitting unit. There are two analogue out for one joystick. Which means we need four analogue pins to connect two joysticks to the arduino.  To know how a joystick work and to test it, please go through my previous post.

 

The Code

Given below is the arduino code that is to be uploaded to the arduino nano of the Transmitting unit. You can download the entire code by clicking the download button below.

 

Click Below to Download The Code Download

I used analog pins A0, A1, A5 and A7 to get the analog reading of the joysticks. These values varies from 0 – 1023. But these values are changed from 0-1023 to 0-180, the reason of doing this conversion will be explained in the coming steps. These values will be stored in the variables “thr” ( for throttle), “ail” (for aileron), “ele” (for elevator) and “rud” (for rudder). These values will be sent to the transmitter one by one seperated by a coma (,) like show below

25,45,81,40

25,45,81,40

26,45,78,41

29,45,60,45

In the transmitting part, I have used software serial library so that you can view the output in arduino serial monitor while transmitting the data to the HC12. But let me tell you that software serial is not stable. Some times it may cause problems with arduino clones. In the receiving part when I tried the software serial library, it caused malfunctioning and I had to change the entire code.

The Receiver

In the receiving part of RC Plane Transmitter Receiver, I used a LiPo battery so that we can drive the brushless motor and two servo motors which will draw considerable current from the source. In this LiPo battery is connected to the ESC of the brushless motor, which will be powering the arduino, HC12 Wireless communication module and the two servo motors via its 5 V output.Shown above is the block diagram of the receiving unit. The HC12 module receives the data from the transmitting unit and will pass the signals to the arduino via the serial communication port (0 and 1). The signal will be a long string of decimal numbers separated by comas. These values are separated and stored in different variables. These values will be used to create PWM signals which are later fed to Servo motors and the ESC which will drive the Servos and the brushless motor.

If you have trouble configuring or do not know how to, check out my previous post where I explained everything about the ESC and its calibration. I have made a simple sketch to automatically calibrate the ESC (which will work with most of the ESC).

The Code

Given below is the arduino code that is to be uploaded to the arduino nano of the receiving unit. You can download the entire code by clicking the download button below.

Click Below to Download The Code[AdSense-A]Download

In the receiving unit, I used Arduino nano clone which caused some difficulty during the testing phase and due to that reason, I did not use the pins used for software serial. First we read the data coming from the receiving module to a variable named ‘input’. This ‘input’ is a long string of decimal numbers separated by comas. This string is broken down into smaller smaller numbers and are then stored in separate variables.

Here we use servo.h library to drive the brushless motor and the servos. Driving the brush-less motor is similar to that of servo motor. We provide PWM signals to the signal input pin of the ESC which is connected to the brushless motor using functions inside the servo.h library.

Take Off

RC Plane Transmitter Receiver Arduino is now set. Once the code is uploaded to both transmitter and receiver arduino boards, you can test it. You can power the Transmitting unit using a power bank or any other regulated 5 V power supply. Once it is ready, it will start the transmission (you can see the red LED blinking).

In the receiving unit of RC Plane Transmitter Receiver, as mentioned earlier, can be powered using a 12 V LiPo battery. The power regulation is done by the ESC which will provide regulated, stable 5 V supply to the servo motor, arduino and the HC12. When this unit is powered up, it will automatically configure the thresholds, you will hear “beep beep beep ……beeep …beeep ……beeeeeeeeeeeeeeeeep”. The long “beeeeeeeeeeeeeeeep” means the ESC has been calibrated successfully. Then the brushless motor will start to spin at half the maximum speed (140 angle) for one second.

If you have trouble configuring or do not know how to, check out my previous post where I explained everything about the ESC and its calibration. I have made a simple sketch to automatically calibrate the ESC (which will work with most of the ESC). After the automatic initial calibration, you can use your joystick to control the brushless motor and the servos. You will find all the codes in the links mentioned above. With a little bit of tweaking, you can control any RC vehicles like RC cars, Trucks, Boats, Helicopters or anything using this low cost DIY remote controller.[AdSense-B]The video tutorial will be uploaded in my you tube channel. Click the subscribe below to subscribe my youtube channel for future updates.

If you have any doubts regarding RC Plane Transmitter Receiver Arduino, need clarifications or you want help in modifying the codes, please let me know in the comments. If you find this useful share this project. If you have any doubts, need clarifications or you want help in modifying the codes, please let me know in the comments.

Rate the Project

Did you find this page useful? Help us to improve by rating this page.

[RICH_REVIEWS_FORM]
[RICH_REVIEWS_SNIPPET stars_only=”true”]

Similar Posts

33 Comments

  1. Hey, nice project. But am not able to upload the code to receive while its connected. Can you help me out? Thanks.

    1. Hi Alex, Are you trying to upload the code while the tx or rx pin is connected to HC12?

  2. Is this parsing of csv are reliable as distance between transmitter and receiver increases or chances of error in receiving signal are poasible?

  3. Is there a particular reason why you are not using an arduino pro mini?
    That one has uart which should allow you to circumvent the whole software serial problem. It is smaller too and the clones are like 2-3$ shipped.

    1. Hi Josh,
      You can also use pro mini. I had some arduino nanos left from my previous projects thats why I used it.

    1. depends up on the size broo..
      coreless motors are used where you want to quickly change the direction of rotation or speed. this is due to low inertia.
      for aeroplanes, it would be better to use brushless motor

  4. How are you wiring the ESC to the Arduino? I am trying to follow your instructions, but that part is giving me some headache.

    Thanks for posting this, it has been so helpful.

    Thanks

    1. ESC is connected to the 12 V LI-PO battery directly.
      The 5V output of ESC is then connected to the Vin of Arduino

      1. I am most concerned with not having the proper connectors. For example, I am getting a ESC Brush-less motor combo, but the they comes with bare wires, no connectors. So, I want to make sure I get everything I need so I can connect everything.

        Thanks for your explanation.

  5. is it possible to get pin to pin diagram of both transmitter and receiver

  6. Can you give me the wiring diagram of these transmitter and receiver

  7. Brushless motor is A2212/5T 2700KV OR 1000KV OR SMTHING ELSE???

  8. I think this is a great tutorial, but I would like to see pictures of the Arduino connections and wiring diagrams, fritzing or something like that, just to let readers visualize better.

    I’m excited to try this on an old 4×4 rc I have kicking around.

    Thanks

  9. Can you please help me to change the code to work with two DC motors. i simply need to one joystick for each motor or even just one pot for each motor. I know most of the coding it is just the HC12 transmitting and reciving that i cant do. Thanks a lot.

    1. you need a h bride to control them …. a pain the @@@@ just take an es and a cd-rom motor 🙂

  10. Can we control 3 motors and it 2 using arduino nano? Because the on the other end I have a arduino mega but for the transmitter end will it be okay?

  11. Hi, friend, I am new to ni beginner, send wiring control dong, i want to learn how to arrange this,

  12. Hi.
    I am totally ignorant in electronics but find it so interesting.
    What I am interested in is a 2 channel Tx/Rx for rudder/elevator only or elevons (flying wing) gliders.
    How complicate would it be to make or what modifications from this project will it request?
    Tks for your interest

  13. Hello!! This is an awesome tutorial! Thank you very much!!
    My transmitting unit works perfectly but my receiving doesn’t T_T and I don’t know why. You commented that when using the Arduino nano clone you had some issues but I don’t understand how you solve it. Could you help me, please?

    1. Hey, I solved it! It was a wrong configuration of the HC12. One question, did it happen to you that the servo motors vibrate too much?

  14. Really cool project, but how can I get the spring out for the left joystick?

  15. for what u r using pin 13 in transmitter , please reply (waiting).

  16. I’m having problems with your sketch. the engine does not respond to the joystick, I think that the hc12 is not working properly. Could you contact me by email x720rr@bk.ru to help me please?

  17. I’m having problems with your sketch. the engine does not respond to the joystick, I think that the hc12 is not working properly. Could you contact me by email to help me please?

  18. Hi Jithin, you really know your stuff. I am also trying to use an HC-12 module to control servos with a joystick in my project. I tried your code but I couldn’t really get it to work. So I found a different way to do it with the same hardware components online, the only problem is that there is occasional twitching with the servo, but otherwise it is responding nicely to the analog stick. Can you find a problem in my code to help eliminate the twitching?

    //Receiver
    #include
    #include

    int ROT ;

    ServoTimer2 myServo;
    SoftwareSerial HC12(10,11); //(tx,rx)
    void setup() {
    myServo.attach(7);
    HC12.begin(9600);
    Serial.begin(9600);

    }
    void loop() {

    while ( HC12.available()>0) {

    ROT = HC12.parseInt();
    Serial.println(ROT);

    myServo.write(ROT);
    delay(50);

    } }

    //Transmitter
    #include

    int ROT ;
    SoftwareSerial HC12(10, 11);
    void setup() {
    Serial.begin(9600);
    HC12.begin(9600);

    }
    void loop() {

    int ROT = analogRead(A3);
    Serial.println(ROT);
    //ROT = map(ROT , 515 , 1023 , 1100 , 1800) ;
    ROT = map(ROT , 0 , 876 , 760 , 1800) ;
    //Serial.println(ROT);
    HC12.println(ROT);
    delay(50);

    }

    1. Dear JITHIN, thank you for your effort but there is something I would like to noticed , that is not 4 channel as you mentioned in the tutorial above it is just one BLDC & 2 servo , means just only 3 channels , in first look to the code seems as taken in to account more than 3 channel, please could you resend a code for complete at least 3 servo + BLDC
      Thanks more.

  19. Can you please send breadboard diagrams to double-check wiring. I have everything assembled and uploaded but am not getting any feedback from the receiver after playing with the joysticks on the controller.

    Cheers

  20. Why didn’t you use the RX and TX ports on the receiver end?
    I am very new to this.

Leave a Reply to admin Cancel reply

Your email address will not be published. Required fields are marked *