I bought a fun little Hubsan X2 (v2) quadcopter which comes with a nice remote control. I intend to be able to address the controls myself so I opened up the remote and as expected, the two 2-axis joysticks appear to be just potentiometers and a pushbutton, very much like Sparkfun's or Adafruit's product - at least as far as the eye can see. I see in those product descriptions that reading the potentiometers is done by simply reading the value of the middle pin with the analog ports of an Arduino. You'd expect the potentiometers to be linear then.
Okay, so before just going ahead and hacking away I decided to first measure the resistance over the potentiometer and see what its range is. Here I got some puzzling readings which you can see in the chart here. Note how the cart is asymmetrical. This is really puzzling me.
What am I missing here?
Chart of the readings:
All of the axes on this remote control result in this set of measurements. Is this weird?
Either I'm not measuring things correctly (I expect this do be true) or this is a case of a more complex component than the Sparkfun / Adafruit one. Will I have to measure both pots in one joystick component and cross-reference them in some way in order to get the wanted x/y position?
Measuring resistance on an assembled circuit is not a good idea, except for finding connected pins. Better measure the output voltage in powered up state, as you would get when connecting some other device to the joystick.
Thanks for the replies DrDietrich and Archibald. From your replies I gather that measuring while still connected to the pcb is not the best idea. That sort of crossed my mind but I couldn't explain to myself why it would matter. It's a simple enough kind of thing and the batteries weren't connected. What kind of elements on the PCB would influence my readings?
In any event, I'll measure the voltages while the devices is working, maybe that will change things.
Bombarie:
What kind of elements on the PCB would influence my readings?
Any component on the PCB could influence your resistance readings.
Take a much simpler PCB here. Its circuit diagram is:
If you trying measuring the resistance between Xout and GND, some current from your ohmmeter will flow via the Y potentiometer as well as in the X potentiometer. So with the joystick held fully over in one direction you will read 0Ω and in the other direction 5KΩ, not 10kΩ. In the mid position your ohmmeter would read 3.75kΩ, not 5kΩ as you may expect.
By the way, does your "percentage" measurement relate to the angle of the joystick knob?
Archibald:
If you trying measuring the resistance between Xout and GND, some current from your ohmmeter will flow via the Y potentiometer as well as in the X potentiometer. So with the joystick held fully over in one direction you will read 0Ω and in the other direction 5KΩ, not 10kΩ. In the mid position your ohmmeter would read 3.75kΩ, not 5kΩ as you may expect.
That's very insightful, thank you! I gather that measuring voltages over the pots when the controller is powered on would give better results?
Archibald:
By the way, does your "percentage" measurement relate to the angle of the joystick knob?
Yes. 0% and 100% are the extremes of the joystick knob.
Just to update: I measured the voltages across the four pots while the remote control was powered. I measured between 0v-3.3v (linear), which makes much more sense. Thanks again for the input!