RC Hobby Controllers and Arduino

Started by SK1701, November 24, 2014, 12:53:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SK1701

I found this great tutorial on the SparkFun website that shows how to interface your radio with an Arduino. As stated on the website, the output from the receiver is just a PWM (pulse width modulation) signal. The Arduino sketch given on the website uses the Arduino pins as input, decodes the PWM signal, and displays the stick x and y co-ordinates as well as switch position in the serial monitor. I just tried this out and it works great, it can be used to add an RC feature to just about any Arduino projects. I just need to buy myself a motor driver and I am going to build an Arduino robot. Anyway, to try this out you will need:
1. An Arduino/ clone (I used the genuine Arduino Uno R3) along with its USB A-B cable
2. Tx and Rx of your choice
3. Male to female jumper wires

Hook up the signal pins from your receiver to the Arduino pins 5,6 and 7 (if you are using the same sketch as me). The connections may not be the same for you, so just to clarify: pin 7 -> aileron, pin 6 -> elevator, pin 5 -> whichever channel has a two position switch on your transmitter. Power your receiver by connecting the + and - pins of the BATT channel to the 5V and GND pins of the Arduino respectively. Upload the second sketch on this page: https://www.sparkfun.com/tutorials/348 and open the serial monitor. Watch the output change as you move the right stick and flip the 2 position switch. The uses of this technique are limited only by your imagination (and your access to parts/ programming skills  ;D).

DISCLAIMER: I am not responsible for any damage you cause.

All credit goes to SparkFun Electronics, just posting my experience following their instructions.

Cycloned

Is there any way to connect servos to this? They don't fit on the motor driver because the leads are too big. They also don't fit on the receiver because 1 of the 3 lead spots is connected to the arduino.

SK1701

I am not sure exactly what you are trying to ask. You could connect the servos to the receiver alone or to the Arduino while it is connected to the Receiver (this is more complicated, I don't see as to why you would need to to do this). Why would you want to connect the servos to the Arduino and receiver together? You don't generally need a motor driver to drive the servos, a PWM pin is enough along with the Servo library.

akhilzid

and the method(pulseIn) in this tutorial will not accurately work with servo library.

you need to use attachinterrupt() method for better accuracy.