Introduction: RC Airplane Remote Control Through Recycling
The earth is overwhelmed by trash... The best solution is to recycle.
In this instructable, I will be recycling an old remote control transforming it into an airplane/flying wing remote control using Arduino. The remote control has five channels (throttle, aileron, rudder, elevator, and landing gear), and can be used for airplane and flying wing, and the mode of operation is chosen using a switch. The remote contains also a landing gear switch, and a trimming swith to trim the rudder, elevator, and aileron channels. You need some programming and soldering skills in order to achieve this project.
It will be shown that not only primitive things can be done with recycling, but also technological and fun things. This series intends to encourage people to recycle their garbage instead of throwing it and harm the ecological system on the earth.
Step 1: Coding + Simulation
The first step is to write the code and test it through simulation. I will be using the Arduino software to write the code and Proteus for simulation.
* For the transmitter side:
The RF transmitter connections are as follows:
- VCC – This can be any positive DC voltage from 3 to 12 volts. In this experiment we will get 5 volts from our Arduino.
- GND – The ground connection, connected to one of the Arduino ground terminals.
- DATA IN – This is connected to pin 12 of the Arduino. You should try and use pin 12 as by default the library we’ll be using in our sketch uses this pin for data output.
The joysticks (which are potentiometers) are connected as follows:
- Throttle pot = A2 channel of Arduino UNO
- Rudder pot = A3 channel of Arduino UNO
- Elevator pot = A4 channel of Arduino UNO
- Aileron pot = A5 channel of Arduino UNO
Digital pins:
- Pin 2 of Arduino UNO will be connected to the landing gear switch
- Pin 3 of Arduino UNO will be connected to the trimmer switch (after choosing Trimming mode, the joysticks will be used to trim the channels)
- Pin 4 of Arduino UNO will be connected to the Airplane/Flying wing mode select switch
- Pin 5 of Arduino UNO will be connected to the Buzzer
* For the receiver side:
The RF receiver connections are as follows:
- VCC – Unlike the transmitter this needs to be 5 volts. We will use the 5 volt output from the Arduino.
- GND – Again a ground that is connected to any Arduino ground pin.
- DATA OUT – This needs to be connected to digital pin 11 on the Arduino.
The servomotors connections are as follows:
- Throttle servomotor is connected to pin 3 of Arduino UNO
- Elevator servomotor is connected to pin 5 of Arduino UNO
- Rudder servomotor is connected to pin 6 of Arduino UNO
- Aileron servomotor is connected to pin 9 of Arduino UNO
- Landing gear servomotor is connected to pin 10 of Arduino UNO
IMPORTANT NOTE BELOW!!!
* Concerning the library used, I used library "RH_ASK.h" for the RF modules. Note that this library uses timer 1, which conflicts with the library "Servo.h" used to control the servomotors. In order to solve this problem, you have two opportunities.
1- Changing the main timer of library "RH_ASK.h" and make it timer 2. this is done by changing the header in "RH_ASK.cpp" file. The following is copied from this file, and can help changing the timer of the library:
// RH_ASK on Arduino uses Timer 1 to generate interrupts 8 times per bit interval
// Define RH_ASK_ARDUINO_USE_TIMER2 if you want to use Timer 2 instead of Timer 1 on Arduino // You may need this to work around other librraies that insist on using timer 1 // Should be moved to header file #define RH_ASK_ARDUINO_USE_TIMER2 // --- I USED IT ABD ---
2- Using the library "ServoTimer2" for servomotor control, which uses timer 2.
I added the Arduino codes for the transmitter and the receiver, but unfortunately, I was not allowed to upload the Proteus simulation (File type not allowed!). NOTE that in the codes, I added a long delay (1 second) only to be able to track the output of the Arduino. This delay should be removed after the verification step (verifying that everything is working well).
Step 2: Components Needed
The required components are:
- An old remote control with joysticks; 3 or 4 channel remotes can be used. However, if you need to control the throttle, aileron, rudder, and elevator you need a 4 channel remote control; the one that has two joysticks that both move up/down and left/right.
- An RF 433 MHz transmitter/receiver module (https://randomnerdtutorials.com/rf-433mhz-transmitter-receiver-module-with-arduino/)
- 2 x Arduino UNO boards
- A prototype board
- Male Pin Header Connectors
- Some wires and battery connectors
- An empty box (I used an ice cream plastic box)
- Some switches
Step 3: Making the Hardware
Making the hardware requires a lot of tuning and tinkering; however, it is the most important step in any project. In this project, we have two circuits to be accomplished: the transmitter and the receiver. Following the simulation on Proteus, the connections were made on a prototype board, and using male connectors transmitter/receiver "shields" are prepared. These shields are simply placed on the Arduino boards, and all the connections are established according to the required circuit.
* Transmitter side:
- First you need to prepare the joysticks by removing their connections with the old circuit of the transmitter. This can be made with a razor blade. Then, all the Vcc are connected together, and all the GND are connected together. Next, a Vcc/GND power wire is secured, and flat cables are used to secure pot pins. The flat cables along with the power wire will be then soldered on the prototype board of the transmitter shield.
- Next, the transmitter shield is prepared. Male connectors are soldered so the shield will be able to be placed on the Arduino UNO pins, the RF transmitter is soldered and its connections are secured, and the power and flat cables from the joysticks are soldered to their respective pins. Note that I am using a 7.2 v Li-ion battery (2x3.7v connected in series) to power the transmitter. the Vcc of the battery is connected to Vin of the Arduino UNO, and the GND of the battery is connected to the GND of the microcontroller board.
- Note that all the switches (except for pin 4) are using internal pull-up resistors, so no need to solder pull-up resistors for these pins. Pin4 did not work without a pull-up resistor on Proteus, so I decided to solder one.
* Receiver side:
The shield is prepared by soldering the male connectors in columns, soldering the RF receiver and securing its connections, and soldering one column of male connectors as servomotor pins. Three of the servomotors will take their power from the Vin of the microcontroller board (again, powered with another 7.2 v Li-Ion battery); these servomotors will be controlling the ailerons, rudder, and elevator of the airplane. The fourth servomotor is powered directly from the Vcc of the Arduino UNO (5v), and will be controlling the thrust (connected to the ESC).
The transmitter and receiver are tested on the computer. By moving the joysticks on the transmitter, it is possible to see the servomotor values received on the receiver side on the computer.
Step 4: Finishing Up and Testing
After finishing and testing the hardware part, we need to find a box to include all the mess. I used an ice cream plastic box. I added three switches to the box (fixed with some heat): the Gear switch, Airplane/flying wing switch, and the Trim/Fly switch. Finally, I fixed the joysticks with some tiny bolts. For the batteries, I used my 13 year old helicopter 2S (7.2 v) battery for the transmitter, and two Li-Ion batteries (2x3.7 = 7.2 v) salvaged from my old laptop battery for the receiver.
I changed the codes a little bit; removed the delays and the serial port printing. The final codes are attached here. The previous codes are best for the simulation and hardware check up.
I added a testing video as well; Although the flying wing mode is not shown in the testing, it works great.
Happy flying!
*** UPDATE (21/6/2021): The transmission range was not satisfying, so I made a detailed search on the internet to solve the problem. I found the following interesting points:
- The antennas of height 17.25 cm are connected to the receiver and transmitter sections
- Some experiments:
* In the first phase when RF module is used without antenna, the operational range of RF module is found to be 68 metre.
* In second phase, antennas of standard height i.e. 17.25 cm are connected to both transmitter and receiver sections and both sections are powered by single 9V batteries. the extended operational range of RF module is found to be 150 metre.
* The supply voltage is halved to 4.5V. Due to reduction in supply voltage, power transmission to the circuits and the antennas is reduced , the operational range of the module is found to be 100 metre.
* Variable Power Supply with Antenna ( Two 9V Batteries in parallel + Antenna ) 300m
* I swapped the transmitter with another 433MHz transmitter from another vendor. I was able to run it at 12v and wow did it make a difference in the transmission range.
* In general the factors you need to consider is the transmitting power, receiver sesitivity and baud rate.
* The other factor is baud rate. Lower your baud rate for maximum distance. Some of the cheapest modules often only get to about 1200Baud.
* A 17.3 cm piece of straight, solid copper wire makes a decent antenna for the cheap 433 MHz receivers. You really can't do much better than that!
* Those cheap modules work fine with a balanced dipole antenna, as shown below (33 cm tip to tip). Connect one inner end to ANT, the other to GND. I get 300 meters line of sight range.
*** UPDATE (29/6/2021):
- I had problems with pin 3 in the Arduino (connected originally to the ESC-throttle) so I connected the ESC to pin 10, and put the gear servo on pin 3 (no gears for now).
- The brushless motor did not turn without ESC calibration; so I calibrated it by removing the power (red and black thick wires) from the ESC and connecting the ESC to the Arduino (three thin wires, black, red, and white), pull the throttle stick to the maximum, power the ESC, and then lowering the stick to the minimum. This is essential so that the ESC knows your maximum and minimum throttle values.
- I added also a video for the control testing
*** UPDATE (6/7/2021):
- I added a digital pin 2 to the receiver code; This pin changes values (HIGH/LOW) according to the GEAR switch changing mode (a relay will be connected to this pin)
- Adding the trimmed value is done BEFORE mapping between values 1000 and 2000 (else, the effect will be too small)