I'm trying to work with an Arduino and Analog thumb stick to get values for a simple differential drive robot I'm working on. The Keyes_Sjoys Arduino Joystick Module I have in my possession is giving me some strange numbers however.

Following axises Data I have:

  • X-axis range of 0 to a shaky 470-520 with a center value of 40.
  • Y-axis range of a solid 4 to solid 1023 with a center value of 605.


I haven't used analog sensors before but it seems pretty obvious that my X-axis ranges should feel somewhat similar to the Y-axis but they don't. In addition, the X-axis hits zero way way before even coming close to the edge for its operating range.

Is my sensor plain broke (it's new), or is there some way I can recalibrate the potentiometer?

Update 1: Wiring is the same as in this tutorial, and I used the same code, just added another analog input. http://arduino.cc/en/Tutorial/AnalogReadSerial

void setup(){
void loop(){
  int X = analogRead(A0);
  int Y = analogRead(A1);

  Serial.print("X = ");
  Serial.print(" Y = ");
  • \$\begingroup\$ One way to test it would be to measure the resistance of each axis with a multimeter to isolate if it's the joystick or a potential code / ADC problem. I'd expect the axes should be relatively similar. \$\endgroup\$
    – PeterJ
    Commented Sep 1, 2013 at 3:35
  • \$\begingroup\$ How exactly have you wired the two together? \$\endgroup\$
    – Dave Tweed
    Commented Sep 1, 2013 at 3:48
  • \$\begingroup\$ Updated with code and wiring. \$\endgroup\$ Commented Sep 1, 2013 at 3:58
  • \$\begingroup\$ Read on decoupling capacitors or refer to this post . \$\endgroup\$
    – yazjack
    Commented Mar 24, 2017 at 12:16

1 Answer 1

  1. Physically disconnect all connections of the module from the Arduino.
  2. Then, check the resistance between the Vcc pin of the module and the actual pins at each end of each little potentiometer in the joystick device on the module.
  3. Similarly, check resistance between the Ground pin of the module and the physical pins at each end of each potentiometer in the joystick device.
  4. Finally check the resistance between the VRx pin and each of the center contacts of the little potentiometers, and similarly with VRy.

In a working module, in each case you should see a zero or nearly zero (~10 Ohms) resistance for one specific potentiometer pin from the module pin.

Almost definitely the soldering of one of the device pins on the module board is not perfect - Most likely the Vcc pin to one of the X-axis potentiometer's pins won't give you the low resistance reading expected.

Re-solder that connection on the little PCB.


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.