1
\$\begingroup\$

I have a quadcopter (Syma X5C) that I really want to control with an Arduino. Since I have the ability to write programs to my Arduino to make the quadcopter fly autonomously, I want to modify my "hack" my quadcopter remote to allow the Arduino to be interfaced with it.

After opening up my quadcopter remote, I figured that the fastest way for me to programatically fly my quadcopter is to desolder and remove the existing two joysticks and replace them with digital potentiometers which will be controlled by the Arduino.

I almost thought I could do this, however, most digital potentiometers only use the SPI protocol to talk to the Arduino. If I need to control the 4 axes of the two joysticks, I would need more than one SPI digital potentiometers. Also, I am not sure my Arduino would work with more than one SPI module. I was trying to look for an I2C potentiometer, but I was not able to find any cheap ones available.

Is there a way I can control my quadcopter remote without the need to use a digital potentiometer? Please give me detailed suggestions, preferably with a diagram.

\$\endgroup\$
2
  • \$\begingroup\$ I commend you for not walking into that X-Y problem. Although in this case it turns out that Y is the correct problem to solve. \$\endgroup\$ Jul 24, 2014 at 5:43
  • 1
    \$\begingroup\$ The protocols of many of these toys have been reverse engineered; if that is the case for this one, then you could probably control it directly by attaching the appropriate 2.4 GHz radio module to your Arduino rather than modifying the original transmitter at all. At least it's worth researching if anyone has figured this one out and published ATmega/Arduino code for encoding it yet. But keep in mind it's going to be hard to fly autonomously without feedback from sensor data that is only available onboard or a vision system drastically more complicated than an Arduino can handle. \$\endgroup\$ Jul 24, 2014 at 20:43

3 Answers 3

1
\$\begingroup\$

You can be almost certain that the potentiometers used current are set up as voltage dividers. If you measure the three legs, they should be connected as power supply, voltage out and ground.

If this is the case, then you can just inject an analog voltage using a digitally controlled DAC if you need fast response, or use an RC filter to give an analog output from the PWM output of the Arduino if you don't.

Either way, you'll need to ensure the supply voltages match so that the highest voltage you measured on the potentiometer legs is the same as the maximum output of the DAC. By default, a standard Arduino, if you're using PWM output, will output up to 5V. Chances are the supply voltage required will be either 5V or 3.3V

\$\endgroup\$
2
  • \$\begingroup\$ Thank you very much! I soldered up a simple 220k ohm resistor and a 100nF capacitor and was able to get smooth analog out of my Arduino PWM pins. \$\endgroup\$ Jul 26, 2014 at 0:24
  • \$\begingroup\$ And then after that, I mapped out the voltage used by the former potentiometer. The min was 0v and max was 2.7v. I wrote some code and got the Arduino to constrain to that voltage and finally got stuff up and running. \$\endgroup\$ Jul 26, 2014 at 0:25
4
\$\begingroup\$

The Arduino can talk to multiple SPI slaves. Not at the same exact time, but faster than human reaction times. Each SPI slave has its own CS (Chip Select) pin, which when driven low, activates the SPI interface. One Arduino digital pin per chip. Then all the SPI Pots will use the same SPI bus pins. Your sketch would require that you toggle the Chip Select for each Pot separately, before you send data through the SPI port.

\$\endgroup\$
1
\$\begingroup\$

Actually, there are quite a few I²C digital pots. The AD5243 is a dual I²C pot each with 256 steps, and comes with full-scale resistances of either 2.5kΩ, 10kΩ, 50kΩ, or 100kΩ. It costs $2.64 from Digi-Key.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.