loading

Are you looking to make your own quadcopter drone or RC car with Arduino but don't know where to start? Perhaps you already bought some 433MHz RF modules only to find out they weren't as simple to use as you thought? Try this out!

You'll learn to wire a simple proportional control transmitter and receiver with button trimmers and send the signal over a UDP-like setup. The code can handle as many channels as you'd like to use (in practice you'll probably use 4 channels for THROTTLE, YAW, PITCH, and RUDDER) but in this example I'll demonstrate a 1 channel setup and display the data on the Serial Window to give you the basic idea of how it works. This is intended as a learning tool to get you started into the world of wireless transmission.

Here's what you need:

  • 2 x Arduino UNO + USB cables
  • 2 x computers available to plug your transmitter and receiver Arduinos
  • 2 x mini prototyping breadboards
  • 1 x 10K potentiometer (per channel)
  • 2 x push-buttons (per channel)
  • 3 x 1k resistors (per channel)
  • 1 x 433MHz transmitter + receiver modules (315MHz might work also)
  • male-to-male jumper cables
  • short breadboard wires

NOTE: You might be able to use other models of Arduino, but you have to check for compatibility with the libraries that we're going to download and use in step 2. Also, you can use less ohmage if you like just be careful not to draw more than 40mA per output pin or sink more than 200mA per ground pin; and to be safe I wouldn't draw more than 200mA from the 5V pin on the Arduinos.

Step 1: Wire Up the Circuit As Shown in the Image:

For your own learning:

  • the buttons are connected to pull-down resistors (pulled to ground), this guarantees that their digital readings will be 0V when the buttons aren't pressed instead of floating.
  • the potentiometer and the first 1kΩ resistor form a voltage divider. The 1kΩ is necessary to prevent a short from 5V to ground when the potentiometer reaches 0Ω.

***NOTE: all red cables are VCC (+5V) and black cables are GND, check carefully when wiring up your transmitter / receiver modules. Also for the receiver module, both DATA pins give the same signal so pick any.***

Step 2: Download Appropriate Arduino Library

I've written two versions of the transmitter / receiver code:

You can learn more about the libraries and how they work by reading the details in their header (.h) files. Simply put, they contain special functions which handle all the sophisticated firmware, registers, connection setup etc. VirtualWire can only do UDP whereas RadioHead can do UDP and other more reliable types of wireless transmissions. These libraries don't come standard with the Arduino IDE, so you'll need to install them. The instructions are here if you haven't installed new libraries before: https://www.arduino.cc/en/Guide/Libraries.

Step 3: Download Transmitter and Receiver Codes and Upload to Arduino

You only need one pair of transmitter / receiver code, either RadioHead or VirtualWire. Pick whichever you like, feel free to experiment with both. Althougth RadioHead is newer, I seem to be getting slightly better results with VirtualWire, but that can probably be fixed with more testing. Once the codes are opened in the Arduino IDE, make sure to select the appropriate COM port which the UNO is connected to, click upload and then open the Serial Windows to display readings.

Step 4: Experiment

On the left hand window we have the transmitter stats:

  • channel ID: a simple character to distinguish it from other channels, 'A' in this case. So if you had throttle, rudder, pitch and yaw each of those would be designated a letter from A to D so the receiver arduino can know which motor or servo to control with a given received signal.
  • joystick reading: the raw potentiometer reading, a 10-bit number by default from the arduino ADC
  • trimmer: offset based on how many button presses you've made
  • overall position: the sum of joystick and trimmer and is between 0 and 1023 (only the ID and position needs to be sent).

On the right hand window we display the data we receive: the channel ID and the position reading for that channel.

Notice how more data gets sent than is received: that's to be expected of a UDP-like connection which is simple to use but somewhat unreliable (i.e. some data is lost in transmission). In a future instructable I hope to show you a more reliable method of transmitting data than UDP but for now this will do.

You can increase the number of channels by simply changing the value POT_NUM in the #define section of the code and adding in new potPin[ ] and buttonPin[ ][ ] values for the extra channels in the setup section; then it takes care of everything else.

Remember this is intended as a learning tool, personally I'm hoping to build on it to make a 4 channel quadcopter shortly. If you make improvements on the code or circuit design I'd love to hear how you went with it and what you made out of it in the comments below. It's fine if you publish your improvements based on this work but please give credit where it is due. If you are looking to 3D print a case for your controller and / or a chassis for your model, here are some 3D printing services:

https://www.3dhubs.com/

http://www.shapeways.com/

If you found this instructable useful, why not stay tuned for future projects by following me on Instructables and on Facebook / Twitter:

https://www.facebook.com/HobbyTransform

https://twitter.com/HobbyTransform

Your support is greatly appreciated!

Happy DIY'ing!

<p>Hello, very good job. I'm also fond of rc models but they are starting out with Arduino ...</p><p>I would like to build a remote control four Canarian as you suggested, but are not able to edit your code ... you could publish your changes?</p><p>Thank you</p>
<p>Hi, you mean the code for a quadcopter? I don't have one yet, but I will be writing it soon, I've just been in the process of gathering all the parts I need for the quadcopter. So stay tuned as I am planning to post an instructable on making an arduino quadcopter soon.</p>
<p>sir, did u write the code for quadcopter using arduino? </p>
<p>I've started writing the code ages ago. The main issue that's was delaying me was hardware related, but it's been sorted now. I'll be posting an instructable when it's complete. Stay tuned.</p>
<p>Thanks for the answer, I will follow with interest, see you soon</p><p>Federico</p>
<p>Hi, I am just wondering about running multiple channels and the capabilities of the code for this. What can be sent across a single channel and do I need more than one transmitter/receiver pair for extra channels? Also, what exactly are the trimmer buttons for? I'm currently working on an RC car and making my own controller with potentiometers for steering and throttle on the car, and I am new to radio control. Thanks!</p>
<p>Hi! I want to know how can i make a very light chip or mic or anything that u know better send a simple wave signal to my laptop. I want to put it in a box so whenever it is touched or moved the signal is sent to my laptop. It should be very light and small.</p><p>It would mean a lot to me if you can help me in this </p>
<p>Hi, if you want to communicate with your laptop there are several options even besides this 433MHz module. For example, you can communicate via bluetooth (e.g. using the HC-05 module, <a href="https://www.instructables.com/id/Arduino-AND-Bluetooth-HC-05-Connecting-easily/" rel="nofollow">here</a> is a good starting point) or via WiFi (e.g. using the ESP8266, the version 3 module is probably best but I'll have to test it when I get the chance).</p>
<p>Hey Boss.. Good tutorial. Have you got around to making that quad copter yet? I would like find a tutorial on a quad copter made with brushed motors and homemade flight controller and receiver. I got tons of DC brushed motors from cheap china made helicopters that broke on me but can't find any tutorial that uses brushed motors or you need to but a controller for it. Anyway looking forward to seeing what you come up with.</p>
<p>Hey Joe, sorry not yet. I've been busy at uni this past semester, but I've been learning there about transistors, like MOSFETS, which will come in handy because I'm planning to make a very small brushed motor controller board with SI2302 MOSFETS to control 4 x 3.7V DC motors for the quad. This project will be my biggest yet because it'll be my first one with transistors and designing/ordering custom-made PCB's online. Then I'm going to work out how to fit that with an MPU6050 gyro and a RF receiver for the quad. Hang in there :)</p>
That would be awesome if you can make it happen. You will be the first if you do. I have the MPU6050 4 DC motors and RF receivers all on standby and Mosfets are usually cheap. But I hear it is hard to make quad copters out of DC Brushed Motors. I just don't have the money at this time to buy 4 brushless Motors plus 4 ESC or ECS and then the brain Flight controller plus a receiver that works for it. I mean at that point I might as well just buy a Brand new Quad Copter Drone already built you know. Anyway I look forward to seeing that project someday good luck with it.
<p>hi i`m looking for store where can i buy this 433Mhz transmitter and receiver<br>:)<br>hoping you can give me some.<br>i`m from Philippines Working on my <br>Design Project :) </p>
<p>frank, pls open link.... seller from CEBU.... https://www.mybenta.com/philippines/242/Electronics/ad/88822/433Mhz-RF-TxRX-Transmitter-and-receiver-link-kit-for-ArduinoARMMCU-remot.html</p>
<p>frank, pls open link... seller is from CEBU... https://www.mybenta.com/philippines/242/Electronics/ad/88822/433Mhz-RF-TxRX-Transmitter-and-receiver-link-kit-for-ArduinoARMMCU-remot.html</p>
check this link <br>http://www.ebay.com/itm/433Mhz-RF-transmitter-and-receiver-link-kit-for-Arduino-ARM-MCU-WL-/140719918135?hash=item20c38f8c37
<p>Hi Frank,</p><p>You should be able to get it on eBay. At this point, I do have some rf modules that I'm hoping to sell, but I'm still setting up my online store. It should be up online hopefully in the next few days. So depending on how quickly you need the rf modules, it may be better for you to buy it on eBay.</p>
<p>For those looking to make a drone, your next step would be to get a MEMS gyro. If this is your first time with gyros, check out my new instructable here: https://www.instructables.com/id/MPU6050-Arduino-6-Axis-Accelerometer-Gyro-GY-521-B/</p>
Hello, i wanted to ask, is it possible to create a alarm system for children using rf transmitter and receiver? For example, if receiver and transmitter are 5 meter aparts, it will triger the led, if its 7 meter, it will trigger the buzzer.. Im wondering if i can do this project
<p>Hello,</p><p>So if I understand correctly, you'd like something that can measure the distance between 2 points and behave differently based on the distance? In that case your best bet might be to have a pair of ultrasonic or LED transmitter / receiver that can track the time interval (which is the most important thing to measure in your design) between sending and receiving the signal, from then you can work out the distance because the speed of sound or light are already known. Regardless of which design you pick, the timers on the transmitter and receiver should be synchronized so you get the right time interval. You might be able to do it somehow with these simple rf transmitters / receivers but if you're talking about something as important as child safety I would use something more reliable than UDP connection (because some data can be lost during transmission). Have a look around online, someone's probably done such a project. I'd like to hear what you find :)</p>
<p>Thank you for the clarification.</p><p>I would like to share that, in the beginning, with my project ,and my own primitive code :-), I had problems because I was trying to use pin 9 to control a motor but as as VirtualWire uses Timer1 of ArduinoUNO, it caused Arduino to hang.</p><p>As VW uses Timer1 pin 9 and 10 loose their PWM capability and as the compiler does not give any warning it is good to know it or trying to make things work may result in a big head scratcher :-)</p><p>Also controlling servos requires the ServoTimer2 library.</p><p>Just trying to make life easy to other newbies :-)</p><p>Looking forward to see your quadcopter project based on RF links :-)</p>
<p>Hello, nice Instructable, very interesting.</p><p>Could you explain this please:</p><p>int buttonPin[POT_NUM][2];</p><p>I was trying to understand the code that you shared and as I am not very good at programming I cannot understand that line of code, I mean that [ ] should represent an array correct? but in this case they are double [ ] [ ], which structure is it?, where can I find explanation?</p><p>Btw happy 2016 ;-)</p>
<p>Happy 2016 to you too :D ! And yeah what Don said.</p>
<p>It denotes a two dimensional array.<br>Think of it like a spreadsheet with an x an y axis</p>
or even to recevie fm radio? is that possible?
<p>The receiver is 433MHz, which is beyond the FM frequency range. As for making a spy bug, what kind do you mean?</p>
how do i use the transmitter to make spy bug<br>
<p>Hey guys make sure you clearly understand the code before modifying the number of channels. When adding more channels, you need to change POT_NUM as well as define the new pins to support that channel, for example a 2 channel setup might have:</p><p>#define POT_NUM 2</p><p>and</p><p>potPin[0] = A0; // Channel 1 potentiometer on analog A0</p><p> buttonPin[0][0] = 2; // Channel 1 push-button 1 on pin 2</p><p> buttonPin[0][1] = 3; // Channel 1 push-button 2 on pin 3</p><p> potPin[1] = A1; // Channel 2 potentiometer on analog A1</p><p> buttonPin[1][0] = 4; // Channel 2 push-button 1 on pin 4</p><p> buttonPin[1][1] = 5; // Channel 2 push-button 2 on pin 5</p><p>Hopefully that makes sense.</p>
<p>thanks for posting this Ian just getting into arduino so this will help</p><p>thanks</p>
<p>No worries! Glad I could help. The code should work straight up with no changes, but you'll get the most learning out of this especially if you go through the code to understand how it works and then experiment.</p><p>Andrew</p>

About This Instructable

15,640views

234favorites

License:

More by HobbyTransform:Arduino OLED 128X64 IIC Serial Display: printing text and moving images MPU6050: Arduino 6 Axis Accelerometer + Gyro - GY 521 Test & 3D Simulation RC Multi Channel Arduino Proportional Transmitter / Receiver with Button Trimmers 
Add instructable to: