DIY RC Plane Transmitter – Receiver Using Arduino Part 2 of 2

In the previous part I explained all the components used in this project 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 the transmitter, the 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.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, 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 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

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, 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 caliberation, 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. The video tutorial wil be uploaded in my you tube channel. Click the subscribe below to subscribe my youtube channel for future updates.

If you have any doubts, 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.

19 Comments

Add a Comment

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