Introduction: RC Multi Channel Arduino Proportional Transmitter / Receiver With Button Trimmers
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.
What you need can be found on eBay (links below):
- 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:
- one for the current RadioHead library (download library from here: http://www.airspayce.com/mikem/arduino/RadioHead/)
- one for the VirtualWire Library (which has been superceded by RadioHead but you can use if you like: http://www.icstation.com/ebay/IC/All%20data%20modu...)
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:
If you found this instructable useful, why not stay tuned for future projects by following me on Instructables and on Facebook / Twitter / Google+.
If you enjoyed this instructable and would like to see more like this, please consider supporting me by purchasing your materials for this project through the affiliate links in the materials section or donating below:
PayPal: https://www.paypal.me/HobbyTransform
Bitcoin: 1Mqe7et24Lz4DY1RUN4iAQVHkvJsdFArKR
Ethereum: 0x6d8248db1cdea6a783cb6b41ae67bb8e6144f479
Litecoin: LW6PWESqsr8xHw6EJ9WLbsQsAyTvPnwnxJ
Dash: Xemv7jud697v8tQmKfNFoMxfkd17ZayH2t
Your support is greatly appreciated! Happy DIY'ing!
30 Comments
4 years ago
try to test it, didn't get anything from receiver, don't know why?
6 years ago
Hello, very good job. I'm also fond of rc models but they are starting out with Arduino ...
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?
Thank you
Reply 6 years ago
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.
Reply 6 years ago
sir, did u write the code for quadcopter using arduino?
Reply 6 years ago
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.
Reply 6 years ago
Thanks for the answer, I will follow with interest, see you soon
Federico
6 years ago
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!
6 years ago
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.
It would mean a lot to me if you can help me in this
Reply 6 years ago
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, here 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).
6 years ago
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.
Reply 6 years ago
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 :)
Reply 6 years ago
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.
7 years ago
hi i`m looking for store where can i buy this 433Mhz transmitter and receiver
:)
hoping you can give me some.
i`m from Philippines Working on my
Design Project :)
Reply 7 years ago
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
Reply 7 years ago
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
Reply 7 years ago
check this link
http://www.ebay.com/itm/433Mhz-RF-transmitter-and-receiver-link-kit-for-Arduino-ARM-MCU-WL-/140719918135?hash=item20c38f8c37
Reply 7 years ago
Hi Frank,
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.
7 years ago
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/
7 years ago
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
Reply 7 years ago
Hello,
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 :)