Electronic – arduino – How to emulate two analog joysticks (potentiometers) with an Arduino

arduinopotentiometerspi

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.

Best Answer

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