loading

Does anyone know if you can get an RC reciever to work with an Arduino?

I need to know if I can get my reciever to work with an arduino. Wondering if I can do something like plugging in the reciever and then monitoring the voltage from the pins that go to the servos (if voltage is above 2.5, turn on LED, or something along those lines). However, I don't know how the signal pin would work, but it would have to in order to get the right direction and stuff. Do you need a special shield for this? I have an Arduino Mega and a Spektrum AR 6100.

sort by: active | newest | oldest
maewert6 years ago
Since servos work off of pulses, you *could* measure the pulse durations but this becomes difficult to do for multiple servos. I'm thinking that another approach could be to feed the servo control into a RC circuit and then measure the voltage of the capacitor using one of the arduino's analog input pins instead. Might not be *too* accurate or responsive but could handle multiple signals simulatenously.
Best Wishes

I thought of that, but the problem is the low mark/space ratio. With good smoothing (i.e, a high RC which would result in very slow response) and a 5V supply you'd be measuring 0.5V at one end of joystick travel and 1.0V at the other.
Reduce the smoothing to increase the response speed and the voltage would decay between pulses, resulting in inconsistent and inaccurate measurements.
You could use a sample and hold arrangement, but you'd be greatly increasing the complexity.
Thanks AndyGadget.
1 to 2 ms out of 20 is indeed a very bad mark/space ratio.  I suppose if one needed to monitor multiple servos one could use the Arduino's pulseIn function to take measurements of each input one at a time.  Of course the pulseIn will take from 1 ms to 22+ ms to execute, and this could have to be taken into account if timing is critical which could complicate the code.  If you're doing simple monitoring and don't care about timing, pulseIn is probably the way to go.

Best Wishes
Yep, it's a tricky one. The AR6100 has 6 channels so polling all would take quite a while. However, the OP is only asking about controlling one LED and I suspect his plans are quite modest so monitoring one or 2 channels would definitely be a start.
The best answer is probably a direct digital measurement of pulse -width, but the arduino code doesn't make best use of the AVRs timer facilities, and its tricky to do. Maewerts has the solution I'd try - pump the PWM signal onto a capacitor and measure the voltage using the ADCs. Its noisier though.

Steve
AndyGadget6 years ago
 
Measuring voltage from a servo output wouldn't get you very far - Have a look at THIS page which shows you to drive a servo you need a pulse of 1 to 2 milliseconds in a 20mS frame - The actual pulse width sets the servo position e.g. 1.5mS is usually the mid position.
What you need to do is to monitor the outputs from the receiver, trigger a count on the rising edge of the pulse and stop the count on the falling edge. The count would be proportional to the pulse width.
I know next to nothing about Arduinos, but I'm sure there's a pulse-measurement library available you could use for this.
orksecurity6 years ago
Yes, something of that sort (using the Arduino's analog inputs) ought to be possible.