DIY Arduino RC Transmitter - HowToMechatronics
DIY Arduino RC Transmitter - HowToMechatronics
DIY Arduino RC Transmitter - HowToMechatronics
com)
WHAT'S NEW? The 8 Best Arduino Starter Kits For Beginners 2019 (https://howtomec…
(https://www.youtube.com/user/DejanNedelkovski)
(https://plus.google.com/+Howtomechatronics)
(https://www.facebook.com/howtomechatronics/)
Follow me on: ()
Projects (https://howtomechatronics.com/category/projects/)
74 (https://howtomechatronics.com/projects/diy-arduino-rc-transmitter/#comments)
In tutorial we will learn how to build a DIY Arduino RC transmitter. Very often I need wireless con-
trol for the projects that I make, so therefore I built this multifunctional radio controller which can
be used for pretty much everything.
An error occurred.
Try watching this video on www.youtube.com, or enable JavaScript if it is disabled in your browser.
Overview
Now I can wirelessly control any Arduino project with just some small adjustments at the receiver
side. This transmitter can be also used as any commercial RC transmitter for controlling RC toys,
cars, drones and so on. For that purpose it just needs a simple Arduino receiver which then gener-
ates the appropriate signals for controlling those commercial RC devices. I will explain how every-
thing works in this video through few examples of controlling an Arduino robot car, controlling the
Arduino Ant Robot from my previous video and controlling a brushless DC motor using an ESC and
some servo motors.
The radio communication of this controller is based on the NRF24L01 transceiver module which if
used with an ampli ed antenna it can have a stable range of up to 700 meters in open space. It fea-
tures 14 channels, 6 of which are analog inputs and 8 digital inputs.
It has two joysticks, two potentiometers, two toggle switches, six buttons and additionally an inter-
nal measuring unit consisting of an accelerometer and a gyroscope which can be also used for con-
trolling things with just moving around or tilting the controller.
To begin with, let’s take a look at the circuit diagram. The brain of this RC controller is an Arduino
Pro Mini which is powered using 2 LiPo batteries producing around 7.4 volts. We can connect them
directly to the RAW pin of the Pro Mini which has a voltage regulator that reduced the voltage to 5V.
Note that there are two versions of the Arduino Pro Mini, like the one I have that operates at 5V
and the other operates at 3.3V.
(https://howtomechatronics.com/wp-content/uploads/2019/01/DIY-Arduino-based-RC-Transmitter-
Circuit-Diagram.png)
You can get the components needed for this Arduino Tutorial from the links below:
*Please note: These are a liate links. I may make a commission if you buy the components through
these links. I would appreciate your support in this way!
PCB Design
I actually ended up utilizing all analog and digital pins of the Arduino Pro Mini. So now if I try to con-
nect everything together using jump wires it will be quite a mess. Therefore I designed a custom
PCB using the EasyEDA free online circuit design software.
(https://howtomechatronics.com/wp-content/uploads/2019/01/Arduino-RC-Transmitter-PCB-
design.png)
Here I took into consideration the ergonomics of the controller and designed it to be easily held by
two hands, while all controls are within the range of the ngers. I made the edges round and added
some 3mm holes so I can mount the PCB onto something later. I placed the pins for programming
the Arduino Pro Mini at the top side of the controller so they can be easily accessed in case we
want to reprogram the Arduino. We can also notice here that I used the RX and TX pins of the Ar-
duino for the joystick buttons. However these two lines needs to be disconnected from anything
while we are uploading the sketch to the Arduino. So therefore they are interrupted with two pins
which can be then easily connected using simple jumper caps.
Please note: Make sure you have the right Arduino Pro Mini version to mach the PCB or modify
the PCB design according to it.
DOWNLOAD
Then I ordered the PCB from JLCPCB (https://jlcpcb.com/) which are also the sponsor of this video.
Here we can simply drag and drop the Gerber le and once uploaded, we can review our PCB in the
Gerber viewer. If everything is all right then we can go on and select the properties that we want for
our PCB. This time I chose the PCB color to be black. And that’s it, now we can simply order our PCB
at a reasonable price. Note that if it’s your rst order from JLCPCB, you can get up to 10 PCBs for
only $2.
And here it is. I just really love how this PCB turned out in this black color. The quality of the PCB is
great, and everything is exactly the same as in the design.
Assembling the PCB
Ok now we can move on with assembling the PCB. I started with a soldering the pin headers of the
Arduino Pro Mini. An easy and good way to do that is to place them onto a breadboard and so they
will stay rmly in place while soldering.
The Pro Mini also have pins on the sides, but note that these pins location might vary depending on
the manufacturer.
For the particular model that I have, I need 5 pins for each side, while leaving one GND pin empty
because I used its area below on the PCB for running some traces. I soldered the Arduino Pro Mini
directly onto the PCB and cut the execs length of the headers. Right next to it goes the MPU6050
accelerometer and gyroscope module.
Then I soldered the 3.3V voltage regulator with a capacitor next to it, and another capacitor near
the NRF24L01 module. This module have three di erent versions and we can use any of them
here.
I continued with the pins for programming the Arduino, the RX and TX pins, the power supply pins
and the power switch.
Next for soldering the potentiometers to the PCB I had to extend their pins using some pin
headers.
We can note here that I previously cut the length of the knobs so I can properly t some caps onto
them. However, we will solder the potentiometers to the PCB a bit later.
Then I inserted and soldered the two toggle switches and the two joysticks in place.
Finally what’s left is to solder the four push buttons. However they don’t have the proper height, so
again I used pin headers to extend their pins a little bit.
And that’s it, our PCB is now ready so we can continue with making the cover for it. Because I like
how the PCB looks and I want to be visible I decided to use transparent acrylic for the cover.
Here I have 4 mm tick transparent acrylic which currently have a protective foil and appears to be
blue. The idea for the cover is to make two plates with the shape of the PCB and secure one of
them at the top side and the other at the bottom side of the PCB.
So I marked PCB shape and using a metal hand saw I cut the acrylic according to it.
Then using a simple rasp I ne-tuned the shape of the acrylic. The two plates came out great and
they perfectly match with the PCB.
Next I marked the locations where I need to make openings for the components to pass through.
Using a 3mm drill I rst made the 4 holes for securing the plates to the PCB. For these holes I also
made counter sinks so that the bolts can be placed ash with the plates.
For the openings for the toggle switches and the potentiometers I used 6mm drill, and for the joy-
stick openings I used 25mm Forstner bit. Again, using a rasp, I ne-tuned all the openings.
Before assembling the cover, just a quite note that I actually soldered the pin header for the power
supply upside down so it can be reached from the back side where the battery will be located.
Ok now we can start with assembling the cover. I started with peeling o the protective foil from
the acrylic which I must admit was quite satisfying because the acrylic was so clean now. So rst I
secured the two potentiometers on the top plate, inserted the 3mm mounting bolts and placed the
11mm distance rings in place.
Then I carefully merged and secured the top plate and the PCB using some bolts. At this point I -
nally soldered the potentiometers to the PCB because earlier I didn’t know exactly at what height
they will be placed.
Next on the back plate I attached the battery holder using 2 bolts. I nished the cover assembly by
securing the back plate to the back side of the PCB using the four mounting bolts.
Finally, we can attach the battery lines to the power supply pins, insert and secure the knobs on the
potentiometers, insert the joysticks knobs and attach the antenna to the NRF24l01 module. And
that’s it, we are nally done with the DIY Arduino RC transmitter.
What’s left now is to program the Arduino. For programming a Pro Mini board we need an USB to
serial UART interface which can be hooked up to the programing header located on the top side of
our controller.
Then in the Arduino IDE tools menu we need to select the Arduino Pro or Pro Mini board, select the
proper version of the processor, select the port and select the programming method to “USBasp”.
And so now we are able to upload the code to the Arduino.
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <Wire.h>
Then we need to de ne a structure where we will store the 14 input values of the controller. The
maximum size of this structure can be 32 bytes because that’s the NRF24L01 bu er limit or the
amount of data the module can send at once.
/ Max size of this struct is 32 bytes - NRF24L01 buffer limit
struct Data_Package {
byte j1PotX;
byte j1PotY;
byte j1Button;
byte j2PotX;
byte j2PotY;
byte j2Button;
byte pot1;
byte pot2;
byte tSwitch1;
byte tSwitch2;
byte button1;
byte button2;
byte button3;
byte button4;
};
In the setup section we need to initialize the MPU6050 module and we can also calculate the IMU
error which is a values that is later used when calculating the correct angles of the module.
void initialize_MPU6050() {
Wire.begin(); // Initialize comunication
Wire.beginTransmission(MPU); // Start communication with MPU6050 // MPU=0x68
Wire.write(0x6B); // Talk to the register 6B
Wire.write(0x00); // Make reset - place a 0 into the 6B register
Wire.endTransmission(true); //end the transmission
// Configure Accelerometer
Wire.beginTransmission(MPU);
Wire.write(0x1C); //Talk to the ACCEL_CONFIG register
Wire.write(0x10); //Set the register bits as 00010000 (+/- 8g full scale range)
Wire.endTransmission(true);
// Configure Gyro
Wire.beginTransmission(MPU);
Wire.write(0x1B); // Talk to the GYRO_CONFIG register (1B hex)
Wire.write(0x10); // Set the register bits as 00010000 (1000dps full scale)
Wire.endTransmission(true);
}
You can nd more details how MEMS accelerometer and gyro work here
(https://howtomechatronics.com/how-it-works/electrical-engineering/mems-accelerometer-
gyrocope-magnetometer-arduino/). A dedicated tutorial for the MPU6050 is coming soon.
Then we need to initialize the radio communication, activate the Arduino internal pull-up resistors
for all digital inputs and set the initial default values for all variables.
// Define the radio communication
radio.begin();
radio.openWritingPipe(address);
radio.setAutoAck(false);
radio.setDataRate(RF24_250KBPS);
radio.setPALevel(RF24_PA_LOW);
In the loop section start by reading the all analog inputs, map their values from 0 to 1023 into byte
values from 0 to 255 because we already de ned the variables in our structure as bytes. Each input
is stored in the particular data variable from the structure.
// Read all analog inputs and map them to one Byte value
data.j1PotX = map(analogRead(A1), 0, 1023, 0, 255); // Convert the analog read value from 0 to
1023 into a BYTE value from 0 to 255
data.j1PotY = map(analogRead(A0), 0, 1023, 0, 255);
data.j2PotX = map(analogRead(A2), 0, 1023, 0, 255);
data.j2PotY = map(analogRead(A3), 0, 1023, 0, 255);
data.pot1 = map(analogRead(A7), 0, 1023, 0, 255);
data.pot2 = map(analogRead(A6), 0, 1023, 0, 255);
We should just note that because we use the pull-up resistors the digital pins readings are 0 when
the buttons are pressed.
// Read all digital inputs
data.j1Button = digitalRead(jB1);
data.j2Button = digitalRead(jB2);
data.tSwitch2 = digitalRead(t2);
data.button1 = digitalRead(b1);
data.button2 = digitalRead(b2);
data.button3 = digitalRead(b3);
data.button4 = digitalRead(b4);
So using the radio.write() function we simple send the values from all 14 channels to the receiver.
In case the toggle switch 1 is switched on, then we use the accelerometer and gyro data instead for
the control.
if (digitalRead(t1) == 0) {
read_IMU(); // Use MPU6050 instead of Joystick 1 for controling left, right, forward and
backward movements
}
So instead of the joystick 1 X and Y values we are using the angle values we are getting from the
IMU, which we previously convert them from values from -90 to +90 degrees into byte values from
0 to 255 appropriately.
// Map the angle values from -90deg to +90 deg into values from 0 to 255, like the values we
are getting from the Joystick
data.j1PotX = map(angleX, -90, +90, 255, 0);
data.j1PotY = map(angleY, -90, +90, 0, 255);
So that’s how the transmitter code, the most important things were de ning the radio communica-
tion and sending the data to the receiver.
Here’s the complete Arduino code for this DIY Arduino RC Transmitter:
/*
DIY Arduino based RC Transmitter
by Dejan Nedelkovski, www.HowToMechatronics.com
Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
*/
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <Wire.h>
void setup() {
Serial.begin(9600);
// Call this function if you need to get the IMU error values for your module
//calculate_IMU_error();
void initialize_MPU6050() {
Wire.begin(); // Initialize comunication
Wire.beginTransmission(MPU); // Start communication with MPU6050 // MPU=0x68
Wire.write(0x6B); // Talk to the register 6B
Wire.write(0x00); // Make reset - place a 0 into the 6B register
Wire.endTransmission(true); //end the transmission
// Configure Accelerometer
Wire.beginTransmission(MPU);
Wire.write(0x1C); //Talk to the ACCEL_CONFIG register
Wire.write(0x10); //Set the register bits as 00010000 (+/- 8g full scale range)
Wire.endTransmission(true);
// Configure Gyro
Wire.beginTransmission(MPU);
Wire.write(0x1B); // Talk to the GYRO_CONFIG register (1B hex)
Wire.write(0x10); // Set the register bits as 00010000 (1000dps full scale)
Wire.endTransmission(true);
}
void calculate_IMU_error() {
// We can call this funtion in the setup section to calculate the accelerometer and gury data
error. From here we will get the error values used in the above equations printed on the
Serial Monitor.
// Note that we should place the IMU flat in order to get the proper values, so that we then
can the correct values
// Read accelerometer values 200 times
while (c < 200) {
Wire.beginTransmission(MPU);
Wire.write(0x3B);
Wire.endTransmission(false);
Wire.requestFrom(MPU, 6, true);
AccX = (Wire.read() << 8 | Wire.read()) / 4096.0 ;
AccY = (Wire.read() << 8 | Wire.read()) / 4096.0 ;
AccZ = (Wire.read() << 8 | Wire.read()) / 4096.0 ;
// Sum all readings
AccErrorX = AccErrorX + ((atan((AccY) / sqrt(pow((AccX), 2) + pow((AccZ), 2))) * 180 / PI));
AccErrorY = AccErrorY + ((atan(-1 * (AccX) / sqrt(pow((AccY), 2) + pow((AccZ), 2))) * 180 /
PI));
c++;
}
//Divide the sum by 200 to get the error value
AccErrorX = AccErrorX / 200;
AccErrorY = AccErrorY / 200;
c = 0;
// Read gyro values 200 times
while (c < 200) {
Wire.beginTransmission(MPU);
Wire.write(0x43);
Wire.endTransmission(false);
Wire.requestFrom(MPU, 4, true);
GyroX = Wire.read() << 8 | Wire.read();
GyroY = Wire.read() << 8 | Wire.read();
// Sum all readings
GyroErrorX = GyroErrorX + (GyroX / 32.8);
GyroErrorY = GyroErrorY + (GyroY / 32.8);
c++;
}
//Divide the sum by 200 to get the error value
GyroErrorX = GyroErrorX / 200;
GyroErrorY = GyroErrorY / 200;
// Print the error values on the Serial Monitor
Serial.print("AccErrorX: ");
Serial.println(AccErrorX);
Serial.print("AccErrorY: ");
Serial.println(AccErrorY);
Serial.print("GyroErrorX: ");
Serial.println(GyroErrorX);
Serial.print("GyroErrorY: ");
Serial.println(GyroErrorY);
}
void read_IMU() {
// === Read acceleromter data === //
Wire.beginTransmission(MPU);
Wire.write(0x3B); // Start with register 0x3B (ACCEL_XOUT_H)
Wire.endTransmission(false);
Wire.requestFrom(MPU, 6, true); // Read 6 registers total, each axis value is stored in 2
registers
//For a range of +-8g, we need to divide the raw values by 4096, according to the datasheet
AccX = (Wire.read() << 8 | Wire.read()) / 4096.0; // X-axis value
AccY = (Wire.read() << 8 | Wire.read()) / 4096.0; // Y-axis value
AccZ = (Wire.read() << 8 | Wire.read()) / 4096.0; // Z-axis value
Receiver Code
Now let’s take a look at how we can receive this data. Here’s a simple Arduino and NRF24L01 re-
ceiver schematic. Of course you can use any other Arduino board.
(https://howtomechatronics.com/wp-content/uploads/2019/01/DIY-Arduino-RC-Transmitter-and-
Receiver.png)
And here’s a simple receiver code where we will receive the data and simply print it on the serial
monitor so that we know that the communication works properly. Again we need to include the
RF24 library and de ne the objects and the structure the same way as in the transmitter code. In
the setup section when de ning the radio communication we need to use the same settings as the
transmitter and set the module as receiver using the radio.startListening() function.
/*
DIY Arduino based RC Transmitter Project
== Receiver Code ==
void resetData() {
// Reset the values when there is no radio connection - Set initial default values
data.j1PotX = 127;
data.j1PotY = 127;
data.j2PotX = 127;
data.j2PotY = 127;
data.j1Button = 1;
data.j2Button = 1;
data.pot1 = 1;
data.pot2 = 1;
data.tSwitch1 = 1;
data.tSwitch2 = 1;
data.button1 = 1;
data.button2 = 1;
data.button3 = 1;
data.button4 = 1;
}
In the main loop using the available() function we check whether there is an incoming data. If true
we simply read the data and store it into the variables of the structure. Now we can print the data
on the serial monitor to check whether the transmission work properly. Also using the millis() func-
tion and an if statement we check whether we keep receiving data, or if we don’t receive data for a
period longer than 1 second, then we reset variables to their default values. We use this to prevent
unwanted behavior, for example if a drone has a throttle up and we lose connection it can keep y-
ing away unless we reset the values.
So that’s it. Now we can implement this method of receiving the data for any Arduino project. For
example here the code for controlling the Arduino robot car from one of my previous videos.
DOWNLOAD
Here we need to de ne the libraries, the structure and the radio communication as explained
earlier. Then in the main loop we just need read the incoming data and use any of it for whatever
we want. In this case I use the joystick 1 values for driving the car.
DOWNLOAD
Lastly, let’s take a look how can this transmitter be used for controlling commercial RC devices.
Usually for these devices we need to control their servos or brushless motors. So after receiving
the data from the transmitter, for controlling servo we simply use the Arduino Servo library
(https://www.arduino.cc/en/Reference/Servo) and use values from 0 to 180 degrees. For controlling
brushless motor using ESC, we can again use the servo library for generating the 50Hz PWM signal
used for controlling the ESC. By varying the duty cycle from 1000 to 2000 microseconds we control
the RPM of the motor from zero to maximum. However, more on controlling brushless motors us-
ing ESC in my next tutorial.
Please note that we actually cannot bind the standard RC receiver system with this NRF24L01
2.4GHz system. Instead, we need to modify or create our own receiver consisting of an Arduino and
NRF24L01 Module. From there we can than generate the appropriate PWM or PPM signals for con-
trolling the RC device.
(https://howtomechatronics.com/wp-content/uploads/2019/01/DIY-Arduino-RC-Transmitter-and-
Receiver-controlling-commercial-RC-devices.png)
/*
DIY Arduino based RC Transmitter Project
== Receiver Code - ESC and Servo Control ==
void setup() {
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, address);
radio.setAutoAck(false);
radio.setDataRate(RF24_250KBPS);
radio.setPALevel(RF24_PA_LOW);
radio.startListening(); // Set the module as receiver
resetData();
esc.attach(9);
servo1.attach(3);
servo2.attach(4);
}
void loop() {
// Check whether we keep receving data, or we have a connection between the two modules
currentTime = millis();
if ( currentTime - lastReceiveTime > 1000 ) { // If current time is more then 1 second since we
have recived the last data, that means we have lost connection
resetData(); // If connection is lost, reset the data. It prevents unwanted behavior, for
example if a drone jas a throttle up, if we lose connection it can keep flying away if we dont
reset the function
}
// Check whether there is data to be received
if (radio.available()) {
radio.read(&data, sizeof(Data_Package)); // Read the whole data and store it into the 'data'
structure
lastReceiveTime = millis(); // At this moment we have received the data
}
// Controlling servos
servo1Value = map(data.j2PotX, 0, 255, 0, 180);
servo2Value = map(data.j2PotY, 0, 255, 0, 180);
servo1.write(servo1Value);
servo2.write(servo2Value);
// Controlling brushless motor with ESC
escValue = map(data.pot1, 0, 255, 1000, 2000); // Map the receiving value form 0 to 255 to 0
1000 to 2000, values used for controlling ESCs
esc.writeMicroseconds(escValue); // Send the PWM control singal to the ESC
}
void resetData() {
// Reset the values when there is no radio connection - Set initial default values
data.j1PotX = 127;
data.j1PotY = 127;
data.j2PotX = 127;
data.j2PotY = 127;
data.j1Button = 1;
data.j2Button = 1;
data.pot1 = 1;
data.pot2 = 1;
data.tSwitch1 = 1;
data.tSwitch2 = 1;
data.button1 = 1;
data.button2 = 1;
data.button3 = 1;
data.button4 = 1;
}
So that’s it. I hope you enjoyed this video and learned something new. Feel free to ask any question
in the comments section below and check my Arduino Projects Collection
(https://howtomechatronics.com/arduino-projects/).
JLCPCB – Prototype PCBs for $2 (For Any Color) & 24-Hour Lead Time
(https://jlcpcb.com)
China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
(https://jlcpcb.com)
See Why JLCPCB Is So Popular: https://jlcpcb.com (https://www.youtube.com/watch?v=_XCznQFV-
Mw)
Arduino (https://howtomechatronics.com/tag/arduino/)
NRF24L01 (https://howtomechatronics.com/tag/nrf24l01/)
RC Transmitter (https://howtomechatronics.com/tag/rc-transmitter/)
Wireless (https://howtomechatronics.com/tag/wireless/)
SHARE ON:
(//pinterest.com/pin/create/button/?
url=https%3A%2F%2Fhowtomechatronics.com%2Fprojects%2Fdiy-arduino-rc-
transmitter%2F&media=https%3A%2F%2Fhowtomechatronics.com%2Fwp-
content%2Fuploads%2F2019%2F01%2FDIY-Arduino-based-RC-
Transmitter.jpg&description=DIY+Arduino+RC+Transmitter)
Tweet (https://twitter.com/share)
R E L AT E D P O S T S
DIY MOTORIZED CAMERA SLIDER WITH PAN AND TILT HEAD – ARDUINO BASED PROJECT
(HTTPS://HOWTOMECHATRONICS.COM/TUTORIALS/ARDUINO/DIY-MOTORIZED-CAMERA-SLIDER-PAN-TILT-HEAD-
PROJECT/)
Dejan (https://howtomechatronics.com/author/howtom12_wp/)
105 (https://howtomechatronics.com/tutorials/arduino/diy-motorized-camera-slider-pan-tilt-head-
(https://howtomechatronics.com/tutorials/arduino/diy-motorized-camera-slider-pan-tilt-head-
project/#comments)
project/)
ARDUINO RADAR PROJECT (HTTPS://HOWTOMECHATRONICS.COM/PROJECTS/ARDUINO-RADAR-PROJECT/)
Dejan (https://howtomechatronics.com/author/howtom12_wp/)
355 (https://howtomechatronics.com/projects/arduino-radar-project/#comments)
(https://howtomechatronics.com/projects/arduino-radar-project/)
Dejan (https://howtomechatronics.com/author/howtom12_wp/)
92 (https://howtomechatronics.com/projects/arduino-color-sor ter-project/#comments)
(https://howtomechatronics.com/projects/arduino-color-sorter-project/)
MECHATRONICS FINAL YEAR PROJECT (HTTPS://HOWTOMECHATRONICS.COM/PROJECTS/MECHATRONICS-FINAL-YEAR-
PROJECT/)
Dejan (https://howtomechatronics.com/author/howtom12_wp/)
54 (https://howtomechatronics.com/projects/mechatronics-final-year-project/#comments)
(https://howtomechatronics.com/projects/mechatronics- nal-year-project/)
74 RESPONSES
radio.setPALevel(RF24_PA_LOW);
Can I set this to HIGH or MAX to extended range ?
REPLY
Yes, you can do that. But of course, the module will consume more power that way.
REPLY
Hello again:)
I’m not a programmer or electronic engineer. I hope this is not a silly question. Wouldn’t we
use both “NRF24L01 + PA + LNA” instead of using “NRF24L01” with more/high power on tx
side? Doesn’t the coverage of the at logic be doubled? or more strong/stable?
Well yes, it’s possible. The Arduino I2C bus can be used by multiple devices at the same
time, the MPU6050 module is currently using but still you should be able to use the OLED
display as well.
This is awesome! Do you have any schematic for the Receiver? I’m mainly interested in a general
ESC and Servo setup.
Going based on this…
esc.attach(9);
servo1.attach(3);
servo2.attach(4);
Does 9, 3 and 4 refer to Digital Pins D9, D3 and D4? D9 should be pin 13 on the Atmega328 chip,
D3 = pin1 and D4 = pin2. Correct?
REPLY
Thank you! Yes that’s correct, 9, 3 and 4 refer to the digital pins, of course they can be any
other digital pins. I updated the article with a schematic for the receiver, check it out. Also I
would recommend to check my other detailed tutorial for the NRF24L01 module and the
Arduino.
REPLY
REPLY
Dejan (https://howtomechatronics.com) January 16, 2019
(https://howtomechatronics.com/projects/diy-arduino-rc-transmitter/#comment-5271)
Hey Tony, we actually cannot bind the two systems, but you will have to make a receiver for
the RC car consisting of an Arduino and NRF24L01 module. Then you just have to generate
the standard 50Hz PWM signal that controls the servo motors for example or a brushless
motor, as explained in the last example. Sure, you can drive brushed motors, for example like
I did on the second example, controlling two brushed DC motors using the L298N for driving
the robot car. Sorry but I didn’t have a standard RC car so I could demonstrate this method,
but it should work.
REPLY
Looks nice. I’ve been going in the direction of using the ESP8266 and MQTT protocal for my
home wireless and network projects. Your Arduino wireless game/everything controller, with
just a ESP8266 module replacing the RF module you’re using, looks perfect for my projects too.
Thanks for the explosion of ideas your project has had on me 🙂
REPLY
Hi – this is exactly what i was looking for. Can you help me this question please?
REPLY
REPLY
Hello.
REPLY
Hey, thanks for the remarks. I’ve just updated the article with the 3 pins toggle switch and also
added links to Joystick modules without PCBs. Yes, you are right, in case you have the ones
with PCB you will have to desolder them, and I did so. It’s a bit harder to nd those without
PCB.
REPLY
Wow. This is exactly what i was looking for and it ew just into my website visiting.
Great Tutorial. Great details. And funky looking.
So now i will have to weigh my options between a 4 ch rc transmitter and receiver pair from
china or this totally funky looking more expensive one, but for me better understable one here,
to control and old rc car.
REPLY
Vdm January 18, 2019 (https://howtomechatronics.com/projects/diy-arduino-rc-
transmitter/#comment-5304)
Great project! Thanks for sharing! Can I change MPU50060 to the 0.96″ OLED?
Of course, I have to change sketch, but, as I can see, MPU have same point for connection with
arduino
REPLY
Thanks. Well the MPU6050 uses I2C communication, so you can probably do that if the 0.96″
OLED uses the same I2C communication.
REPLY
Will it work with both the link for the arduino pro mini you paste ?
Thank you
REPLY
REPLY
Szafran January 22, 2019 (https://howtomechatronics.com/projects/diy-arduino-rc-
transmitter/#comment-5341)
REPLY
REPLY
Hi, this is awesome project. We will use it for our uav prototipies. But we have some problems.
First we cant nd ht7333 🙁 What can we solve that?
And the other problem is as i see you use 2 capacitors. What are they?
We are living in Turkey and we cant nd everything here. If you can help us we will be really
happy 🙂
Thanx from now..
REPLY
Dejan (https://howtomechatronics.com) February 4, 2019
(https://howtomechatronics.com/projects/diy-arduino-rc-transmitter/#comment-5468)
Hey, thanks! Well you can use di erent 3.3V voltage regulator, for example the AMS1117. The
capacitors are used for stabilizing the input voltage for the NRF24L01 module, they can be
anything from 1uF to 100uF.
REPLY
REPLY
hi im trying to change the arduino you used to the sparkfun pro mini 5v but it doesn’t have the
dtr pin for auto reset function will this cause any problems ?
REPLY
Well it should’t be a problem as long as you have the right FTDI Basic Breakout board to up-
load the sketch to the Arduino. Other than that, if everything wired as properly it should all
work ne.
REPLY
REPLY
REPLY
First of all thank you for making such an interesting thing and may god bless you to make more
in future.I also don’t have much knowledge about electronics so my question might be silly.Can i
use the arduino board as you have given in the link.The arduino which you’ve given in the link is
not same as in the video.won’t there be any problem in using that board.And if yes do we need
to left the pin as it is without soldering.Thank you.
REPLY
Dejan (https://howtomechatronics.com) February 23, 2019
(https://howtomechatronics.com/projects/diy-arduino-rc-transmitter/#comment-5676)
Thank you! Well you can notice that there are two links to the Arduino, the one from Ebay is
exactly the same as I used in the project.
REPLY
Hi there,, Thank you for sharing your tutorials to us, specially to newbies on electronics like me
🙂
im just wondering,, your tact switch doen’st have resistors on it,, is it okay to design without it? or
i have to put resistors on other side of tact switches? and if ever what values do i have to put? 1k
ohms?
and another thing can i add a slide switch for the connection of tx0 and dxi for easy dosconnect-
ing the buttons 🙂
once again thank you very much sir 🙂
REPLY
Well I didn’t include any resistor for the switches because I’m using the internal pull-up resis-
tors of the Arduino pins. You can see that in the code, when de ning the pin modes. As for
the tx0 and dxi pins, yeah, you could probably make such a modi cation.
REPLY
Roy March 2, 2019 (https://howtomechatronics.com/projects/diy-arduino-rc-
transmitter/#comment-5767)
Really great job. Thank you!! You teach me a lot of wireless connection.
Hope one day I will y a arduino drone without another receiver through this controller.
REPLY
Why at your circuid diogram has 2 decoupling capacitors? (one near NRF24, and second near
HT7333)
REPLY
One is for the NRF24 module, and the other is for the HT7333 module. They both need a de-
coupling capacitors to work properly.
REPLY
Davor Levstek March 13, 2019 (https://howtomechatronics.com/projects/diy-arduino-rc-
transmitter/#comment-5869)
Hello Dejan,
I already tried leaving you a comment few times but it doesn’t show so ill try once again.
Great job, I’m in the process of making one transmitter and few receivers but with few modi ca-
tions (not using arduino board, just atmega328 IC for TX and atmega88 for RX).
I see you used jumpers on TX and RX for programming, but I’m not sure why, lines are not con-
nected to anything until you push the button, so jumpers are not really necessary, it won’t inter-
fere with anything. Or did I get something wrong?
Also I was wondering, is it possible to make some kind of auto bind function? For example, when
I turn on the transmitter, it binds to rst receiver it nds and ignores all the others? Receivers
should have unique addresses and transmitter when turned on should connect to the rst one,
get his address and then only talk to that one and ignore the others. I tried something, but not
sure where to start. Maybe have the same address for all on start in the setup, then connect to
rst receiver, get his unique ID and change it to that?
REPLY
Hey Davor,
My point with the jumpers was that, if you use a jumper, connect the line, you would be able
to use the Joystick push button which are connected to digital pin 0 and 1. These pins are also
the RX and TX pins, and when uploading a sketch to the Arduino, these two pins must be dis-
connected from anything, otherwise the sketch might fail to be uploaded to the Arduino.
As for you second question, I haven’t experiment with such examples so I couldn’t help you
much.
REPLY
Stephan April 8, 2019 (https://howtomechatronics.com/projects/diy-arduino-rc-
transmitter/#comment-6137)
Hi Dejan,
your tutorial is really great and i was able to build a transmitter and reciever based on this.
But now i encountered the problem that when i use the reciever with an esc, the system seems
to snap from time to time and putting the minmal values for any servo or esc connected.
Have you encountered a similar behavior?
I am quite puzzled about that.
REPLY
REPLY
Dear sir
Can I use Arduino nano v3 In place of pro mini
What is the pin Txo and RxI in arduino nano
Can I use same transmitter code without Mpu5060
Please help me sir
Thanking you
REPLY
Hey, yes, you could use Nano and drop the MPU6050 as well.
REPLY
This is a Great, Great project!!! Thank you very much for sharing it! I’m trying to make it. I or-
dered all the stu from the a liated links, and I got the pcb’s already. It’s a great remote control,
fully programmable, I’m looking forward for having it done. Thank You very much for sharing it
with us!
REPLY
REPLY
REPLY
Hey, you could use an Arduino Nano, if you connect everything the same, the code would also
be the same. However, in this PCB design you can’t use Nano because it has a di erent foot-
print compared to the Pro Mini.
REPLY
Is it possible to know the value of the two electrolytic capacitors used in this project?
Thank you
REPLY
REPLY